[Gnuk-users] Ed25519 for signing broken?

NIIBE Yutaka gniibe at fsij.org
Mon Feb 9 04:27:15 UTC 2015


On 02/09/2015 05:03 AM, Jonathan Schleifer wrote:
> So, even when not changing the PIN and keeping it at 123456, I still
> get the bad signature error. It seems the problem happens only with
> Ed25519. Is it possible the Ed25519 code on the Gnuk is not working
> correctly as it is quite new?

It was pretty embarrassing bug of Gnuk.

When I tested, I used same private key for signing, and I coudn't
catch this bug.

    * src/openpgp.c (cmd_pso): Fix eddsa. Use GPG_KEY_FOR_SIGNING.

diff --git a/src/openpgp.c b/src/openpgp.c
index e1d1203..5976255 100644
--- a/src/openpgp.c
+++ b/src/openpgp.c
@@ -900,9 +900,9 @@ cmd_pso (void)

 	  res_APDU_size = EDDSA_SIGNATURE_LENGTH;
 	  r = eddsa_sign_25519 (apdu.cmd_apdu_data, len, output,
-				kd[GPG_KEY_FOR_AUTHENTICATION].data,
-				kd[GPG_KEY_FOR_AUTHENTICATION].data+32,
-				kd[GPG_KEY_FOR_AUTHENTICATION].pubkey);
+				kd[GPG_KEY_FOR_SIGNING].data,
+				kd[GPG_KEY_FOR_SIGNING].data+32,
+				kd[GPG_KEY_FOR_SIGNING].pubkey);
 	  memcpy (res_APDU, output, EDDSA_SIGNATURE_LENGTH);
 	}
     }
--



More information about the gnuk-users mailing list