|
|
877dfe |
From 2c6c9d439b484e1ba9830d8454a34fa4f80fdfe9 Mon Sep 17 00:00:00 2001
|
|
|
877dfe |
From: Hugo Landau <hlandau@openssl.org>
|
|
|
877dfe |
Date: Tue, 17 Jan 2023 17:45:42 +0000
|
|
|
877dfe |
Subject: [PATCH 6/6] CVE-2023-0286: Fix GENERAL_NAME_cmp for x400Address
|
|
|
877dfe |
(1.1.1)
|
|
|
877dfe |
|
|
|
877dfe |
Reviewed-by: Paul Dale <pauli@openssl.org>
|
|
|
877dfe |
Reviewed-by: Tomas Mraz <tomas@openssl.org>
|
|
|
877dfe |
---
|
|
|
877dfe |
CHANGES | 18 +++++++++++++++++-
|
|
|
877dfe |
crypto/x509v3/v3_genn.c | 2 +-
|
|
|
877dfe |
include/openssl/x509v3.h | 2 +-
|
|
|
877dfe |
test/v3nametest.c | 8 ++++++++
|
|
|
877dfe |
4 files changed, 27 insertions(+), 3 deletions(-)
|
|
|
877dfe |
|
|
|
877dfe |
diff --git a/crypto/x509v3/v3_genn.c b/crypto/x509v3/v3_genn.c
|
|
|
877dfe |
index 87a5eff47c..e54ddc55c9 100644
|
|
|
877dfe |
--- a/crypto/x509v3/v3_genn.c
|
|
|
877dfe |
+++ b/crypto/x509v3/v3_genn.c
|
|
|
877dfe |
@@ -98,7 +98,7 @@ int GENERAL_NAME_cmp(GENERAL_NAME *a, GENERAL_NAME *b)
|
|
|
877dfe |
return -1;
|
|
|
877dfe |
switch (a->type) {
|
|
|
877dfe |
case GEN_X400:
|
|
|
877dfe |
- result = ASN1_TYPE_cmp(a->d.x400Address, b->d.x400Address);
|
|
|
877dfe |
+ result = ASN1_STRING_cmp(a->d.x400Address, b->d.x400Address);
|
|
|
877dfe |
break;
|
|
|
877dfe |
|
|
|
877dfe |
case GEN_EDIPARTY:
|
|
|
877dfe |
diff --git a/include/openssl/x509v3.h b/include/openssl/x509v3.h
|
|
|
877dfe |
index 90fa3592ce..e61c0f29d4 100644
|
|
|
877dfe |
--- a/include/openssl/x509v3.h
|
|
|
877dfe |
+++ b/include/openssl/x509v3.h
|
|
|
877dfe |
@@ -136,7 +136,7 @@ typedef struct GENERAL_NAME_st {
|
|
|
877dfe |
OTHERNAME *otherName; /* otherName */
|
|
|
877dfe |
ASN1_IA5STRING *rfc822Name;
|
|
|
877dfe |
ASN1_IA5STRING *dNSName;
|
|
|
877dfe |
- ASN1_TYPE *x400Address;
|
|
|
877dfe |
+ ASN1_STRING *x400Address;
|
|
|
877dfe |
X509_NAME *directoryName;
|
|
|
877dfe |
EDIPARTYNAME *ediPartyName;
|
|
|
877dfe |
ASN1_IA5STRING *uniformResourceIdentifier;
|
|
|
877dfe |
diff --git a/test/v3nametest.c b/test/v3nametest.c
|
|
|
877dfe |
index d1852190b8..37819da8fd 100644
|
|
|
877dfe |
--- a/test/v3nametest.c
|
|
|
877dfe |
+++ b/test/v3nametest.c
|
|
|
877dfe |
@@ -646,6 +646,14 @@ static struct gennamedata {
|
|
|
877dfe |
0xb7, 0x09, 0x02, 0x02
|
|
|
877dfe |
},
|
|
|
877dfe |
15
|
|
|
877dfe |
+ }, {
|
|
|
877dfe |
+ /*
|
|
|
877dfe |
+ * Regression test for CVE-2023-0286.
|
|
|
877dfe |
+ */
|
|
|
877dfe |
+ {
|
|
|
877dfe |
+ 0xa3, 0x00
|
|
|
877dfe |
+ },
|
|
|
877dfe |
+ 2
|
|
|
877dfe |
}
|
|
|
877dfe |
};
|
|
|
877dfe |
|
|
|
877dfe |
--
|
|
|
877dfe |
2.39.1
|
|
|
877dfe |
|