summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/x509/x509_addr.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/libcrypto/x509/x509_addr.c b/src/lib/libcrypto/x509/x509_addr.c
index 3686d6a823..225f961002 100644
--- a/src/lib/libcrypto/x509/x509_addr.c
+++ b/src/lib/libcrypto/x509/x509_addr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_addr.c,v 1.43 2021/12/28 20:50:37 tb Exp $ */ 1/* $OpenBSD: x509_addr.c,v 1.44 2021/12/28 20:58:05 tb Exp $ */
2/* 2/*
3 * Contributed to the OpenSSL Project by the American Registry for 3 * Contributed to the OpenSSL Project by the American Registry for
4 * Internet Numbers ("ARIN"). 4 * Internet Numbers ("ARIN").
@@ -1274,10 +1274,16 @@ IPAddressOrRanges_canonize(IPAddressOrRanges *aors, const unsigned afi)
1274int 1274int
1275X509v3_addr_canonize(IPAddrBlocks *addr) 1275X509v3_addr_canonize(IPAddrBlocks *addr)
1276{ 1276{
1277 unsigned int afi;
1277 int i; 1278 int i;
1278 1279
1279 for (i = 0; i < sk_IPAddressFamily_num(addr); i++) { 1280 for (i = 0; i < sk_IPAddressFamily_num(addr); i++) {
1280 IPAddressFamily *f = sk_IPAddressFamily_value(addr, i); 1281 IPAddressFamily *f = sk_IPAddressFamily_value(addr, i);
1282
1283 /* Check AFI/SAFI here - IPAddressFamily_cmp() can't error. */
1284 if ((afi = X509v3_addr_get_afi(f)) == 0)
1285 return 0;
1286
1281 if (f->ipAddressChoice->type == 1287 if (f->ipAddressChoice->type ==
1282 IPAddressChoice_addressesOrRanges && 1288 IPAddressChoice_addressesOrRanges &&
1283 !IPAddressOrRanges_canonize(f->ipAddressChoice->u.addressesOrRanges, 1289 !IPAddressOrRanges_canonize(f->ipAddressChoice->u.addressesOrRanges,