mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-31 11:41:32 +01:00
g10: EdDSA support.
* g10/keyid.c (keygrip_from_pk): Compute keygrip of EdDSA key. * g10/keygen.c (generate_subkeypair): Ed25519 is for EdDSA. * common/openpgp-oid.c (oid_ed25519): Update.
This commit is contained in:
parent
513c67b746
commit
40c3b0741e
@ -39,7 +39,7 @@
|
||||
|
||||
/* The OID for Curve Ed25519 in OpenPGP format. */
|
||||
static const char oid_ed25519[] =
|
||||
{ 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x97, 0x55, 0x01, 0x05, 0x01 };
|
||||
{ 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01, 0xda, 0x47, 0x0f, 0x01 };
|
||||
|
||||
|
||||
/* Helper for openpgp_oid_from_str. */
|
||||
|
@ -4031,7 +4031,11 @@ generate_subkeypair (ctrl_t ctrl, kbnode_t keyblock)
|
||||
else if (algo == PUBKEY_ALGO_ECDSA
|
||||
|| algo == PUBKEY_ALGO_EDDSA
|
||||
|| algo == PUBKEY_ALGO_ECDH)
|
||||
curve = ask_curve ();
|
||||
{
|
||||
curve = ask_curve ();
|
||||
if (curve && !strcmp (curve, "Ed25519"))
|
||||
algo = PUBKEY_ALGO_EDDSA;
|
||||
}
|
||||
else
|
||||
nbits = ask_keysize (algo, 0);
|
||||
|
||||
|
@ -813,7 +813,9 @@ keygrip_from_pk (PKT_public_key *pk, unsigned char *array)
|
||||
else
|
||||
{
|
||||
err = gcry_sexp_build (&s_pkey, NULL,
|
||||
"(public-key(ecc(curve%s)(q%m)))",
|
||||
pk->pubkey_algo == PUBKEY_ALGO_EDDSA ?
|
||||
"(public-key(ecc(curve%s)(flags eddsa)(q%m)))"
|
||||
: "(public-key(ecc(curve%s)(q%m)))",
|
||||
curve, pk->pkey[1]);
|
||||
xfree (curve);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user