diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2015-12-24 00:23:29 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2015-12-24 00:23:29 +0000 |
commit | b22d71131aa01d371029908e3c2bce332fd77e70 (patch) | |
tree | 1c50eccde56c2ae60f4f1ee1a0bfd6d823575155 | |
parent | e2b420fdd708e14a0b43a21cd2377cafb0d54c02 (diff) |
fix no-ec
Reviewed-by: Matt Caswell <matt@openssl.org>
-rw-r--r-- | ssl/s3_lib.c | 18 | ||||
-rw-r--r-- | ssl/ssl_locl.h | 7 | ||||
-rw-r--r-- | ssl/statem/statem_srvr.c | 4 |
3 files changed, 8 insertions, 21 deletions
diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index 848953a454..097ccac0fe 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -3375,17 +3375,11 @@ void ssl3_free(SSL *s) ssl3_cleanup_key_block(s); -#ifndef OPENSSL_NO_DH - DH_free(s->s3->tmp.dh); -#endif - -#ifndef OPENSSL_NO_EC - EVP_PKEY_free(s->s3->tmp.pkey); - s->s3->tmp.pkey = NULL; -#endif #if !defined(OPENSSL_NO_EC) || !defined(OPENSSL_NO_DH) EVP_PKEY_free(s->s3->peer_tmp); s->s3->peer_tmp = NULL; + EVP_PKEY_free(s->s3->tmp.pkey); + s->s3->tmp.pkey = NULL; #endif sk_X509_NAME_pop_free(s->s3->tmp.ca_names, X509_NAME_free); @@ -3413,16 +3407,12 @@ void ssl3_clear(SSL *s) OPENSSL_free(s->s3->tmp.peer_sigalgs); s->s3->tmp.peer_sigalgs = NULL; -#ifndef OPENSSL_NO_DH - DH_free(s->s3->tmp.dh); - s->s3->tmp.dh = NULL; -#endif #ifndef OPENSSL_NO_EC - EVP_PKEY_free(s->s3->tmp.pkey); - s->s3->tmp.pkey = NULL; s->s3->is_probably_safari = 0; #endif #if !defined(OPENSSL_NO_EC) || !defined(OPENSSL_NO_DH) + EVP_PKEY_free(s->s3->tmp.pkey); + s->s3->tmp.pkey = NULL; EVP_PKEY_free(s->s3->peer_tmp); s->s3->peer_tmp = NULL; #endif /* !OPENSSL_NO_EC */ diff --git a/ssl/ssl_locl.h b/ssl/ssl_locl.h index 4afb0d45ee..4db32a9294 100644 --- a/ssl/ssl_locl.h +++ b/ssl/ssl_locl.h @@ -1227,11 +1227,8 @@ typedef struct ssl3_state_st { int message_type; /* used to hold the new cipher we are going to use */ const SSL_CIPHER *new_cipher; -# ifndef OPENSSL_NO_DH - DH *dh; -# endif -# ifndef OPENSSL_NO_EC - EVP_PKEY *pkey; /* holds short lived ECDH key */ +# if !defined(OPENSSL_NO_EC) || !defined(OPENSSL_NO_DH) + EVP_PKEY *pkey; /* holds short lived DH/ECDH key */ # endif /* used for certificate requests */ int cert_req; diff --git a/ssl/statem/statem_srvr.c b/ssl/statem/statem_srvr.c index 89f064c5f9..38f01e1054 100644 --- a/ssl/statem/statem_srvr.c +++ b/ssl/statem/statem_srvr.c @@ -2127,7 +2127,7 @@ MSG_PROCESS_RETURN tls_process_client_key_exchange(SSL *s, PACKET *pkt) RSA *rsa = NULL; EVP_PKEY *pkey = NULL; #endif -#ifndef OPENSSL_NO_EC +#if !defined(OPENSSL_NO_EC) || !defined(OPENSSL_NO_DH) EVP_PKEY *ckey = NULL; #endif PACKET enc_premaster; @@ -2616,7 +2616,7 @@ MSG_PROCESS_RETURN tls_process_client_key_exchange(SSL *s, PACKET *pkt) #if !defined(OPENSSL_NO_DH) || !defined(OPENSSL_NO_RSA) || !defined(OPENSSL_NO_EC) || defined(OPENSSL_NO_SRP) err: #endif -#ifndef OPENSSL_NO_EC +#if !defined(OPENSSL_NO_EC) || !defined(OPENSSL_NO_DH) EVP_PKEY_free(ckey); #endif OPENSSL_free(rsa_decrypt); |