]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
UBUNTU: SAUCE: integrity: add informational messages when revoking certs
authorDimitri John Ledkov <dimitri.ledkov@canonical.com>
Thu, 5 Aug 2021 14:59:46 +0000 (15:59 +0100)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 13 Aug 2021 07:31:56 +0000 (09:31 +0200)
integrity_load_cert() prints messages of the source and cert details
when adding certs as trusted. Mirror those messages in
uefi_revocation_list_x509() when adding certs as revoked.

Sample dmesg with this change:

    integrity: Platform Keyring initialized
    integrity: Loading X.509 certificate: UEFI:db
    integrity: Loaded X.509 cert 'Microsoft Corporation UEFI CA 2011: 13adbf4309bd82709c8cd54f316ed522988a1bd4'
    integrity: Revoking X.509 certificate: UEFI:MokListXRT (MOKvar table)
    blacklist: Revoked X.509 cert 'Canonical Ltd. Secure Boot Signing: 61482aa2830d0ab2ad5af10b7250da9033ddcef0'
    integrity: Loading X.509 certificate: UEFI:MokListRT (MOKvar table)
    integrity: Loaded X.509 cert 'Canonical Ltd. Master Certificate Authority: ad91990bc22ab1f517048c23b6655a268e345a63'

BugLink: https://bugs.launchpad.net/bugs/1928679
Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
(cherry picked from commit ba9fb788f89cb81c5ed836db2355a7a3b0f8c248)
Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Andy Whitcroft <apw@canonical.com>
[KelseyS: SHA1 from cherry pick line is from Impish. Patch has been submitted
to upstream, though not yet reviewed/applied.]
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
certs/blacklist.c
security/integrity/platform_certs/keyring_handler.c

index c973de883cf02c7e226152d3433623f75b22255a..7638dfaca7fbb260e1cf4fb01e6f698605233d8d 100644 (file)
@@ -171,6 +171,9 @@ int add_key_to_revocation_list(const char *data, size_t size)
        if (IS_ERR(key)) {
                pr_err("Problem with revocation key (%ld)\n", PTR_ERR(key));
                return PTR_ERR(key);
+       } else {
+               pr_notice("Revoked X.509 cert '%s'\n",
+                         key_ref_to_ptr(key)->description);
        }
 
        return 0;
index 5604bd57c99077d8238cde7b5e6335a13cf16dce..9f85626702b2ce7359626a90a21199a26ec584e6 100644 (file)
@@ -61,6 +61,7 @@ static __init void uefi_blacklist_binary(const char *source,
 static __init void uefi_revocation_list_x509(const char *source,
                                             const void *data, size_t len)
 {
+       pr_info("Revoking X.509 certificate: %s\n", source);
        add_key_to_revocation_list(data, len);
 }