[PATCH] gpg: Update card-edit wizard to support ECC key generation

NIIBE Yutaka gniibe at fsij.org
Fri Oct 21 15:04:00 CEST 2016


Hello,

On 10/14/2016 10:30 PM, Arnaud Fontaine wrote:
> * g10/card-util.c: Ask for key size only for RSA key generation.
> * g10/keygen.c: Add algo parameter to deal with ECC key generation.
> ---
>  g10/card-util.c | 51 +++++++++++++++++++++++++++++----------------------
>  g10/keygen.c    | 17 ++++++-----------
>  2 files changed, 35 insertions(+), 33 deletions(-)

I merge your change in:
	commit	161cb22f13bcd8cbdb08558d9926b2168a8297ac
	commit	dafce6f698bec6e9d4c0125b90754d0687294e86

Then, I added code which fills parameters by getting information
with KEY-ATTR from scdaemon.  It is:

	commit	d2653b1a6db90aed073194a51fd61023d69773ec

I test with Gnuk Token, and key generation now works well for NIST
P-256, Ed25519, etc.

I noticed that it won't work with P-521.  That's because the KDF
paramerters are hard-coded in app-openpgp.c as "\x03\x01\x08\x07".
It's for SHA-256 and AES-128.

We need something like the function pk_ecdh_default_params in
g10/ecdh.c.
-- 



More information about the Gnupg-devel mailing list