Check key/cert pair in ssl_set_own_cert()

This commit is contained in:
Manuel Pégourié-Gonnard 2014-11-06 17:32:48 +01:00
parent 70bdadf54b
commit 27e3edbe2c

View File

@ -3751,7 +3751,7 @@ int ssl_set_own_cert( ssl_context *ssl, x509_crt *own_cert,
key_cert->cert = own_cert;
key_cert->key = pk_key;
return( 0 );
return( pk_check_pair( &key_cert->cert->pk, key_cert->key ) );
}
#if defined(POLARSSL_RSA_C)
@ -3780,7 +3780,7 @@ int ssl_set_own_cert_rsa( ssl_context *ssl, x509_crt *own_cert,
key_cert->cert = own_cert;
key_cert->key_own_alloc = 1;
return( 0 );
return( pk_check_pair( &key_cert->cert->pk, key_cert->key ) );
}
#endif /* POLARSSL_RSA_C */
@ -3809,7 +3809,7 @@ int ssl_set_own_cert_alt( ssl_context *ssl, x509_crt *own_cert,
key_cert->cert = own_cert;
key_cert->key_own_alloc = 1;
return( 0 );
return( pk_check_pair( &key_cert->cert->pk, key_cert->key ) );
}
#endif /* POLARSSL_X509_CRT_PARSE_C */