mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-24 09:27:31 +09:00
Update NSS to 3.48 while keeping vc2013 hackfix and no-sslkeylogfile intact.
This commit is contained in:
parent
0b9855b841
commit
171849c8e5
351 changed files with 115185 additions and 57946 deletions
|
|
@ -47,12 +47,6 @@ checkKeyParams(const SECAlgorithmID *sigAlgorithm, const SECKEYPublicKey *key)
|
|||
PRInt32 minLen, len;
|
||||
|
||||
sigAlg = SECOID_GetAlgorithmTag(sigAlgorithm);
|
||||
rv = NSS_GetAlgorithmPolicy(sigAlg, &policyFlags);
|
||||
if (rv == SECSuccess &&
|
||||
!(policyFlags & NSS_USE_ALG_IN_CERT_SIGNATURE)) {
|
||||
PORT_SetError(SEC_ERROR_CERT_SIGNATURE_ALGORITHM_DISABLED);
|
||||
return SECFailure;
|
||||
}
|
||||
|
||||
switch (sigAlg) {
|
||||
case SEC_OID_ANSIX962_ECDSA_SHA1_SIGNATURE:
|
||||
|
|
@ -168,36 +162,62 @@ CERT_VerifySignedDataWithPublicKey(const CERTSignedData *sd,
|
|||
{
|
||||
SECStatus rv;
|
||||
SECItem sig;
|
||||
SECOidTag hashAlg = SEC_OID_UNKNOWN;
|
||||
SECOidTag sigAlg;
|
||||
SECOidTag encAlg;
|
||||
SECOidTag hashAlg;
|
||||
PRUint32 policyFlags;
|
||||
|
||||
if (!pubKey || !sd) {
|
||||
PORT_SetError(PR_INVALID_ARGUMENT_ERROR);
|
||||
return SECFailure;
|
||||
}
|
||||
|
||||
/* Can we use this algorithm for signature verification? */
|
||||
sigAlg = SECOID_GetAlgorithmTag(&sd->signatureAlgorithm);
|
||||
rv = sec_DecodeSigAlg(pubKey, sigAlg,
|
||||
&sd->signatureAlgorithm.parameters,
|
||||
&encAlg, &hashAlg);
|
||||
if (rv != SECSuccess) {
|
||||
return SECFailure; /* error is set */
|
||||
}
|
||||
rv = NSS_GetAlgorithmPolicy(encAlg, &policyFlags);
|
||||
if (rv == SECSuccess &&
|
||||
!(policyFlags & NSS_USE_ALG_IN_CERT_SIGNATURE)) {
|
||||
PORT_SetError(SEC_ERROR_CERT_SIGNATURE_ALGORITHM_DISABLED);
|
||||
return SECFailure;
|
||||
}
|
||||
rv = NSS_GetAlgorithmPolicy(hashAlg, &policyFlags);
|
||||
if (rv == SECSuccess &&
|
||||
!(policyFlags & NSS_USE_ALG_IN_CERT_SIGNATURE)) {
|
||||
PORT_SetError(SEC_ERROR_CERT_SIGNATURE_ALGORITHM_DISABLED);
|
||||
return SECFailure;
|
||||
}
|
||||
rv = checkKeyParams(&sd->signatureAlgorithm, pubKey);
|
||||
if (rv != SECSuccess) {
|
||||
PORT_SetError(SEC_ERROR_CERT_SIGNATURE_ALGORITHM_DISABLED);
|
||||
return SECFailure;
|
||||
}
|
||||
|
||||
/* check the signature */
|
||||
sig = sd->signature;
|
||||
/* convert sig->len from bit counts to byte count. */
|
||||
DER_ConvertBitString(&sig);
|
||||
|
||||
rv = VFY_VerifyDataWithAlgorithmID(sd->data.data, sd->data.len, pubKey,
|
||||
&sig, &sd->signatureAlgorithm, &hashAlg, wincx);
|
||||
if (rv == SECSuccess) {
|
||||
/* Are we honoring signatures for this algorithm? */
|
||||
PRUint32 policyFlags = 0;
|
||||
rv = checkKeyParams(&sd->signatureAlgorithm, pubKey);
|
||||
if (rv != SECSuccess) {
|
||||
PORT_SetError(SEC_ERROR_CERT_SIGNATURE_ALGORITHM_DISABLED);
|
||||
return SECFailure;
|
||||
}
|
||||
|
||||
rv = NSS_GetAlgorithmPolicy(hashAlg, &policyFlags);
|
||||
if (rv == SECSuccess &&
|
||||
!(policyFlags & NSS_USE_ALG_IN_CERT_SIGNATURE)) {
|
||||
PORT_SetError(SEC_ERROR_CERT_SIGNATURE_ALGORITHM_DISABLED);
|
||||
return SECFailure;
|
||||
}
|
||||
&sig, &sd->signatureAlgorithm,
|
||||
&hashAlg, wincx);
|
||||
if (rv != SECSuccess) {
|
||||
return SECFailure; /* error is set */
|
||||
}
|
||||
return rv;
|
||||
|
||||
/* for some algorithms, hash algorithm is only known after verification */
|
||||
rv = NSS_GetAlgorithmPolicy(hashAlg, &policyFlags);
|
||||
if (rv == SECSuccess &&
|
||||
!(policyFlags & NSS_USE_ALG_IN_CERT_SIGNATURE)) {
|
||||
PORT_SetError(SEC_ERROR_CERT_SIGNATURE_ALGORITHM_DISABLED);
|
||||
return SECFailure;
|
||||
}
|
||||
return SECSuccess;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue