summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1/asn1_lib.c
diff options
context:
space:
mode:
authortb <>2020-12-08 15:08:47 +0000
committertb <>2020-12-08 15:08:47 +0000
commit267ac14fa6781b6553b05a6d8dcdf99eaacc0edf (patch)
tree04d30b19586f2c165be5347140b51a43e96bb77e /src/lib/libcrypto/asn1/asn1_lib.c
parentede7983d76de701a5269bb2be80a23f8da520e42 (diff)
downloadopenbsd-libressl-v3.2.3.tar.gz
openbsd-libressl-v3.2.3.tar.bz2
openbsd-libressl-v3.2.3.zip
Fix a NULL dereference in GENERAL_NAME_cmp()libressl-v3.2.3
Comparing two GENERAL_NAME structures containing an EDIPARTYNAME can lead to a crash. This enables a denial of service attack for an attacker who can control both sides of the comparison. Issue reported to OpenSSL on Nov 9 by David Benjamin. OpenSSL shared the information with us on Dec 1st. Fix from Matt Caswell (OpenSSL) with a few small tweaks. ok jsing this is errata/6.8/008_asn1.patch.sig
Diffstat (limited to 'src/lib/libcrypto/asn1/asn1_lib.c')
-rw-r--r--src/lib/libcrypto/asn1/asn1_lib.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/libcrypto/asn1/asn1_lib.c b/src/lib/libcrypto/asn1/asn1_lib.c
index 5dc520c428..11e76b6f54 100644
--- a/src/lib/libcrypto/asn1/asn1_lib.c
+++ b/src/lib/libcrypto/asn1/asn1_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: asn1_lib.c,v 1.44 2018/11/17 09:34:11 tb Exp $ */ 1/* $OpenBSD: asn1_lib.c,v 1.44.10.1 2020/12/08 15:08:47 tb 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 *
@@ -388,6 +388,8 @@ ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b)
388{ 388{
389 int i; 389 int i;
390 390
391 if (a == NULL || b == NULL)
392 return -1;
391 i = (a->length - b->length); 393 i = (a->length - b->length);
392 if (i == 0) { 394 if (i == 0) {
393 i = memcmp(a->data, b->data, a->length); 395 i = memcmp(a->data, b->data, a->length);