summaryrefslogtreecommitdiffstats
path: root/security/nss/lib/util/secoid.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/nss/lib/util/secoid.c')
-rw-r--r--security/nss/lib/util/secoid.c30
1 files changed, 26 insertions, 4 deletions
diff --git a/security/nss/lib/util/secoid.c b/security/nss/lib/util/secoid.c
index 800cc7ff62..05208eeffa 100644
--- a/security/nss/lib/util/secoid.c
+++ b/security/nss/lib/util/secoid.c
@@ -613,6 +613,22 @@ CONST_OID evIncorporationCountry[] = { EV_NAME_ATTRIBUTE, 3 };
*/
CONST_OID curve25519[] = { 0x2B, 0x06, 0x01, 0x04, 0x01, 0xDA, 0x47, 0x0F, 0x01 };
+/*
+ https://oid-rep.orange-labs.fr/get/1.3.101.112
+ A.1. ASN.1 Object for Ed25519
+ id-Ed25519 OBJECT IDENTIFIER ::= { 1.3.101.112 }
+ Parameters are absent. Length is 7 bytes.
+ Binary encoding: 3005 0603 2B65 70
+
+ The same algorithm identifiers are used for identifying a public key,
+ a private key, and a signature (for the two EdDSA related OIDs).
+ Additional encoding information is provided below for each of these
+ locations.
+*/
+
+CONST_OID ed25519PublicKey[] = { 0x2B, 0x65, 0x70 };
+CONST_OID ed25519Signature[] = { 0x2B, 0x65, 0x70 };
+
#define OI(x) \
{ \
siDEROID, (unsigned char *)x, sizeof x \
@@ -1819,6 +1835,13 @@ const static SECOidData oids[SEC_OID_TOTAL] = {
ODE(SEC_OID_XYBER768D00,
"X25519+Kyber768 key exchange", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION),
+
+ OD(ed25519Signature, SEC_OID_ED25519_SIGNATURE, "X9.62 EDDSA signature", CKM_EDDSA,
+ INVALID_CERT_EXTENSION),
+
+ OD(ed25519PublicKey, SEC_OID_ED25519_PUBLIC_KEY,
+ "X9.62 elliptic edwards curve public key", CKM_EC_EDWARDS_KEY_PAIR_GEN, INVALID_CERT_EXTENSION),
+
};
/* PRIVATE EXTENDED SECOID Table
@@ -2133,10 +2156,9 @@ SECOID_Init(void)
for (i = 0; i < SEC_OID_TOTAL; i++) {
oid = &oids[i];
-
PORT_Assert(oid->offset == i);
-
entry = PL_HashTableAdd(oidhash, &oid->oid, (void *)oid);
+
if (entry == NULL) {
PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
PORT_Assert(0); /*This function should never fail. */
@@ -2196,7 +2218,6 @@ SECOID_FindOID(const SECItem *oid)
PORT_SetError(SEC_ERROR_UNRECOGNIZED_OID);
}
}
-
return (ret);
}
@@ -2206,8 +2227,9 @@ SECOID_FindOIDTag(const SECItem *oid)
SECOidData *oiddata;
oiddata = SECOID_FindOID(oid);
- if (oiddata == NULL)
+ if (oiddata == NULL) {
return SEC_OID_UNKNOWN;
+ }
return oiddata->offset;
}