diff options
author | Matt Caswell <matt@openssl.org> | 2015-06-24 15:55:36 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2015-07-07 21:57:11 +0100 |
commit | 2aacec8f4a5ba1b365620a7b17fcce311ada93ad (patch) | |
tree | 7b044e3a99a10636ccbdce8741bbf4d9a41e12e0 /crypto | |
parent | 9cf315ef90d0cfeb8bb7a38873eea07a8f0dffec (diff) | |
download | openssl-2aacec8f4a5ba1b365620a7b17fcce311ada93ad.tar.gz |
Fix alternate chains certificate forgery issue
During certificate verfification, OpenSSL will attempt to find an
alternative certificate chain if the first attempt to build such a chain
fails. An error in the implementation of this logic can mean that an
attacker could cause certain checks on untrusted certificates to be
bypassed, such as the CA flag, enabling them to use a valid leaf
certificate to act as a CA and "issue" an invalid certificate.
This occurs where at least one cert is added to the first chain from the
trust store, but that chain still ends up being untrusted. In that case
ctx->last_untrusted is decremented in error.
Patch provided by the BoringSSL project.
CVE-2015-1793
Reviewed-by: Stephen Henson <steve@openssl.org>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/x509/x509_vfy.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/x509/x509_vfy.c b/crypto/x509/x509_vfy.c index a920ea70b1..7a7fc59e77 100644 --- a/crypto/x509/x509_vfy.c +++ b/crypto/x509/x509_vfy.c @@ -392,8 +392,8 @@ int X509_verify_cert(X509_STORE_CTX *ctx) xtmp = sk_X509_pop(ctx->chain); X509_free(xtmp); num--; - ctx->last_untrusted--; } + ctx->last_untrusted = sk_X509_num(ctx->chain); retry = 1; break; } |