Check index >= 0 as 0 is a valid index.

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2587)
This commit is contained in:
Dr. Stephen Henson 2017-02-10 04:22:18 +00:00
parent 88be429f2e
commit 8fd19b20be

View file

@ -1601,7 +1601,7 @@ int tls1_process_sigalgs(SSL *s)
if (SSL_IS_TLS13(s) && sigptr->sig == EVP_PKEY_RSA) if (SSL_IS_TLS13(s) && sigptr->sig == EVP_PKEY_RSA)
continue; continue;
idx = tls12_get_pkey_idx(sigptr->sig); idx = tls12_get_pkey_idx(sigptr->sig);
if (idx > 0 && pmd[idx] == NULL) { if (idx >= 0 && pmd[idx] == NULL) {
md = ssl_md(sigptr->hash_idx); md = ssl_md(sigptr->hash_idx);
pmd[idx] = md; pmd[idx] = md;
pvalid[idx] = CERT_PKEY_EXPLICIT_SIGN; pvalid[idx] = CERT_PKEY_EXPLICIT_SIGN;