Merge remote-tracking branch 'origin/tracking' into custom

This commit is contained in:
roytam1 2023-02-22 07:09:09 +08:00
commit a52c44343e
16 changed files with 359 additions and 179 deletions

View file

@ -1740,6 +1740,10 @@ private:
return NS_ERROR_DOM_SYNTAX_ERR;
}
if (pubKey->keyType != rsaKey) {
return NS_ERROR_DOM_DATA_ERR;
}
// Extract relevant information from the public key
mModulusLength = 8 * pubKey->u.rsa.modulus.len;
if (!mPublicExponent.Assign(&pubKey->u.rsa.publicExponent)) {
@ -1873,6 +1877,10 @@ private:
}
if (mFormat.EqualsLiteral(WEBCRYPTO_KEY_FORMAT_SPKI)) {
if (pubKey->keyType != ecKey) {
return NS_ERROR_DOM_DATA_ERR;
}
if (!CheckEncodedECParameters(&pubKey->u.ec.DEREncodedParams)) {
return NS_ERROR_DOM_OPERATION_ERR;
}