summaryrefslogtreecommitdiffstats
path: root/common/openpgp-oid.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2013-10-22 14:26:53 +0200
committerWerner Koch <wk@gnupg.org>2013-12-05 13:50:35 +0100
commit59207a86e5f40c77fed296b642bf76692e8eef65 (patch)
tree4b9f097755f5dfa1f4af2927c4159e38141abe2d /common/openpgp-oid.c
parentcommon: Add put_membuf_printf. (diff)
downloadgnupg2-59207a86e5f40c77fed296b642bf76692e8eef65.tar.xz
gnupg2-59207a86e5f40c77fed296b642bf76692e8eef65.zip
gpg: Change OID of Ed25519 and add Brainpool oids.
* common/openpgp-oid.c (openpgp_curve_to_oid): Change OID for Ed25519. Add brainpool OIDs. (openpgp_oid_to_curve): Ditto. -- This change is required to the change in Libgcrypt. Note that we will likely use a different OpenPGP algorithm ID for EdDSA and thus the current Ed25519 implementation will not stay with us. Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'common/openpgp-oid.c')
-rw-r--r--common/openpgp-oid.c33
1 files changed, 27 insertions, 6 deletions
diff --git a/common/openpgp-oid.c b/common/openpgp-oid.c
index a1ceba4ef..05b1a4046 100644
--- a/common/openpgp-oid.c
+++ b/common/openpgp-oid.c
@@ -277,7 +277,7 @@ openpgp_curve_to_oid (const char *name, unsigned int *r_nbits)
oidstr = NULL;
else if (!strcmp (name, "Ed25519"))
{
- oidstr = "1.3.6.1.4.1.3029.1.5.1";
+ oidstr = "1.3.6.1.4.1.11591.15.1";
nbits = 255;
}
else if (!strcmp (name, "nistp256"))
@@ -295,6 +295,21 @@ openpgp_curve_to_oid (const char *name, unsigned int *r_nbits)
oidstr = "1.3.132.0.35";
nbits = 521;
}
+ else if (!strcmp (name,"brainpoolP256r1"))
+ {
+ oidstr = "1.3.36.3.3.2.8.1.1.7";
+ nbits = 256;
+ }
+ else if (!strcmp (name, "brainpoolP384r1"))
+ {
+ oidstr = "1.3.36.3.3.2.8.1.1.11";
+ nbits = 384;
+ }
+ else if (!strcmp (name, "brainpoolP512r1"))
+ {
+ oidstr = "1.3.36.3.3.2.8.1.1.13";
+ nbits = 512;
+ }
else
oidstr = NULL;
@@ -314,15 +329,21 @@ openpgp_oid_to_curve (const char *oid)
if (!oid)
name = "";
- else if (!strcmp (oid, "1.3.6.1.4.1.3029.1.5.1"))
+ else if (!strcmp (oid, "1.3.6.1.4.1.11591.15.1"))
name = "Ed25519";
else if (!strcmp (oid, "1.2.840.10045.3.1.7"))
- name = "NIST P-256";
+ name = "nistp256";
else if (!strcmp (oid, "1.3.132.0.34"))
- name = "NIST P-384";
+ name = "nistp384";
else if (!strcmp (oid, "1.3.132.0.35"))
- name = "NIST P-521";
- else /* FIXME: Lookup via Libgcrypt. */
+ name = "nistp521";
+ else if (!strcmp (oid, "1.3.36.3.3.2.8.1.1.7"))
+ name = "brainpoolP256r1";
+ else if (!strcmp (oid, "1.3.36.3.3.2.8.1.1.11"))
+ name = "brainpoolP384r1";
+ else if (!strcmp (oid, "1.3.36.3.3.2.8.1.1.13"))
+ name = "brainpoolP512r1";
+ else
name = "?";
return name;