kernel-ark/crypto/asymmetric_keys
David Howells a5752d11b3 MODSIGN: Fix 32-bit overflow in X.509 certificate validity date checking
The current choice of lifetime for the autogenerated X.509 of 100 years,
putting the validTo date in 2112, causes problems on 32-bit systems where a
32-bit time_t wraps in 2106.  64-bit x86_64 systems seem to be unaffected.

This can result in something like:

	Loading module verification certificates
	X.509: Cert 6e03943da0f3b015ba6ed7f5e0cac4fe48680994 has expired
	MODSIGN: Problem loading in-kernel X.509 certificate (-127)

Or:

	X.509: Cert 6e03943da0f3b015ba6ed7f5e0cac4fe48680994 is not yet valid
	MODSIGN: Problem loading in-kernel X.509 certificate (-129)

Instead of turning the dates into time_t values and comparing, turn the system
clock and the ASN.1 dates into tm structs and compare those piecemeal instead.

Reported-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Josh Boyer <jwboyer@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-10-10 20:06:37 +10:30
..
.gitignore X.509: Add a crypto key parser for binary (DER) X.509 certificates 2012-10-08 13:50:22 +10:30
asymmetric_keys.h
asymmetric_type.c KEYS: Asymmetric key pluggable data parsers 2012-10-08 13:50:13 +10:30
Kconfig X.509: Add a crypto key parser for binary (DER) X.509 certificates 2012-10-08 13:50:22 +10:30
Makefile X.509: Add a crypto key parser for binary (DER) X.509 certificates 2012-10-08 13:50:22 +10:30
public_key.c KEYS: Asymmetric public-key algorithm crypto key subtype 2012-10-08 13:50:14 +10:30
public_key.h RSA: Implement signature verification algorithm [PKCS#1 / RFC3447] 2012-10-08 13:50:16 +10:30
rsa.c RSA: Fix signature verification for shorter signatures 2012-10-08 13:50:17 +10:30
signature.c KEYS: Provide signature verification with an asymmetric key 2012-10-08 13:50:15 +10:30
x509_cert_parser.c MODSIGN: Fix 32-bit overflow in X.509 certificate validity date checking 2012-10-10 20:06:37 +10:30
x509_parser.h MODSIGN: Fix 32-bit overflow in X.509 certificate validity date checking 2012-10-10 20:06:37 +10:30
x509_public_key.c MODSIGN: Fix 32-bit overflow in X.509 certificate validity date checking 2012-10-10 20:06:37 +10:30
x509_rsakey.asn1 X.509: Add a crypto key parser for binary (DER) X.509 certificates 2012-10-08 13:50:22 +10:30
x509.asn1 X.509: Add a crypto key parser for binary (DER) X.509 certificates 2012-10-08 13:50:22 +10:30