Bug 1075686: Update Mozilla 35 to use NSS 3.17.2 Beta 2.

This fixes bug 1049435.
This commit is contained in:
Wan-Teh Chang 2014-10-09 10:58:30 -07:00
parent d624501a42
commit c8cbfbe327
4 changed files with 23 additions and 11 deletions

View File

@ -1 +1 @@
NSS_3_17_2_BETA1
NSS_3_17_2_BETA2

View File

@ -2367,7 +2367,7 @@ secuCommandFlag options_init[] =
"keyAttrFlags"},
{ /* opt_EmptyPassword */ 0, PR_FALSE, 0, PR_FALSE,
"empty-password"},
{ /* opt_CertVersion */ 0, PR_FALSE, 0, PR_FALSE,
{ /* opt_CertVersion */ 0, PR_TRUE, 0, PR_FALSE,
"certVersion"},
{ /* opt_AddSubjectAltExt */ 0, PR_TRUE, 0, PR_FALSE, "extSAN"},
{ /* opt_DumpExtensionValue */ 0, PR_TRUE, 0, PR_FALSE,

View File

@ -10,4 +10,3 @@
*/
#error "Do not include this header file."

View File

@ -97,8 +97,8 @@ static struct RSABlindingParamsListStr blindingParamsList = { 0 };
static PRBool nssRSAUseBlinding = PR_TRUE;
static SECStatus
rsa_build_from_primes(mp_int *p, mp_int *q,
mp_int *e, PRBool needPublicExponent,
rsa_build_from_primes(const mp_int *p, const mp_int *q,
mp_int *e, PRBool needPublicExponent,
mp_int *d, PRBool needPrivateExponent,
RSAPrivateKey *key, unsigned int keySizeInBits)
{
@ -116,6 +116,12 @@ rsa_build_from_primes(mp_int *p, mp_int *q,
CHECK_MPI_OK( mp_init(&psub1) );
CHECK_MPI_OK( mp_init(&qsub1) );
CHECK_MPI_OK( mp_init(&tmp) );
/* p and q must be distinct. */
if (mp_cmp(p, q) == 0) {
PORT_SetError(SEC_ERROR_NEED_RANDOM);
rv = SECFailure;
goto cleanup;
}
/* 1. Compute n = p*q */
CHECK_MPI_OK( mp_mul(p, q, &n) );
/* verify that the modulus has the desired number of bits */
@ -280,7 +286,11 @@ RSA_NewKey(int keySizeInBits, SECItem *publicExponent)
PORT_SetError(0);
CHECK_SEC_OK( generate_prime(&p, primeLen) );
CHECK_SEC_OK( generate_prime(&q, primeLen) );
/* Assure q < p */
/* Assure p > q */
/* NOTE: PKCS #1 does not require p > q, and NSS doesn't use any
* implementation optimization that requires p > q. We can remove
* this code in the future.
*/
if (mp_cmp(&p, &q) < 0)
mp_exch(&p, &q);
/* Attempt to use these primes to generate a key */
@ -762,7 +772,11 @@ RSA_PopulatePrivateKey(RSAPrivateKey *key)
}
}
/* force p to the the larger prime */
/* Assure p > q */
/* NOTE: PKCS #1 does not require p > q, and NSS doesn't use any
* implementation optimization that requires p > q. We can remove
* this code in the future.
*/
if (mp_cmp(&p, &q) < 0)
mp_exch(&p, &q);
@ -1093,7 +1107,7 @@ get_blinding_params(RSAPrivateKey *key, mp_int *n, unsigned int modLen,
{
RSABlindingParams *rsabp = NULL;
blindingParams *bpUnlinked = NULL;
blindingParams *bp, *prevbp = NULL;
blindingParams *bp;
PRCList *el;
SECStatus rv = SECSuccess;
mp_err err = MP_OKAY;
@ -1183,7 +1197,6 @@ get_blinding_params(RSAPrivateKey *key, mp_int *n, unsigned int modLen,
}
/* We did not find a usable set of blinding params. Can we make one? */
/* Find a free bp struct. */
prevbp = NULL;
if ((bp = rsabp->free) != NULL) {
/* unlink this bp */
rsabp->free = bp->next;
@ -1400,8 +1413,8 @@ RSA_PrivateKeyCheck(const RSAPrivateKey *key)
SECITEM_TO_MPINT(key->exponent1, &d_p);
SECITEM_TO_MPINT(key->exponent2, &d_q);
SECITEM_TO_MPINT(key->coefficient, &qInv);
/* p > q */
if (mp_cmp(&p, &q) <= 0) {
/* p and q must be distinct. */
if (mp_cmp(&p, &q) == 0) {
rv = SECFailure;
goto cleanup;
}