Skip to content

Commit f40998a

Browse files
blucajxwufan
authored andcommitted
ipe: fallback to platform keyring also if key in trusted keyring is rejected
If enabled, we fallback to the platform keyring if the trusted keyring doesn't have the key used to sign the ipe policy. But if pkcs7_verify() rejects the key for other reasons, such as usage restrictions, we do not fallback. Do so, following the same change in dm-verity. Signed-off-by: Luca Boccassi <[email protected]> Suggested-by: Serge Hallyn <[email protected]> [FW: fixed some line length issues and a typo in the commit message] Signed-off-by: Fan Wu <[email protected]>
1 parent 02e2f9a commit f40998a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

security/ipe/policy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ struct ipe_policy *ipe_new_policy(const char *text, size_t textlen,
178178
VERIFYING_UNSPECIFIED_SIGNATURE,
179179
set_pkcs7_data, new);
180180
#ifdef CONFIG_IPE_POLICY_SIG_PLATFORM_KEYRING
181-
if (rc == -ENOKEY)
181+
if (rc == -ENOKEY || rc == -EKEYREJECTED)
182182
rc = verify_pkcs7_signature(NULL, 0, new->pkcs7, pkcs7len,
183183
VERIFY_USE_PLATFORM_KEYRING,
184184
VERIFYING_UNSPECIFIED_SIGNATURE,

0 commit comments

Comments
 (0)