Commit b2b2fb8
committed
ossl.c: make legacy locking callbacks reentrant
Although it's not documented explicitly that the locking callbacks must
provide reentrant mutexes, it seems to be required.
Specifically, the session_remove_cb callback function of an SSL_CTX is
called in a critical section for CRYPTO_LOCK_SSL_CTX, which is shared
across the library. This leads, if the callback function calls another
OpenSSL function that will attempt to lock CRYPTO_LOCK_SSL_CTX, to
deadlock. SSL_CTX_free() is one example of such a function.
http://ci.rvm.jp/results/trunk@P895/640011 parent 7dd6c28 commit b2b2fb8
1 file changed
+13
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
486 | 486 | | |
487 | 487 | | |
488 | 488 | | |
| 489 | + | |
| 490 | + | |
489 | 491 | | |
490 | 492 | | |
491 | 493 | | |
492 | 494 | | |
493 | 495 | | |
494 | 496 | | |
| 497 | + | |
495 | 498 | | |
496 | 499 | | |
497 | 500 | | |
498 | 501 | | |
499 | 502 | | |
500 | 503 | | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
501 | 510 | | |
| 511 | + | |
| 512 | + | |
502 | 513 | | |
503 | | - | |
| 514 | + | |
| 515 | + | |
504 | 516 | | |
505 | 517 | | |
506 | 518 | | |
| |||
0 commit comments