mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 20:33:31 +01:00
Free tls resources on exit too
svn:r3615
This commit is contained in:
parent
f672577bc6
commit
5d836c8140
@ -156,6 +156,17 @@ tor_tls_init(void) {
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
tor_tls_free_all(void)
|
||||
{
|
||||
if (global_tls_context) {
|
||||
SSL_CTX_free(global_tls_context->ctx);
|
||||
SSL_CTX_free(global_tls_context->client_only_ctx);
|
||||
tor_free(global_tls_context);
|
||||
global_tls_context = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/** We need to give OpenSSL a callback to verify certificates. This is
|
||||
* it: We always accept peer certs and complete the handshake. We
|
||||
* don't validate them until later.
|
||||
|
@ -24,6 +24,7 @@ typedef struct tor_tls_st tor_tls;
|
||||
#define TOR_TLS_WANTWRITE -1
|
||||
#define TOR_TLS_DONE 0
|
||||
|
||||
void tor_tls_free_all(void);
|
||||
int tor_tls_context_new(crypto_pk_env_t *rsa, int isServer,
|
||||
const char *nickname, unsigned int key_lifetime);
|
||||
tor_tls *tor_tls_new(int sock, int is_server, int use_no_cert);
|
||||
|
@ -1320,6 +1320,7 @@ void tor_free_all(void)
|
||||
connection_free_all();
|
||||
config_free_all();
|
||||
router_free_all_keys();
|
||||
tor_tls_free_all();
|
||||
/* stuff in main.c */
|
||||
smartlist_free(closeable_connection_lst);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user