summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1
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/asn1
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/asn1')
-rw-r--r--src/lib/libcrypto/asn1/x_crl.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/lib/libcrypto/asn1/x_crl.c b/src/lib/libcrypto/asn1/x_crl.c
index 0837ec15be..bc1783dbfb 100644
--- a/src/lib/libcrypto/asn1/x_crl.c
+++ b/src/lib/libcrypto/asn1/x_crl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x_crl.c,v 1.33 2018/08/24 19:55:58 tb Exp $ */ 1/* $OpenBSD: x_crl.c,v 1.34 2019/03/13 20:34:00 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 *
@@ -527,9 +527,7 @@ X509_CRL_dup(X509_CRL *x)
527static int 527static int
528X509_REVOKED_cmp(const X509_REVOKED * const *a, const X509_REVOKED * const *b) 528X509_REVOKED_cmp(const X509_REVOKED * const *a, const X509_REVOKED * const *b)
529{ 529{
530 return(ASN1_STRING_cmp( 530 return(ASN1_INTEGER_cmp((*a)->serialNumber, (*b)->serialNumber));
531 (ASN1_STRING *)(*a)->serialNumber,
532 (ASN1_STRING *)(*b)->serialNumber));
533} 531}
534 532
535int 533int