Skip to content
Snippets Groups Projects
Commit 2864c9c3 authored by Rich Megginson's avatar Rich Megginson Committed by Quanah Gibson-Mount
Browse files

ITS#7001 MozNSS: free the return of tlsm_find_and_verify_cert_key

If tlsm_find_and_verify_cert_key finds the cert and/or key, and it fails
to verify them, it will leave them allocated for the caller to dispose of.
There were a couple of places that were not disposing of the cert and key
upon error.
parent b0f28f31
No related branches found
No related tags found
No related merge requests found
......@@ -1811,6 +1811,14 @@ tlsm_get_client_auth_data( void *arg, PRFileDesc *fd,
Debug( LDAP_DEBUG_ANY,
"TLS: error: unable to perform client certificate authentication for "
"certificate named %s\n", ctx->tc_certname, 0, 0 );
if ( pRetKey && *pRetKey ) {
SECKEY_DestroyPrivateKey( *pRetKey );
*pRetKey = NULL;
}
if ( pRetCert && *pRetCert ) {
CERT_DestroyCertificate( *pRetCert );
*pRetCert = NULL;
}
return SECFailure;
}
......@@ -2162,6 +2170,8 @@ tlsm_deferred_ctx_init( void *arg )
Debug( LDAP_DEBUG_ANY,
"TLS: error: unable to find and verify server's cert and key for certificate %s\n",
ctx->tc_certname, 0, 0 );
CERT_DestroyCertificate( serverCert );
SECKEY_DestroyPrivateKey( serverKey );
return -1;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment