Skip to content

Commit

Permalink
Bug 1355422 - fix DoCipher return values, r=mt
Browse files Browse the repository at this point in the history
Differential Revision: https://nss-review.dev.mozaws.net/D287

--HG--
extra : rebase_source : 66b8ceb9359be7324d77bc34a5f071b43aa19850
  • Loading branch information
franziskuskiefer committed Apr 19, 2017
1 parent ee713af commit 302e442
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nss-tool/enc/enctool.cc
Expand Up @@ -238,21 +238,21 @@ bool EncTool::DoCipher(std::string file_name, std::string out_file,
ScopedPK11SlotInfo slot(PK11_GetInternalSlot());
if (!slot) {
PrintError("Unable to find security device", PR_GetError(), __LINE__);
return SECFailure;
return false;
}

ScopedSECItem key, params;
if (!(this->*get_params)(std::vector<uint8_t>(), key, params)) {
PrintError("Geting keys and params failed.", __LINE__);
return SECFailure;
return false;
}

ScopedPK11SymKey symKey(
PK11_ImportSymKey(slot.get(), cipher_mech_, PK11_OriginUnwrap,
CKA_DECRYPT | CKA_ENCRYPT, key.get(), nullptr));
if (!symKey) {
PrintError("Failure to import key into NSS", PR_GetError(), __LINE__);
return SECFailure;
return false;
}

std::streambuf* buf;
Expand Down

0 comments on commit 302e442

Please sign in to comment.