aboutsummaryrefslogtreecommitdiffstats
path: root/common/openpgp-oid.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2014-05-07 11:16:32 +0000
committerWerner Koch <[email protected]>2014-05-07 11:27:43 +0000
commit8fee6c1ce6d116fe7909dbe1184d95bc91305484 (patch)
treee803fc492044c704a55b32700c491627f5f93f89 /common/openpgp-oid.c
parentkbx: Add experimental support for EDDSA. (diff)
downloadgnupg-8fee6c1ce6d116fe7909dbe1184d95bc91305484.tar.gz
gnupg-8fee6c1ce6d116fe7909dbe1184d95bc91305484.zip
gpg: Finish experimental support for Ed25519.
* agent/cvt-openpgp.c (try_do_unprotect_arg_s): Add field "curve". (get_keygrip): Add and use arg CURVE. (convert_secret_key): Ditto. (convert_transfer_key): Ditto. (get_npkey_nskey): New. (prepare_unprotect): Replace gcrypt functions by get_npkey_nskey. Allow opaque MPIs. (do_unprotect): Use CURVE instead of parameters. (convert_from_openpgp_main): Ditto. (convert_to_openpgp): Simplify. * g10/import.c (one_mpi_from_pkey): Remove. (transfer_secret_keys): Rewrite to use the curve instead of the parameters. * g10/parse-packet.c (parse_key): Mark protected MPIs with USER1 flag. * common/openpgp-oid.c (openpgp_curve_to_oid): Allow the use of "NIST P-256" et al. * g10/keygen.c (ask_curve): Add arg ALGO. (generate_keypair): Rewrite the ECC key logic. * tests/openpgp/ecc.test: Provide the "ecc" passphrase.
Diffstat (limited to 'common/openpgp-oid.c')
-rw-r--r--common/openpgp-oid.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/common/openpgp-oid.c b/common/openpgp-oid.c
index 94a2296b6..bcb9885bc 100644
--- a/common/openpgp-oid.c
+++ b/common/openpgp-oid.c
@@ -280,17 +280,20 @@ openpgp_curve_to_oid (const char *name, unsigned int *r_nbits)
oidstr = "1.3.6.1.4.1.11591.15.1";
nbits = 255;
}
- else if (!strcmp (name, "nistp256"))
+ else if (!strcmp (name, "nistp256") || !strcmp (name, "NIST P-256"))
{
+ /* Libgcrypt uses "NIST P-256" as standard name for this curve
+ and thus the key generation returns this value. Thus we
+ allow both strings. */
oidstr = "1.2.840.10045.3.1.7";
nbits = 256;
}
- else if (!strcmp (name, "nistp384"))
+ else if (!strcmp (name, "nistp384") || !strcmp (name, "NIST P-384"))
{
oidstr = "1.3.132.0.34";
nbits = 384;
}
- else if (!strcmp (name, "nistp521"))
+ else if (!strcmp (name, "nistp521") || !strcmp (name, "NIST P-521"))
{
oidstr = "1.3.132.0.35";
nbits = 521;