[PATCH v4 7/8] crypto: keytoc: Allow fields to start with underscore

Jonas Rebmann jre at pengutronix.de
Tue Mar 17 08:19:51 PDT 2026


During the rewrite of keyspec handling for the new keyring syntax, a
restrictive character set was chosen for keys and values in the comma
separated list of key parameters:

[a-zA-Z][a-zA-Z0-9_-]*

Because __ENV expansion happens in a later step, excluding underscores
from allowed start characters broke the apparently unused feature of
passing only the (now obsolete) "fit-hint" via an environment variable
as documented in crypto/Kconfig:

CONFIG_CRYPTO_PUBLIC_KEYS="keyring=fit,fit-hint=__ENV__myhint:__ENV__myname"

Allow fields to start with an undescore just for now.

Signed-off-by: Jonas Rebmann <jre at pengutronix.de>
---
 scripts/keytoc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/keytoc.c b/scripts/keytoc.c
index aca6547136..c4491fbe81 100644
--- a/scripts/keytoc.c
+++ b/scripts/keytoc.c
@@ -720,8 +720,8 @@ static bool is_identifier(char **s)
 {
 	char *p = *s;
 
-	/* [a-zA-Z] */
-	if (!isalpha(*p))
+	/* [a-zA-Z_] */
+	if (!(isalpha(*p) || *p == '_'))
 		return false;
 	p++;
 

-- 
2.53.0.308.g50d063e335




More information about the barebox mailing list