summaryrefslogtreecommitdiff
path: root/lib/libcrypto/x509/x509_cmp.c
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2019-03-13 20:34:01 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2019-03-13 20:34:01 +0000
commit6e81bed7e73cc9f54a8b8d4fc0da3f9ff0b9dc68 (patch)
tree85d569e0ecad3ae53ccee48facd3dfee92ca1fd3 /lib/libcrypto/x509/x509_cmp.c
parent499b7cd2e3d3ae8d46ea7525c2e0209e99ce0b0e (diff)
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 'lib/libcrypto/x509/x509_cmp.c')
-rw-r--r--lib/libcrypto/x509/x509_cmp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libcrypto/x509/x509_cmp.c b/lib/libcrypto/x509/x509_cmp.c
index 2141f871e5e..6d6e8408994 100644
--- a/lib/libcrypto/x509/x509_cmp.c
+++ b/lib/libcrypto/x509/x509_cmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509_cmp.c,v 1.34 2018/08/24 19:59:32 tb Exp $ */
+/* $OpenBSD: x509_cmp.c,v 1.35 2019/03/13 20:34:00 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -76,7 +76,7 @@ X509_issuer_and_serial_cmp(const X509 *a, const X509 *b)
ai = a->cert_info;
bi = b->cert_info;
- i = ASN1_STRING_cmp(ai->serialNumber, bi->serialNumber);
+ i = ASN1_INTEGER_cmp(ai->serialNumber, bi->serialNumber);
if (i)
return (i);
return (X509_NAME_cmp(ai->issuer, bi->issuer));