Skip to contentSkip to conversation

mmc-utils: Pass key_mac buffer to rpmb_get_key()

PATCH In review Avri Altman 2 participants 2 messages Jun 23, 2025 – Jun 24, 2025 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc-utils: Pass key_mac buffer to rpmb_get_key()

This patch fixes an issue where the key_mac buffer was not passed to rpmb_get_key() in do_rpmb_write_key(), which could result in incorrect key handling during RPMB key programming.

This is a resend of a patch originally submitted by Simon Lindhorst, which was previously rejected due to formatting issues.

Fixes 05051e40351c ("mmc-utils: Refactor RPMB key handling into a separate function")
---
 mmc_cmds.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mmc_cmds.c +1 -1
index b2cc3d6..7994223 100644
@@ -2289,7 +2289,7 @@ int do_rpmb_write_key(int nargs, char **argv)
 		exit(1);
 	}
 
-	ret = rpmb_get_key(argv[2], &frame_in, NULL, false);
+	ret = rpmb_get_key(argv[2], &frame_in, frame_in.key_mac, false);
 	if (ret)
 		return ret;
 	/* Execute RPMB op */
Signature · 1 line
2.25.1
#1 lore raw
Quoted 11 lines · Avri Altman

This patch fixes an issue where the key_mac buffer was not passed to rpmb_get_key() in do_rpmb_write_key(), which could result in incorrect key handling during RPMB key programming.

This is a resend of a patch originally submitted by Simon Lindhorst, which was previously rejected due to formatting issues.

Fixes 05051e40351c ("mmc-utils: Refactor RPMB key handling into a separate function")

Applied for master (and included in the v1.0 release), thanks!

Kind regards
Uffe

Quoted 20 lines
---
 mmc_cmds.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mmc_cmds.c +1 -2
index b2cc3d6..7994223 100644
@@ -2289,7 +2289,7 @@ int do_rpmb_write_key(int nargs, char **argv)
                exit(1);
        }
 
-       ret = rpmb_get_key(argv[2], &frame_in, NULL, false);
+       ret = rpmb_get_key(argv[2], &frame_in, frame_in.key_mac, false);
        if (ret)
                return ret;
        /* Execute RPMB op */
--

2.25.1