mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
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>
This commit is contained in:
parent
159d42ee6a
commit
59207a86e5
@ -277,7 +277,7 @@ openpgp_curve_to_oid (const char *name, unsigned int *r_nbits)
|
|||||||
oidstr = NULL;
|
oidstr = NULL;
|
||||||
else if (!strcmp (name, "Ed25519"))
|
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;
|
nbits = 255;
|
||||||
}
|
}
|
||||||
else if (!strcmp (name, "nistp256"))
|
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";
|
oidstr = "1.3.132.0.35";
|
||||||
nbits = 521;
|
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
|
else
|
||||||
oidstr = NULL;
|
oidstr = NULL;
|
||||||
|
|
||||||
@ -314,15 +329,21 @@ openpgp_oid_to_curve (const char *oid)
|
|||||||
|
|
||||||
if (!oid)
|
if (!oid)
|
||||||
name = "";
|
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";
|
name = "Ed25519";
|
||||||
else if (!strcmp (oid, "1.2.840.10045.3.1.7"))
|
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"))
|
else if (!strcmp (oid, "1.3.132.0.34"))
|
||||||
name = "NIST P-384";
|
name = "nistp384";
|
||||||
else if (!strcmp (oid, "1.3.132.0.35"))
|
else if (!strcmp (oid, "1.3.132.0.35"))
|
||||||
name = "NIST P-521";
|
name = "nistp521";
|
||||||
else /* FIXME: Lookup via Libgcrypt. */
|
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 = "?";
|
name = "?";
|
||||||
|
|
||||||
return name;
|
return name;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user