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 /lib/pk11wrap/pk11merge.c | |
parent | 7f2366bdd5c7894cec81a4f96e5976ed17c84e65 (diff) | |
download | nss-hg-8bbc8aa7f7a4595b255c8fbe7e5ccc774a87488f.tar.gz |
Backed out changeset 825c88866c99
Diffstat (limited to 'lib/pk11wrap/pk11merge.c')
-rw-r--r-- | lib/pk11wrap/pk11merge.c | 24 |
1 files changed, 7 insertions, 17 deletions
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)) { |