Treat all failures from EVP_DigestVerify() as a bad signature
authorMatt Caswell <matt@openssl.org>
Fri, 23 Jun 2017 10:29:04 +0000 (11:29 +0100)
committerMatt Caswell <matt@openssl.org>
Fri, 23 Jun 2017 16:23:25 +0000 (17:23 +0100)
commitcfba06758ea8ab49118dedd88fd3b2437aebf7b7
treed7d19f8d73366e241376af892bd6faccd5639464
parente3908501ca32e6629eed046f2ec44b66ecd1854b
Treat all failures from EVP_DigestVerify() as a bad signature

Prior to 72ceb6a we treated all failures from the call to
EVP_DigestVerifyFinal() as if it were a bad signature, and failures in
EVP_DigestUpdate() as an internal error. After that commit we replaced
this with the one-shot function EVP_DigestVerify() and treated a 0 return
as a bad signature and a negative return as an internal error. However,
some signature errors can be negative (e.g. according to the docs if the
form of the signature is wrong). Therefore we should treat all <=0
returns as a bad signature.

This fixes a boringssl test failure.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3756)
ssl/statem/statem_clnt.c