diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libssl/s3_clnt.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/lib/libssl/s3_clnt.c b/src/lib/libssl/s3_clnt.c index c2f5ea4e07..e33d745b19 100644 --- a/src/lib/libssl/s3_clnt.c +++ b/src/lib/libssl/s3_clnt.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: s3_clnt.c,v 1.133 2015/09/12 20:56:14 jsing Exp $ */ | 1 | /* $OpenBSD: s3_clnt.c,v 1.134 2015/09/13 12:39:16 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 | * |
| @@ -1975,7 +1975,7 @@ ssl3_client_kex_ecdh(SSL *s, SESS_CERT *sess_cert, unsigned char *p, | |||
| 1975 | unsigned char *encodedPoint = NULL; | 1975 | unsigned char *encodedPoint = NULL; |
| 1976 | unsigned long alg_k; | 1976 | unsigned long alg_k; |
| 1977 | int encoded_pt_len = 0; | 1977 | int encoded_pt_len = 0; |
| 1978 | int field_size = 0; | 1978 | int key_size; |
| 1979 | EC_KEY *tkey; | 1979 | EC_KEY *tkey; |
| 1980 | int ret = -1; | 1980 | int ret = -1; |
| 1981 | int n; | 1981 | int n; |
| @@ -2035,13 +2035,12 @@ ssl3_client_kex_ecdh(SSL *s, SESS_CERT *sess_cert, unsigned char *p, | |||
| 2035 | * Use the 'p' output buffer for the ECDH key, but make sure to clear | 2035 | * Use the 'p' output buffer for the ECDH key, but make sure to clear |
| 2036 | * it out afterwards. | 2036 | * it out afterwards. |
| 2037 | */ | 2037 | */ |
| 2038 | field_size = EC_GROUP_get_degree(srvr_group); | 2038 | key_size = ECDH_size(clnt_ecdh); |
| 2039 | if (field_size <= 0) { | 2039 | if (key_size <= 0) { |
| 2040 | SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE, ERR_R_ECDH_LIB); | 2040 | SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE, ERR_R_ECDH_LIB); |
| 2041 | goto err; | 2041 | goto err; |
| 2042 | } | 2042 | } |
| 2043 | n = ECDH_compute_key(p, (field_size + 7) / 8, srvr_ecpoint, clnt_ecdh, | 2043 | n = ECDH_compute_key(p, key_size, srvr_ecpoint, clnt_ecdh, NULL); |
| 2044 | NULL); | ||
| 2045 | if (n <= 0) { | 2044 | if (n <= 0) { |
| 2046 | SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE, ERR_R_ECDH_LIB); | 2045 | SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE, ERR_R_ECDH_LIB); |
| 2047 | goto err; | 2046 | goto err; |
