certs: Reference revocation list for all keyrings
Subsystems (2)
PATCH 1/1 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.
--- certs/system_keyring.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
certs/system_keyring.c +6 -6
@@ -243,6 +243,12 @@ int verify_pkcs7_message_sig(const void *data, size_t len,if (ret <0 ) goto error; + ret =is_key_on_revocation_list (pkcs7); +if (ret != -ENOKEY ) { +pr_devel ("PKCS#7 key is on revocation list\n" ); + goto error; + } +if (!trusted_keys) { trusted_keys = builtin_trusted_keys; }else if (trusted_keys ==VERIFY_USE_SECONDARY_KEYRING ) {
@@ -262,12 +268,6 @@ int verify_pkcs7_message_sig(const void *data, size_t len,pr_devel ("PKCS#7 platform keyring is not available\n" ); goto error; } - - ret =is_key_on_revocation_list (pkcs7); -if (ret != -ENOKEY ) { -pr_devel ("PKCS#7 platform key is on revocation list\n" ); - goto error; - } } ret =pkcs7_validate_trust (pkcs7, trusted_keys);if (ret <0 ) {
Signature · 1 line
2.27.0
Quoted 49 lines · Eric Snowberg
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_sigthe 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]>--- certs/system_keyring.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)certs/system_keyring.c +6
-6@@ -243,6 +243,12 @@ int verify_pkcs7_message_sig(const void *data, size_t len,if (ret <0 ) goto error; + ret =is_key_on_revocation_list (pkcs7); +if (ret != -ENOKEY ) { +pr_devel ("PKCS#7 key is on revocation list\n" ); + goto error; + } +if (!trusted_keys) { trusted_keys = builtin_trusted_keys; }else if (trusted_keys ==VERIFY_USE_SECONDARY_KEYRING ) {@@ -262,12 +268,6 @@ int verify_pkcs7_message_sig(const void *data, size_t len,pr_devel ("PKCS#7 platform keyring is not available\n" ); goto error; } - - ret =is_key_on_revocation_list (pkcs7); -if (ret != -ENOKEY ) { -pr_devel ("PKCS#7 platform key is on revocation list\n" ); - goto error; - } } ret =pkcs7_validate_trust (pkcs7, trusted_keys);if (ret <0 ) {Signature · 1 line
2.27.0
BR, Jarkko
Jarkko Sakkinen
maintainerQuoted 44 lines · Jarkko Sakkinen
Quoted 43 lines · Eric Snowberg
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_sigthe 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]>--- certs/system_keyring.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)certs/system_keyring.c +6
-6@@ -243,6 +243,12 @@ int verify_pkcs7_message_sig(const void *data, size_t len,if (ret <0 ) goto error; + ret =is_key_on_revocation_list (pkcs7); +if (ret != -ENOKEY ) { +pr_devel ("PKCS#7 key is on revocation list\n" ); + goto error; + } +if (!trusted_keys) { trusted_keys = builtin_trusted_keys; }else if (trusted_keys ==VERIFY_USE_SECONDARY_KEYRING ) {@@ -262,12 +268,6 @@ int verify_pkcs7_message_sig(const void *data, size_t len,pr_devel ("PKCS#7 platform keyring is not available\n" ); goto error; } - - ret =is_key_on_revocation_list (pkcs7); -if (ret != -ENOKEY ) { -pr_devel ("PKCS#7 platform key is on revocation list\n" ); - goto error; - }
Quoted 8 lines
Quoted 6 lines
certs/system_keyring.c +0
-0} ret =pkcs7_validate_trust (pkcs7, trusted_keys);if (ret <0 ) {Signature · 1 line
2.27.0Reviewed-by Jarkko Sakkinen <[email protected]>
Should I pick this?
BR, Jarkko
Quoted 11 lines · Eric Snowberg
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_sigthe 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.
Quoted 1 line
Signed-off-by Eric Snowberg <[email protected]>