Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/tpm2-tools: fix curve ID for NIST P-521
@ 2026-12-02 17:48 Fiona Klute via buildroot
  2026-12-03 13:30 ` Peter Korsgaard
  0 siblings, 1 reply; 2+ messages in thread
From: Fiona Klute via buildroot @ 2026-12-02 17:48 UTC (permalink / raw)
  To: buildroot; +Cc: Fiona Klute (othermo GmbH)

From: "Fiona Klute (othermo GmbH)" <fiona.klute@gmx.de>

The string values for NIST curves all follow the pattern "NIST pN",
except for P-521, where the "p" is missing. Example from "tpm2_import"
output with a P-521 key:

  curve-id:
    value: NIST 521
    raw: 0x5

This breaks other tools like package/tpm2-pkcs11 which expect the
"p". E.g. a "tpm2_ptool import" (which calls "tpm2_import" internally)
with a P-521 key fails with:

  RuntimeError: alg NIST 521 has no EC params mapping

Add a patch pending upstream that fixes the string.

Signed-off-by: Fiona Klute (othermo GmbH) <fiona.klute@gmx.de>
---
 ..._alg_util.c-fix-the-NIST-p521-naming.patch | 28 +++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 package/tpm2-tools/0002-lib-tpm2_alg_util.c-fix-the-NIST-p521-naming.patch

diff --git a/package/tpm2-tools/0002-lib-tpm2_alg_util.c-fix-the-NIST-p521-naming.patch b/package/tpm2-tools/0002-lib-tpm2_alg_util.c-fix-the-NIST-p521-naming.patch
new file mode 100644
index 0000000000..c99e41a251
--- /dev/null
+++ b/package/tpm2-tools/0002-lib-tpm2_alg_util.c-fix-the-NIST-p521-naming.patch
@@ -0,0 +1,28 @@
+From f7243e6ba3a7b1102e5d06e2f7c956b458907b02 Mon Sep 17 00:00:00 2001
+From: Moritz Buhl <moritz.buhl@infineon.com>
+Date: Tue, 1 Dec 2026 15:03:39 +0100
+Subject: [PATCH] lib/tpm2_alg_util.c: fix the NIST p521 naming
+
+All other NIST ECC curves are named "NIST pXXX", make 521 no longer
+stand out.
+
+Signed-off-by: Moritz Buhl <moritz.buhl@infineon.com>
+Upstream: https://github.com/tpm2-software/tpm2-tools/pull/3636
+Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
+---
+ lib/tpm2_alg_util.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/tpm2_alg_util.c b/lib/tpm2_alg_util.c
+index 42946752e..628a75beb 100644
+--- a/lib/tpm2_alg_util.c
++++ b/lib/tpm2_alg_util.c
+@@ -1092,7 +1092,7 @@ const char *tpm2_alg_util_ecc_to_str(TPM2_ECC_CURVE curve_id) {
+     case TPM2_ECC_NIST_P384:
+         return "NIST p384";
+     case TPM2_ECC_NIST_P521:
+-        return "NIST 521";
++        return "NIST p521";
+     case TPM2_ECC_BN_P256:
+         return "BN P256";
+     case TPM2_ECC_BN_P638:
-- 
2.55.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/tpm2-tools: fix curve ID for NIST P-521
  2026-12-02 17:48 [Buildroot] [PATCH 1/1] package/tpm2-tools: fix curve ID for NIST P-521 Fiona Klute via buildroot
@ 2026-12-03 13:30 ` Peter Korsgaard
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Korsgaard @ 2026-12-03 13:30 UTC (permalink / raw)
  To: Fiona Klute via buildroot; +Cc: Fiona Klute

>>>>> "Fiona" == Fiona Klute via buildroot <buildroot@buildroot.org> writes:

 > From: "Fiona Klute (othermo GmbH)" <fiona.klute@gmx.de>
 > The string values for NIST curves all follow the pattern "NIST pN",
 > except for P-521, where the "p" is missing. Example from "tpm2_import"
 > output with a P-521 key:

 >   curve-id:
 >     value: NIST 521
 >     raw: 0x5

 > This breaks other tools like package/tpm2-pkcs11 which expect the
 > "p". E.g. a "tpm2_ptool import" (which calls "tpm2_import" internally)
 > with a P-521 key fails with:

 >   RuntimeError: alg NIST 521 has no EC params mapping

 > Add a patch pending upstream that fixes the string.

 > Signed-off-by: Fiona Klute (othermo GmbH) <fiona.klute@gmx.de>

Committed, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-12-03 13:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-02 17:48 [Buildroot] [PATCH 1/1] package/tpm2-tools: fix curve ID for NIST P-521 Fiona Klute via buildroot
2026-12-03 13:30 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox