diff options
Diffstat (limited to 'src/lib/libssl/ssl_lib.c')
-rw-r--r-- | src/lib/libssl/ssl_lib.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/src/lib/libssl/ssl_lib.c b/src/lib/libssl/ssl_lib.c index 4bc4ce5b3a..4a87a146e3 100644 --- a/src/lib/libssl/ssl_lib.c +++ b/src/lib/libssl/ssl_lib.c | |||
@@ -1405,24 +1405,13 @@ void SSL_CTX_free(SSL_CTX *a) | |||
1405 | abort(); /* ok */ | 1405 | abort(); /* ok */ |
1406 | } | 1406 | } |
1407 | #endif | 1407 | #endif |
1408 | |||
1409 | /* | ||
1410 | * Free internal session cache. However: the remove_cb() may reference | ||
1411 | * the ex_data of SSL_CTX, thus the ex_data store can only be removed | ||
1412 | * after the sessions were flushed. | ||
1413 | * As the ex_data handling routines might also touch the session cache, | ||
1414 | * the most secure solution seems to be: empty (flush) the cache, then | ||
1415 | * free ex_data, then finally free the cache. | ||
1416 | * (See ticket [openssl.org #212].) | ||
1417 | */ | ||
1418 | if (a->sessions != NULL) | ||
1419 | SSL_CTX_flush_sessions(a,0); | ||
1420 | |||
1421 | CRYPTO_free_ex_data(CRYPTO_EX_INDEX_SSL_CTX, a, &a->ex_data); | 1408 | CRYPTO_free_ex_data(CRYPTO_EX_INDEX_SSL_CTX, a, &a->ex_data); |
1422 | 1409 | ||
1423 | if (a->sessions != NULL) | 1410 | if (a->sessions != NULL) |
1411 | { | ||
1412 | SSL_CTX_flush_sessions(a,0); | ||
1424 | lh_free(a->sessions); | 1413 | lh_free(a->sessions); |
1425 | 1414 | } | |
1426 | if (a->cert_store != NULL) | 1415 | if (a->cert_store != NULL) |
1427 | X509_STORE_free(a->cert_store); | 1416 | X509_STORE_free(a->cert_store); |
1428 | if (a->cipher_list != NULL) | 1417 | if (a->cipher_list != NULL) |
@@ -2300,3 +2289,10 @@ void SSL_set_msg_callback(SSL *ssl, void (*cb)(int write_p, int version, int con | |||
2300 | 2289 | ||
2301 | IMPLEMENT_STACK_OF(SSL_CIPHER) | 2290 | IMPLEMENT_STACK_OF(SSL_CIPHER) |
2302 | IMPLEMENT_STACK_OF(SSL_COMP) | 2291 | IMPLEMENT_STACK_OF(SSL_COMP) |
2292 | |||
2293 | void OpenSSLDie(const char *file,int line,const char *assertion) | ||
2294 | { | ||
2295 | fprintf(stderr,"%s(%d): OpenSSL internal error, assertion failed: %s\n", | ||
2296 | file,line,assertion); | ||
2297 | abort(); | ||
2298 | } | ||