summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/x509v3/v3_sxnet.c
diff options
context:
space:
mode:
authortb <>2019-03-13 20:34:00 +0000
committertb <>2019-03-13 20:34:00 +0000
commit5ac8b80c66d7d9f6dab1bfdf23f0578eb05dffa0 (patch)
tree81f6ab2828c3099781b20bfb3c3d4c20a8449029 /src/lib/libcrypto/x509v3/v3_sxnet.c
parent949d9e712f1c305bf193db2c3d0528f18d77fbcf (diff)
downloadopenbsd-5ac8b80c66d7d9f6dab1bfdf23f0578eb05dffa0.tar.gz
openbsd-5ac8b80c66d7d9f6dab1bfdf23f0578eb05dffa0.tar.bz2
openbsd-5ac8b80c66d7d9f6dab1bfdf23f0578eb05dffa0.zip
Fix a number of ASN1_INTEGER vs ASN1_STRING mixups coming from the
mechanical M_ASN1 macro expansion. The ASN1_INTEGER_cmp function takes signs into account while ASN1_STRING_cmp doesn't. The mixups mostly involve serialNumbers, which, in principle, should be positive. However, it is unclear whether that is checked or enforced anywhere in the code, so these are probably bugs. Patch from Holger Mikolon ok jsing
Diffstat (limited to 'src/lib/libcrypto/x509v3/v3_sxnet.c')
-rw-r--r--src/lib/libcrypto/x509v3/v3_sxnet.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libcrypto/x509v3/v3_sxnet.c b/src/lib/libcrypto/x509v3/v3_sxnet.c
index 53db28248a..400bc26346 100644
--- a/src/lib/libcrypto/x509v3/v3_sxnet.c
+++ b/src/lib/libcrypto/x509v3/v3_sxnet.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_sxnet.c,v 1.21 2018/05/13 15:03:01 tb Exp $ */ 1/* $OpenBSD: v3_sxnet.c,v 1.22 2019/03/13 20:34:00 tb Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 1999. 3 * project 1999.
4 */ 4 */
@@ -376,7 +376,7 @@ SXNET_get_id_INTEGER(SXNET *sx, ASN1_INTEGER *zone)
376 376
377 for (i = 0; i < sk_SXNETID_num(sx->ids); i++) { 377 for (i = 0; i < sk_SXNETID_num(sx->ids); i++) {
378 id = sk_SXNETID_value(sx->ids, i); 378 id = sk_SXNETID_value(sx->ids, i);
379 if (!ASN1_STRING_cmp(id->zone, zone)) 379 if (!ASN1_INTEGER_cmp(id->zone, zone))
380 return id->user; 380 return id->user;
381 } 381 }
382 return NULL; 382 return NULL;