Skip to contentSkip to conversation

command "rpmb write-key" not working

PATCH In review Simon Lindhorst 3 participants 3 messages Jun 2, 2025 – Jun 10, 2025 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 command "rpmb write-key" not working

Hello,

I am wondering how the call "rpmb write-key" works. Isn't it the case that the content of the keyfile is read in, but not stored in the structure "struct rpmb_frame" before "ret = do_rpmb_op(dev_fd, &frame_in, &frame_out, 1);" (mmc_cmds.c:2296)?

If I am right, I suggest the following patch:

Fixes rpmb write-key did not work
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 · 9 lines
2.43.0

-- Unsere Aussagen können Irrtümer und Missverständnisse enthalten.
-- Bitte prüfen Sie die Aussagen für Ihren Fall, bevor Sie Entscheidungen auf Grundlage dieser Aussagen treffen.
------------------------------------------------------------------------------------------------------
Wiesemann & Theis GmbH | Porschestr. 12 | D-42279 Wuppertal 
Geschäftsführer: Tobias Theis (M. Eng.) 
Amtsgericht Wuppertal | HRB 6377 | Infos zum Datenschutz: https://www.wut.de/datenschutz
Tel. +49 202/2680-0 | Fax +49 202/2680-265 | https://www.wut.de
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines

Hello,

I am wondering how the call "rpmb write-key" works. Isn't it the case that the content of the keyfile is read in, but not stored in the structure "struct rpmb_frame" before "ret = do_rpmb_op(dev_fd, &frame_in, &frame_out, 1);" (mmc_cmds.c:2296)?

Quoted 7 lines

If I am right, I suggest the following patch:

Fixes rpmb write-key did not work
Fixes 05051e40351c ("mmc-utils: Refactor RPMB key handling into a separate

function ")

Thanks for fixing this,
Avri

Quoted 30 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.43.0

-- Unsere Aussagen k?nnen Irrt?mer und Missverst?ndnisse enthalten. -- Bitte pr?fen Sie die Aussagen f?r Ihren Fall, bevor Sie Entscheidungen auf Grundlage dieser Aussagen treffen.
----------------------------------------------------------------------------------------------
--------
Wiesemann & Theis GmbH | Porschestr. 12 | D-42279 Wuppertal Gesch?ftsf?hrer: Tobias Theis (M. Eng.)
Amtsgericht Wuppertal | HRB 6377 | Infos zum Datenschutz:
https://www.wut.de/datenschutz
Tel. +49 202/2680-0 | Fax +49 202/2680-265 | https://www.wut.de

#2 lore raw
In reply to Simon Lindhorst
Quoted 4 lines · Simon Lindhorst

Hello,

I am wondering how the call "rpmb write-key" works. Isn't it the case that the content of the keyfile is read in, but not stored in the structure "struct rpmb_frame" before "ret = do_rpmb_op(dev_fd, &frame_in, &frame_out, 1);" (mmc_cmds.c:2296)?

That's a weird commit message. Please try to better describe what the patch does and why we need it.

Quoted 2 lines

If I am right, I suggest the following patch:

No need to state that here. We certainly consider your patch just by sending it to us.

Quoted 2 lines
Fixes rpmb write-key did not work

Please add a commit hash to the fixes tag, similar as below.

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

Thanks for the patch, but I am not able to apply this as it's not correctly formatted/sent - according to
https://www.kernel.org/doc/html/latest/process/submitting-patches.html

Please give it another try by sending a new version, but first, I strongly encourage you to first do some homework by reading submitting-patches.html.

Kind regards
Uffe

Quoted 27 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.43.0

-- Unsere Aussagen können Irrtümer und Missverständnisse enthalten.
-- Bitte prüfen Sie die Aussagen für Ihren Fall, bevor Sie Entscheidungen auf Grundlage dieser Aussagen treffen.
------------------------------------------------------------------------------------------------------
Wiesemann & Theis GmbH | Porschestr. 12 | D-42279 Wuppertal
Geschäftsführer: Tobias Theis (M. Eng.)
Amtsgericht Wuppertal | HRB 6377 | Infos zum Datenschutz: https://www.wut.de/datenschutz
Tel. +49 202/2680-0 | Fax +49 202/2680-265 | https://www.wut.de