diff options
author | Franziskus Kiefer <franziskuskiefer@gmail.com> | 2016-03-18 18:36:22 +0100 |
---|---|---|
committer | Franziskus Kiefer <franziskuskiefer@gmail.com> | 2016-03-18 18:36:22 +0100 |
commit | 8bbc8aa7f7a4595b255c8fbe7e5ccc774a87488f (patch) | |
tree | 1277ed916ba6e750da2b8f2b3c61d533ef83afef | |
parent | 7f2366bdd5c7894cec81a4f96e5976ed17c84e65 (diff) | |
download | nss-hg-8bbc8aa7f7a4595b255c8fbe7e5ccc774a87488f.tar.gz |
Backed out changeset 825c88866c99
-rw-r--r-- | lib/pk11wrap/pk11akey.c | 8 | ||||
-rw-r--r-- | lib/pk11wrap/pk11merge.c | 24 | ||||
-rw-r--r-- | lib/pk11wrap/pk11skey.c | 9 |
3 files changed, 11 insertions, 30 deletions
diff --git a/lib/pk11wrap/pk11akey.c b/lib/pk11wrap/pk11akey.c index 40c32838f..63de67d8d 100644 --- a/lib/pk11wrap/pk11akey.c +++ b/lib/pk11wrap/pk11akey.c @@ -1999,9 +1999,7 @@ PK11_CopyTokenPrivKeyToSessionPrivKey(PK11SlotInfo *destSlot, return newKey; } destSlot = privKey->pkcs11Slot; - if (PK11_Authenticate(destSlot, PR_TRUE, privKey->wincx) != SECSuccess) { - return NULL; - } + PK11_Authenticate(destSlot, PR_TRUE, privKey->wincx); PK11_EnterSlotMonitor(destSlot); crv = PK11_GETTAB(destSlot)->C_CopyObject( destSlot->session, privKey->pkcs11ID, @@ -2031,9 +2029,7 @@ PK11_ConvertSessionPrivKeyToTokenPrivKey(SECKEYPrivateKey *privk, void* wincx) PK11_SETATTRS(attrs, CKA_TOKEN, &cktrue, sizeof(cktrue)); attrs++; - if (PK11_Authenticate(slot, PR_TRUE, wincx) != SECSuccess) { - return NULL; - } + PK11_Authenticate(slot, PR_TRUE, wincx); rwsession = PK11_GetRWSession(slot); if (rwsession == CK_INVALID_SESSION) { PORT_SetError(SEC_ERROR_BAD_DATA); diff --git a/lib/pk11wrap/pk11merge.c b/lib/pk11wrap/pk11merge.c index 2192de12d..8fadc7caf 100644 --- a/lib/pk11wrap/pk11merge.c +++ b/lib/pk11wrap/pk11merge.c @@ -1122,20 +1122,14 @@ pk11_mergeTrust(PK11SlotInfo *targetSlot, PK11SlotInfo *sourceSlot, targetTemplate.type = sourceTemplate.type = trustAttrs[i]; targetTemplate.pValue = sourceTemplate.pValue = NULL; targetTemplate.ulValueLen = sourceTemplate.ulValueLen = 0; - if (PK11_GetAttributes(arena, sourceSlot, id, &sourceTemplate, 1) - != CKR_OK) { - rv = SECFailure; - error = PORT_GetError(); - } - if (PK11_GetAttributes(arena, targetSlot, targetTrustID, - &targetTemplate, 1) != CKR_OK) { - rv = SECFailure; - error = PORT_GetError(); - } + PK11_GetAttributes(arena, sourceSlot, id, &sourceTemplate, 1); + PK11_GetAttributes(arena, targetSlot, targetTrustID, + &targetTemplate, 1); if (pk11_mergeTrustEntry(&targetTemplate, &sourceTemplate)) { /* source wins, write out the source attribute to the target */ - if (pk11_setAttributes(targetSlot, targetTrustID, - &sourceTemplate, 1) != SECSuccess) { + SECStatus lrv = pk11_setAttributes(targetSlot, targetTrustID, + &sourceTemplate, 1); + if (lrv != SECSuccess) { rv = SECFailure; error = PORT_GetError(); } @@ -1148,11 +1142,7 @@ pk11_mergeTrust(PK11SlotInfo *targetSlot, PK11SlotInfo *sourceSlot, sourceTemplate.ulValueLen = 0; /* if the source has steup set, then set it in the target */ - if (PK11_GetAttributes(arena, sourceSlot, id, &sourceTemplate, 1) - != CKR_OK) { - rv = SECFailure; - error = PORT_GetError(); - } + PK11_GetAttributes(arena, sourceSlot, id, &sourceTemplate, 1); if ((sourceTemplate.ulValueLen == sizeof(CK_BBOOL)) && (sourceTemplate.pValue) && (*(CK_BBOOL *)sourceTemplate.pValue == CK_TRUE)) { diff --git a/lib/pk11wrap/pk11skey.c b/lib/pk11wrap/pk11skey.c index 4da469d27..20d9eaad9 100644 --- a/lib/pk11wrap/pk11skey.c +++ b/lib/pk11wrap/pk11skey.c @@ -1086,10 +1086,7 @@ PK11_KeyGenWithTemplate(PK11SlotInfo *slot, CK_MECHANISM_TYPE type, /* Get session and perform locking */ if (isToken) { - if (PK11_Authenticate(symKey->slot,PR_TRUE,wincx) != SECSuccess) { - PK11_FreeSymKey(symKey); - return NULL; - } + PK11_Authenticate(symKey->slot,PR_TRUE,wincx); /* Should always be original slot */ session = PK11_GetRWSession(symKey->slot); symKey->owner = PR_FALSE; @@ -1144,9 +1141,7 @@ PK11_ConvertSessionSymKeyToTokenSymKey(PK11SymKey *symk, void *wincx) PK11_SETATTRS(attrs, CKA_TOKEN, &cktrue, sizeof(cktrue)); attrs++; - if (PK11_Authenticate(slot, PR_TRUE, wincx) != SECSuccess) { - return NULL; - } + PK11_Authenticate(slot, PR_TRUE, wincx); rwsession = PK11_GetRWSession(slot); if (rwsession == CK_INVALID_SESSION) { PORT_SetError(SEC_ERROR_BAD_DATA); |