summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_clnt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/ssl_clnt.c')
-rw-r--r--src/lib/libssl/ssl_clnt.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/lib/libssl/ssl_clnt.c b/src/lib/libssl/ssl_clnt.c
index 04b3132d35..a3c78096f7 100644
--- a/src/lib/libssl/ssl_clnt.c
+++ b/src/lib/libssl/ssl_clnt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_clnt.c,v 1.121 2021/12/04 13:15:10 jsing Exp $ */ 1/* $OpenBSD: ssl_clnt.c,v 1.122 2021/12/04 13:50:35 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -1223,7 +1223,7 @@ ssl3_get_server_certificate(SSL *s)
1223static int 1223static int
1224ssl3_get_server_kex_dhe(SSL *s, EVP_PKEY **pkey, CBS *cbs) 1224ssl3_get_server_kex_dhe(SSL *s, EVP_PKEY **pkey, CBS *cbs)
1225{ 1225{
1226 int invalid_key; 1226 int invalid_params, invalid_key;
1227 SESS_CERT *sc = NULL; 1227 SESS_CERT *sc = NULL;
1228 DH *dh = NULL; 1228 DH *dh = NULL;
1229 long alg_a; 1229 long alg_a;
@@ -1234,16 +1234,13 @@ ssl3_get_server_kex_dhe(SSL *s, EVP_PKEY **pkey, CBS *cbs)
1234 if ((dh = DH_new()) == NULL) 1234 if ((dh = DH_new()) == NULL)
1235 goto err; 1235 goto err;
1236 1236
1237 if (!ssl_kex_peer_params_dhe(dh, cbs)) 1237 if (!ssl_kex_peer_params_dhe(dh, cbs, &invalid_params))
1238 goto decode_err; 1238 goto decode_err;
1239 if (!ssl_kex_peer_public_dhe(dh, cbs, &invalid_key)) 1239 if (!ssl_kex_peer_public_dhe(dh, cbs, &invalid_key))
1240 goto decode_err; 1240 goto decode_err;
1241 1241
1242 /* 1242 if (invalid_params) {
1243 * Check the strength of the DH key just constructed. 1243 ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER);
1244 * Reject keys weaker than 1024 bits.
1245 */
1246 if (DH_size(dh) < 1024 / 8) {
1247 SSLerror(s, SSL_R_BAD_DH_P_LENGTH); 1244 SSLerror(s, SSL_R_BAD_DH_P_LENGTH);
1248 goto err; 1245 goto err;
1249 } 1246 }