Fix an erroneous assertion. Clean up some other code. Bug 244929.

r= jpierre, wtc.
This commit is contained in:
nelsonb%netscape.com 2004-06-03 03:41:07 +00:00
Родитель 652c409f6e
Коммит 45fbe7addd
3 изменённых файлов: 8 добавлений и 14 удалений

Просмотреть файл

@ -197,7 +197,7 @@ CMMF_KeyRecRepContentSetCertifiedKeyPair(CMMFKeyRecRepContent *inKeyRecRep,
}
dummy = crmf_create_encrypted_value_wrapped_privkey(inPrivKey, inPubKey,
keyPair->privateKey);
PORT_Assert(dummy = keyPair->privateKey);
PORT_Assert(dummy == keyPair->privateKey);
if (dummy != keyPair->privateKey) {
crmf_destroy_encrypted_value(dummy, PR_TRUE);
goto loser;

Просмотреть файл

@ -770,6 +770,7 @@ crmf_create_encrypted_value_wrapped_privkey(SECKEYPrivateKey *inPrivKey,
if (pubMechType == CKM_INVALID_MECHANISM) {
/* XXX I should probably do something here for non-RSA
* keys that are in certs. (ie DSA)
* XXX or at least SET AN ERROR CODE.
*/
goto loser;
}
@ -832,20 +833,14 @@ crmf_create_encrypted_value_wrapped_privkey(SECKEYPrivateKey *inPrivKey,
if (rv != SECSuccess) {
goto loser;
}
PORT_Free(encodedParam.data);
SECITEM_FreeItem(&encodedParam, PR_FALSE);
PORT_Free(wrappedPrivKeyBits);
PORT_Free(wrappedSymKeyBits);
if (iv->data != NULL) {
PORT_Free(iv->data);
}
PORT_Free(iv);
SECITEM_FreeItem(iv, PR_TRUE);
return destValue;
loser:
if (iv != NULL) {
if (iv->data) {
PORT_Free(iv->data);
}
PORT_Free(iv);
SECITEM_FreeItem(iv, PR_TRUE);
}
if (myEncrValue != NULL) {
crmf_destroy_encrypted_value(myEncrValue, PR_TRUE);
@ -857,7 +852,7 @@ crmf_create_encrypted_value_wrapped_privkey(SECKEYPrivateKey *inPrivKey,
PORT_Free(wrappedPrivKeyBits);
}
if (encodedParam.data != NULL) {
PORT_Free(encodedParam.data);
SECITEM_FreeItem(&encodedParam, PR_FALSE);
}
return NULL;
}

Просмотреть файл

@ -152,9 +152,8 @@ CMMF_CertResponseGetCertificate(CMMFCertResponse *inCertResp,
return NULL;
}
return cmmf_CertOrEncCertGetCertificate
(&inCertResp->certifiedKeyPair->certOrEncCert,
inCertdb);
return cmmf_CertOrEncCertGetCertificate(
&inCertResp->certifiedKeyPair->certOrEncCert, inCertdb);
}