diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /security/nss/lib/freebl/ecdecode.c | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'security/nss/lib/freebl/ecdecode.c')
-rw-r--r-- | security/nss/lib/freebl/ecdecode.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/security/nss/lib/freebl/ecdecode.c b/security/nss/lib/freebl/ecdecode.c index 24ba11f3b1..c78eedf373 100644 --- a/security/nss/lib/freebl/ecdecode.c +++ b/security/nss/lib/freebl/ecdecode.c @@ -120,7 +120,8 @@ EC_FillParams(PLArenaPool *arena, const SECItem *encodedParams, if ((encodedParams->len != ANSI_X962_CURVE_OID_TOTAL_LEN) && (encodedParams->len != SECG_CURVE_OID_TOTAL_LEN) && - (encodedParams->len != PKIX_NEWCURVES_OID_TOTAL_LEN)) { + (encodedParams->len != PKIX_NEWCURVES_OID_TOTAL_LEN) && + (encodedParams->len != ED25519_OID_TOTAL_LEN)) { PORT_SetError(SEC_ERROR_UNSUPPORTED_ELLIPTIC_CURVE); return SECFailure; }; @@ -174,6 +175,13 @@ EC_FillParams(PLArenaPool *arena, const SECItem *encodedParams, ec_field_GFp, params)); break; + case SEC_OID_ED25519_PUBLIC_KEY: + params->type = ec_params_edwards_named; + CHECK_SEC_OK(gf_populate_params_bytes(ECCurve_Ed25519, + ec_field_plain, params)); + + break; + case SEC_OID_CURVE25519: /* Populate params for Curve25519 */ params->type = ec_params_montgomery_named; @@ -246,10 +254,11 @@ EC_GetPointSize(const ECParams *params) int sizeInBytes = (params->fieldID.size + 7) / 8; return sizeInBytes * 2 + 1; } - if (name == ECCurve25519) { - /* Only X here */ + + if (params->type == ec_params_edwards_named || params->type == ec_params_montgomery_named) { return curveParams->scalarSize; } + return curveParams->pointSize - 1; } |