Store errors that result from leaf certificate verification.
authorjsing <jsing@openbsd.org>
Mon, 17 Oct 2022 18:56:54 +0000 (18:56 +0000)
committerjsing <jsing@openbsd.org>
Mon, 17 Oct 2022 18:56:54 +0000 (18:56 +0000)
commit4f94258c65a918ee3d8670e93916d15bf879e6ec
treeda2f54eb10ecbeed61df9dd904502f31c60aa621
parent763065e94a6ba1876be11d4e4cddc353ad76d133
Store errors that result from leaf certificate verification.

In the case that a verification callback is installed that tells the
verifier to continue when a certificate is invalid (e.g. expired),
any error resulting from the leaf certificate verification is not stored
and made available post verification, resulting in an incorrect error being
returned.

Also perform leaf certificate verification prior to adding the chain, which
avoids a potential memory leak (as noted by tb@).

Issue reported by Ilya Shipitsin, who encountered haproxy regress failures.

ok tb@
lib/libcrypto/x509/x509_verify.c