diff options
author | Werner Koch <wk@gnupg.org> | 2011-01-31 09:27:06 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2011-01-31 09:27:06 +0100 |
commit | 0fb0bb8d9a960a2473ab70a021d20639a43227e0 (patch) | |
tree | 8dcce4f17931a3da45890db635a6474231224db0 /g10/keyid.c | |
parent | Update gitignore (diff) | |
download | gnupg2-0fb0bb8d9a960a2473ab70a021d20639a43227e0.tar.xz gnupg2-0fb0bb8d9a960a2473ab70a021d20639a43227e0.zip |
Reworked the ECC changes to better fit into the Libgcrypt API.
See ChangeLog for details. Key generation, signing and verification works.
Encryption does not yet work. Requires latest Libgcrypt changes.
Diffstat (limited to 'g10/keyid.c')
-rw-r--r-- | g10/keyid.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/g10/keyid.c b/g10/keyid.c index 0405b8b2f..6571a51c0 100644 --- a/g10/keyid.c +++ b/g10/keyid.c @@ -724,17 +724,20 @@ keygrip_from_pk (PKT_public_key *pk, unsigned char *array) case PUBKEY_ALGO_ECDSA: case PUBKEY_ALGO_ECDH: - err = gcry_sexp_build (&s_pkey, NULL, - "(public-key(ecc(c%m)(q%m)))", - pk->pkey[0], pk->pkey[1]); + { + char *curve = openpgp_oid_to_str (pk->pkey[0]); + if (!curve) + err = gpg_error_from_syserror (); + else + { + err = gcry_sexp_build (&s_pkey, NULL, + "(public-key(ecc(curve%s)(q%m)))", + curve, pk->pkey[1]); + xfree (curve); + } + } break; - /* case PUBKEY_ALGO_ECDH: */ - /* err = gcry_sexp_build (&s_pkey, NULL, */ - /* "(public-key(ecdh(c%m)(q%m)(p%m)))", */ - /* pk->pkey[0], pk->pkey[1], pk->pkey[2]); */ - /* break; */ - default: err = gpg_error (GPG_ERR_PUBKEY_ALGO); break; |