diff options
author | miod <> | 2016-11-08 20:01:06 +0000 |
---|---|---|
committer | miod <> | 2016-11-08 20:01:06 +0000 |
commit | 5605f577187336e02b609bad906ab42478c7340a (patch) | |
tree | 39318fe771bd94c87998e1dd5db6fa0412737647 /src/lib/libcrypto/x509v3 | |
parent | b7cb70902c58c927b969ecac46828718a5ff0497 (diff) | |
download | openbsd-5605f577187336e02b609bad906ab42478c7340a.tar.gz openbsd-5605f577187336e02b609bad906ab42478c7340a.tar.bz2 openbsd-5605f577187336e02b609bad906ab42478c7340a.zip |
Stricter checks of ASN1_INTEGER to reject ASN1_NEG_INTEGER in places when
they don't make sense.
ok beck@
Diffstat (limited to 'src/lib/libcrypto/x509v3')
-rw-r--r-- | src/lib/libcrypto/x509v3/v3_purp.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/lib/libcrypto/x509v3/v3_purp.c b/src/lib/libcrypto/x509v3/v3_purp.c index 69a8d05f26..a091a7f425 100644 --- a/src/lib/libcrypto/x509v3/v3_purp.c +++ b/src/lib/libcrypto/x509v3/v3_purp.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: v3_purp.c,v 1.26 2015/02/10 13:28:17 jsing Exp $ */ | 1 | /* $OpenBSD: v3_purp.c,v 1.27 2016/11/08 20:01:06 miod 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 2001. | 3 | * project 2001. |
4 | */ | 4 | */ |
@@ -450,8 +450,14 @@ x509v3_cache_extensions(X509 *x) | |||
450 | x->ex_flags |= EXFLAG_INVALID; | 450 | x->ex_flags |= EXFLAG_INVALID; |
451 | } | 451 | } |
452 | if (pci->pcPathLengthConstraint) { | 452 | if (pci->pcPathLengthConstraint) { |
453 | x->ex_pcpathlen = | 453 | if (pci->pcPathLengthConstraint->type == |
454 | ASN1_INTEGER_get(pci->pcPathLengthConstraint); | 454 | V_ASN1_NEG_INTEGER) { |
455 | x->ex_flags |= EXFLAG_INVALID; | ||
456 | x->ex_pcpathlen = 0; | ||
457 | } else | ||
458 | x->ex_pcpathlen = | ||
459 | ASN1_INTEGER_get(pci-> | ||
460 | pcPathLengthConstraint); | ||
455 | } else | 461 | } else |
456 | x->ex_pcpathlen = -1; | 462 | x->ex_pcpathlen = -1; |
457 | PROXY_CERT_INFO_EXTENSION_free(pci); | 463 | PROXY_CERT_INFO_EXTENSION_free(pci); |