diff options
-rw-r--r-- | crypto/asymmetric_keys/x509_public_key.c | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/crypto/asymmetric_keys/x509_public_key.c b/crypto/asymmetric_keys/x509_public_key.c index 0f55e3b027a0..c1540e8f454a 100644 --- a/crypto/asymmetric_keys/x509_public_key.c +++ b/crypto/asymmetric_keys/x509_public_key.c | |||
@@ -108,7 +108,6 @@ EXPORT_SYMBOL_GPL(x509_check_signature); | |||
108 | static int x509_key_preparse(struct key_preparsed_payload *prep) | 108 | static int x509_key_preparse(struct key_preparsed_payload *prep) |
109 | { | 109 | { |
110 | struct x509_certificate *cert; | 110 | struct x509_certificate *cert; |
111 | struct tm now; | ||
112 | size_t srlen, sulen; | 111 | size_t srlen, sulen; |
113 | char *desc = NULL; | 112 | char *desc = NULL; |
114 | int ret; | 113 | int ret; |
@@ -150,43 +149,6 @@ static int x509_key_preparse(struct key_preparsed_payload *prep) | |||
150 | goto error_free_cert; | 149 | goto error_free_cert; |
151 | } | 150 | } |
152 | 151 | ||
153 | time_to_tm(CURRENT_TIME.tv_sec, 0, &now); | ||
154 | pr_devel("Now: %04ld-%02d-%02d %02d:%02d:%02d\n", | ||
155 | now.tm_year + 1900, now.tm_mon + 1, now.tm_mday, | ||
156 | now.tm_hour, now.tm_min, now.tm_sec); | ||
157 | if (now.tm_year < cert->valid_from.tm_year || | ||
158 | (now.tm_year == cert->valid_from.tm_year && | ||
159 | (now.tm_mon < cert->valid_from.tm_mon || | ||
160 | (now.tm_mon == cert->valid_from.tm_mon && | ||
161 | (now.tm_mday < cert->valid_from.tm_mday || | ||
162 | (now.tm_mday == cert->valid_from.tm_mday && | ||
163 | (now.tm_hour < cert->valid_from.tm_hour || | ||
164 | (now.tm_hour == cert->valid_from.tm_hour && | ||
165 | (now.tm_min < cert->valid_from.tm_min || | ||
166 | (now.tm_min == cert->valid_from.tm_min && | ||
167 | (now.tm_sec < cert->valid_from.tm_sec | ||
168 | ))))))))))) { | ||
169 | pr_warn("Cert %s is not yet valid\n", cert->fingerprint); | ||
170 | ret = -EKEYREJECTED; | ||
171 | goto error_free_cert; | ||
172 | } | ||
173 | if (now.tm_year > cert->valid_to.tm_year || | ||
174 | (now.tm_year == cert->valid_to.tm_year && | ||
175 | (now.tm_mon > cert->valid_to.tm_mon || | ||
176 | (now.tm_mon == cert->valid_to.tm_mon && | ||
177 | (now.tm_mday > cert->valid_to.tm_mday || | ||
178 | (now.tm_mday == cert->valid_to.tm_mday && | ||
179 | (now.tm_hour > cert->valid_to.tm_hour || | ||
180 | (now.tm_hour == cert->valid_to.tm_hour && | ||
181 | (now.tm_min > cert->valid_to.tm_min || | ||
182 | (now.tm_min == cert->valid_to.tm_min && | ||
183 | (now.tm_sec > cert->valid_to.tm_sec | ||
184 | ))))))))))) { | ||
185 | pr_warn("Cert %s has expired\n", cert->fingerprint); | ||
186 | ret = -EKEYEXPIRED; | ||
187 | goto error_free_cert; | ||
188 | } | ||
189 | |||
190 | cert->pub->algo = pkey_algo[cert->pub->pkey_algo]; | 152 | cert->pub->algo = pkey_algo[cert->pub->pkey_algo]; |
191 | cert->pub->id_type = PKEY_ID_X509; | 153 | cert->pub->id_type = PKEY_ID_X509; |
192 | 154 | ||