Bug 2027346 - validate encoded EC params length and tag in SECKEY_ECParamsToKeySize/BasePointOrderLen.
This commit is contained in:
1 parent
1dba423327
commit
6cda35442f
1 file changed
+7
@@ -696,6 +696,13 @@ SECKEY_ECParamsToKeySize(const SECItem *encodedParams)
|
||||
/* The encodedParams data contains 0x06 (SEC_ASN1_OBJECT_ID),
|
||||
* followed by the length of the curve oid and the curve oid.
|
||||
*/
|
||||
if (!encodedParams || !encodedParams->data ||
|
||||
encodedParams->len < 2 ||
|
||||
encodedParams->data[0] != SEC_ASN1_OBJECT_ID ||
|
||||
(unsigned)encodedParams->data[1] > encodedParams->len - 2) {
|
||||
PORT_SetError(SEC_ERROR_BAD_DER);
|
||||
return 0;
|
||||
}
|
||||
oid.len = encodedParams->data[1];
|
||||
oid.data = encodedParams->data + 2;
|
||||
if ((tag = SECOID_FindOIDTag(&oid)) == SEC_OID_UNKNOWN)
|
||||
|
||||
Reference in new issue
Block a user