Skip to content

Commit 218a268

Browse files
esnowbergjarkkojs
authored andcommitted
certs: Reference revocation list for all keyrings
Systems booted with shim have a Forbidden Signature Database called mokx. During boot, hashes and certs contained within the mokx are loaded into the blacklist keyring. When calling verify_pkcs7_message_sig the contents of the blacklist keyring (or revocation list) are referenced when validating keys on the platform keyring. Currently, when validating against the secondary or builtin keyrings, the revocation list is not referenced. Move up the check to allow the revocation list to be used with all keyrings, including the secondary and builtin, allowing the system owner to take corrective action should a vulnerability be found within keys contained within either keyring. Signed-off-by: Eric Snowberg <[email protected]> Reviewed-by: Mimi Zohar <[email protected]> Reviewed-by: Jarkko Sakkinen <[email protected]> Signed-off-by: Jarkko Sakkinen <[email protected]>
1 parent 2ccf8c7 commit 218a268

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

certs/system_keyring.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,12 @@ int verify_pkcs7_message_sig(const void *data, size_t len,
330330
if (ret < 0)
331331
goto error;
332332

333+
ret = is_key_on_revocation_list(pkcs7);
334+
if (ret != -ENOKEY) {
335+
pr_devel("PKCS#7 key is on revocation list\n");
336+
goto error;
337+
}
338+
333339
if (!trusted_keys) {
334340
trusted_keys = builtin_trusted_keys;
335341
} else if (trusted_keys == VERIFY_USE_SECONDARY_KEYRING) {
@@ -349,12 +355,6 @@ int verify_pkcs7_message_sig(const void *data, size_t len,
349355
pr_devel("PKCS#7 platform keyring is not available\n");
350356
goto error;
351357
}
352-
353-
ret = is_key_on_revocation_list(pkcs7);
354-
if (ret != -ENOKEY) {
355-
pr_devel("PKCS#7 platform key is on revocation list\n");
356-
goto error;
357-
}
358358
}
359359
ret = pkcs7_validate_trust(pkcs7, trusted_keys);
360360
if (ret < 0) {

0 commit comments

Comments
 (0)