summaryrefslogtreecommitdiffstats
path: root/g10/keyid.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2011-01-31 09:27:06 +0100
committerWerner Koch <wk@gnupg.org>2011-01-31 09:27:06 +0100
commit0fb0bb8d9a960a2473ab70a021d20639a43227e0 (patch)
tree8dcce4f17931a3da45890db635a6474231224db0 /g10/keyid.c
parentUpdate gitignore (diff)
downloadgnupg2-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.c21
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;