prevent integer overflow in ossl_asn1_time_from_tm
authorPaul Dreik <github@pauldreik.se>
Thu, 7 Dec 2023 15:59:57 +0000 (16:59 +0100)
committerTomas Mraz <tomas@openssl.org>
Thu, 18 Jan 2024 16:00:57 +0000 (17:00 +0100)
commit5b2d8bc28a8ff59689da98f31459819db09a9099
tree6dfeff7021bb33d77d251b6987526de5560a7596
parent017fd465a4f01323465823a3dcf318553365dfdd
prevent integer overflow in ossl_asn1_time_from_tm

this could be triggered by the following code (assuming 64 bit time_t):

time_t t = 67768011791126057ULL;
ASN1_TIME* at = ASN1_TIME_set(NULL, t);

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22976)
crypto/asn1/a_time.c