Always generate DH keys for ephemeral DH cipher suites
Modified version of the commit ffaef3f15
in the master branch by Stephen
Henson. This makes the SSL_OP_SINGLE_DH_USE option a no-op and always
generates a new DH key for every handshake regardless.
CVE-2016-0701 (fix part 2 or 2)
Issue reported by Antonio Sanso
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
This commit is contained in:
14
ssl/s3_lib.c
14
ssl/s3_lib.c
@@ -3206,13 +3206,6 @@ long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg)
|
||||
SSLerr(SSL_F_SSL3_CTRL, ERR_R_DH_LIB);
|
||||
return (ret);
|
||||
}
|
||||
if (!(s->options & SSL_OP_SINGLE_DH_USE)) {
|
||||
if (!DH_generate_key(dh)) {
|
||||
DH_free(dh);
|
||||
SSLerr(SSL_F_SSL3_CTRL, ERR_R_DH_LIB);
|
||||
return (ret);
|
||||
}
|
||||
}
|
||||
if (s->cert->dh_tmp != NULL)
|
||||
DH_free(s->cert->dh_tmp);
|
||||
s->cert->dh_tmp = dh;
|
||||
@@ -3713,13 +3706,6 @@ long ssl3_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg)
|
||||
SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_DH_LIB);
|
||||
return 0;
|
||||
}
|
||||
if (!(ctx->options & SSL_OP_SINGLE_DH_USE)) {
|
||||
if (!DH_generate_key(new)) {
|
||||
SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_DH_LIB);
|
||||
DH_free(new);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (cert->dh_tmp != NULL)
|
||||
DH_free(cert->dh_tmp);
|
||||
cert->dh_tmp = new;
|
||||
|
Reference in New Issue
Block a user