diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/ec/ec_asn1.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/libcrypto/ec/ec_asn1.c b/src/lib/libcrypto/ec/ec_asn1.c index dddf71c6e5..b64b7e14d3 100644 --- a/src/lib/libcrypto/ec/ec_asn1.c +++ b/src/lib/libcrypto/ec/ec_asn1.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ec_asn1.c,v 1.23 2017/01/29 17:49:23 beck Exp $ */ | 1 | /* $OpenBSD: ec_asn1.c,v 1.24 2017/05/26 16:32:14 jsing Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Written by Nils Larsch for the OpenSSL project. | 3 | * Written by Nils Larsch for the OpenSSL project. |
| 4 | */ | 4 | */ |
| @@ -1390,8 +1390,14 @@ d2i_ECPrivateKey(EC_KEY ** a, const unsigned char **in, long len) | |||
| 1390 | ECerror(ERR_R_EC_LIB); | 1390 | ECerror(ERR_R_EC_LIB); |
| 1391 | goto err; | 1391 | goto err; |
| 1392 | } | 1392 | } |
| 1393 | |||
| 1393 | pub_oct = ASN1_STRING_data(priv_key->publicKey); | 1394 | pub_oct = ASN1_STRING_data(priv_key->publicKey); |
| 1394 | pub_oct_len = ASN1_STRING_length(priv_key->publicKey); | 1395 | pub_oct_len = ASN1_STRING_length(priv_key->publicKey); |
| 1396 | if (pub_oct == NULL || pub_oct_len <= 0) { | ||
| 1397 | ECerror(EC_R_BUFFER_TOO_SMALL); | ||
| 1398 | goto err; | ||
| 1399 | } | ||
| 1400 | |||
| 1395 | /* save the point conversion form */ | 1401 | /* save the point conversion form */ |
| 1396 | ret->conv_form = (point_conversion_form_t) (pub_oct[0] & ~0x01); | 1402 | ret->conv_form = (point_conversion_form_t) (pub_oct[0] & ~0x01); |
| 1397 | if (!EC_POINT_oct2point(ret->group, ret->pub_key, | 1403 | if (!EC_POINT_oct2point(ret->group, ret->pub_key, |
