}
}
+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.
#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);