Remove notBefore and notAfter cacheing.
authorbeck <beck@openbsd.org>
Mon, 8 Apr 2024 23:46:21 +0000 (23:46 +0000)
committerbeck <beck@openbsd.org>
Mon, 8 Apr 2024 23:46:21 +0000 (23:46 +0000)
commitcc34b9f0853bc41bc8e215a9ffb0ef0470848643
treedd07aaf97617431715e130fae2ef5534373fe03f
parent13bba76f4894ae7a858a165532710495146cef47
Remove notBefore and notAfter cacheing.

This cache was added because our time conversion used timegm()
and gmtime() which aren't very cheap. These calls were noticably
expensive when profiling things like rpki-client which do many
X.509 validations.

Now that we convert times using julien seconds from the unix
epoch, BoringSSL style, instead of a julien days from a
Byzantine date, we no longer use timegm() and gmtime().

Since the julien seconds calculaitons are cheap for conversion,
we don't need to bother caching this, it doesn't have a noticable
performance impact.

While we are at this correct a bug where
x509_verify_asn1_time_to_time_t was not NULL safe.

Tested for performance regressions by tb@ and job@

ok tb@ job@
lib/libcrypto/x509/x509_local.h
lib/libcrypto/x509/x509_purp.c
lib/libcrypto/x509/x509_verify.c
lib/libcrypto/x509/x509_vfy.c