diff options
author | tb <> | 2019-03-13 20:34:00 +0000 |
---|---|---|
committer | tb <> | 2019-03-13 20:34:00 +0000 |
commit | e44d7af88579ebe18a2d8ef57242b067993706b1 (patch) | |
tree | 81f6ab2828c3099781b20bfb3c3d4c20a8449029 /src/lib/libcrypto/pkcs7/pk7_doit.c | |
parent | 06abece690d53a96a5357c7304e3672e1601f54a (diff) | |
download | openbsd-e44d7af88579ebe18a2d8ef57242b067993706b1.tar.gz openbsd-e44d7af88579ebe18a2d8ef57242b067993706b1.tar.bz2 openbsd-e44d7af88579ebe18a2d8ef57242b067993706b1.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/pkcs7/pk7_doit.c')
-rw-r--r-- | src/lib/libcrypto/pkcs7/pk7_doit.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libcrypto/pkcs7/pk7_doit.c b/src/lib/libcrypto/pkcs7/pk7_doit.c index 24ab957b4c..d0c27e98a9 100644 --- a/src/lib/libcrypto/pkcs7/pk7_doit.c +++ b/src/lib/libcrypto/pkcs7/pk7_doit.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: pk7_doit.c,v 1.42 2017/05/02 03:59:45 deraadt Exp $ */ | 1 | /* $OpenBSD: pk7_doit.c,v 1.43 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 | * |
@@ -410,7 +410,7 @@ pkcs7_cmp_ri(PKCS7_RECIP_INFO *ri, X509 *pcert) | |||
410 | pcert->cert_info->issuer); | 410 | pcert->cert_info->issuer); |
411 | if (ret) | 411 | if (ret) |
412 | return ret; | 412 | return ret; |
413 | return ASN1_STRING_cmp(pcert->cert_info->serialNumber, | 413 | return ASN1_INTEGER_cmp(pcert->cert_info->serialNumber, |
414 | ri->issuer_and_serial->serial); | 414 | ri->issuer_and_serial->serial); |
415 | } | 415 | } |
416 | 416 | ||