diff options
author | tedu <> | 2015-03-19 14:00:22 +0000 |
---|---|---|
committer | tedu <> | 2015-03-19 14:00:22 +0000 |
commit | 325847dec91a0775a2c9806147ab783c0737cc84 (patch) | |
tree | e1849327a9d18d917e7698c775d31f7ae7c4e34f /src/lib/libcrypto/asn1/n_pkey.c | |
parent | 5018b21486fe3d91084c0d32a86d1240d832e25e (diff) | |
download | openbsd-325847dec91a0775a2c9806147ab783c0737cc84.tar.gz openbsd-325847dec91a0775a2c9806147ab783c0737cc84.tar.bz2 openbsd-325847dec91a0775a2c9806147ab783c0737cc84.zip |
Fix several crash causing defects from OpenSSL.
These include:
CVE-2015-0209 - Use After Free following d2i_ECPrivatekey error
CVE-2015-0286 - Segmentation fault in ASN1_TYPE_cmp
CVE-2015-0287 - ASN.1 structure reuse memory corruption
CVE-2015-0289 - PKCS7 NULL pointer dereferences
Several other issues did not apply or were already fixed.
Refer to https://www.openssl.org/news/secadv_20150319.txt
joint work with beck, doug, guenther, jsing, miod
Diffstat (limited to 'src/lib/libcrypto/asn1/n_pkey.c')
-rw-r--r-- | src/lib/libcrypto/asn1/n_pkey.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/libcrypto/asn1/n_pkey.c b/src/lib/libcrypto/asn1/n_pkey.c index bb369fde6e..d3a7431356 100644 --- a/src/lib/libcrypto/asn1/n_pkey.c +++ b/src/lib/libcrypto/asn1/n_pkey.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: n_pkey.c,v 1.25 2015/02/11 04:00:39 jsing Exp $ */ | 1 | /* $OpenBSD: n_pkey.c,v 1.26 2015/03/19 14:00:22 tedu 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 | * |
@@ -340,11 +340,11 @@ d2i_RSA_NET(RSA **a, const unsigned char **pp, long length, | |||
340 | return NULL; | 340 | return NULL; |
341 | } | 341 | } |
342 | 342 | ||
343 | if ((enckey->os->length != 11) || (strncmp("private-key", | 343 | /* XXX 11 == strlen("private-key") */ |
344 | (char *)enckey->os->data, 11) != 0)) { | 344 | if (enckey->os->length != 11 || |
345 | memcmp("private-key", enckey->os->data, 11) != 0) { | ||
345 | ASN1err(ASN1_F_D2I_RSA_NET, ASN1_R_PRIVATE_KEY_HEADER_MISSING); | 346 | ASN1err(ASN1_F_D2I_RSA_NET, ASN1_R_PRIVATE_KEY_HEADER_MISSING); |
346 | NETSCAPE_ENCRYPTED_PKEY_free(enckey); | 347 | goto err; |
347 | return NULL; | ||
348 | } | 348 | } |
349 | if (OBJ_obj2nid(enckey->enckey->algor->algorithm) != NID_rc4) { | 349 | if (OBJ_obj2nid(enckey->enckey->algor->algorithm) != NID_rc4) { |
350 | ASN1err(ASN1_F_D2I_RSA_NET, | 350 | ASN1err(ASN1_F_D2I_RSA_NET, |