]> www.infradead.org Git - users/jedix/linux-maple.git/commit
X.509: Handle midnight alternative notation in GeneralizedTime
authorDavid Howells <dhowells@redhat.com>
Wed, 24 Feb 2016 14:37:54 +0000 (14:37 +0000)
committerBrian Maly <brian.maly@oracle.com>
Sat, 11 May 2019 03:47:42 +0000 (23:47 -0400)
commite13f3c0b4aa8bb610de7e3685209c2c9c71874a6
treeb0d8975e2caa8f231e9c6484cff528231649ed1a
parent16000488c7400fe316073a54597c473fd1c2fc33
X.509: Handle midnight alternative notation in GeneralizedTime

The ASN.1 GeneralizedTime object carries an ISO 8601 format date and time.
The time is permitted to show midnight as 00:00 or 24:00 (the latter being
equivalent of 00:00 of the following day).

The permitted value is checked in x509_decode_time() but the actual
handling is left to mktime64().

Without this patch, certain X.509 certificates will be rejected and could
lead to an unbootable kernel.

Note that with this patch we also permit any 24:mm:ss time and extend this
to UTCTime, which whilst not strictly correct don't permit much leeway in
fiddling date strings.

Reported-by: Rudolf Polzer <rpolzer@google.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
cc: David Woodhouse <David.Woodhouse@intel.com>
cc: John Stultz <john.stultz@linaro.org>

Orabug: 29460344
CVE: CVE-2015-5327
(cherry picked from commit 7650cb80e4e90b0fae7854b6008a46d24360515f)
Signed-off-by: Dan Duval <dan.duval@oracle.com>
Reviewed-by: John Haxby <john.haxby@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
crypto/asymmetric_keys/x509_cert_parser.c