Skip to content

Commit 59bd7e3

Browse files
committed
Make sure curve OID lengths match
Could match with a weaker curve without full length matching (although mostly mitigated anyway). F-315
1 parent 1a55eb2 commit 59bd7e3

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/internal.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8476,7 +8476,8 @@ static int ecc_lookup_curve(const byte* oid, word32 len)
84768476

84778477
for (curve = DefinedCurves; curve->curve_id < ECC_CURVE_MAX; curve++)
84788478
{
8479-
if (XMEMCMP(oid, curve->curve_oid, MIN(len, curve->curve_size)) == 0) {
8479+
if (len == curve->curve_size &&
8480+
XMEMCMP(oid, curve->curve_oid, len) == 0) {
84808481
return curve->curve_id;
84818482
}
84828483
}

0 commit comments

Comments
 (0)