Skip to contentSkip to conversation

trusted_dcp.c: Do not return in case of non-secure mode

PATCH In review Kshitiz Varshney 2 participants 2 messages Feb 10, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 trusted_dcp.c: Do not return in case of non-secure mode

There are multiple type of keys in different worlds, like test key in case of non-secure world and OTP, unique key in case of secure world.
So, instead of returning with an error, in case of test key, we should display warning to the user and allow the user to run the trusted key functionality with test key.

---
 security/keys/trusted-keys/trusted_dcp.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
security/keys/trusted-keys/trusted_dcp.c +2 -5
index e908c53a803c..99c9f9619f4f 100644
@@ -319,11 +319,8 @@ static int trusted_dcp_init(void)
 		pr_info("Using DCP OTP key\n");
 
 	ret = test_for_zero_key();
-	if (ret) {
-		pr_warn("Test for zero'ed keys failed: %i\n", ret);
-
-		return -EINVAL;
-	}
+	if (ret)
+		pr_warn("Using insecure test key, enable HAB to use unique device key!\n");
 
 	return register_key_type(&key_type_trusted);
 }
Signature · 1 line
2.25.1
#1 lore raw
Quoted 6 lines · On Montag, 10. Februar 2025 12:46 Kshitiz Varshney wrote:

There are multiple type of keys in different worlds, like test key in case of non-secure world and OTP, unique key in case of secure world.
So, instead of returning with an error, in case of test key, we should display warning to the user and allow the user to run the trusted key functionality with test key.

We have the dcp_skip_zk_test module parameter to allow such cases. Why can't you use it?

Thanks,
//richard

Signature · 2 lines
​​​​​sigma star gmbh | Eduard-Bodem-Gasse 6, 6020 Innsbruck, AUT UID/VAT Nr:
ATU 66964118 | FN: 374287y