From 27e3edbe2c48a6ebd246e58e161df562bdf97045 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Thu, 6 Nov 2014 17:32:48 +0100 Subject: [PATCH] Check key/cert pair in ssl_set_own_cert() --- library/ssl_tls.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/ssl_tls.c b/library/ssl_tls.c index 6689894df..33d4678c1 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -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 */