Bug 1355422 - fix DoCipher return values, r=mt
authorFranziskus Kiefer <franziskuskiefer@gmail.com>
Wed, 19 Apr 2017 14:42:50 +0200
changeset 13302 0658e7288f208215ff5bf426c8e42cff5099b59e
parent 13297 7e99f75f196d868e21beb8956257e2fa199d6b6e
child 13303 00b2cc2b33c737fb2a97862aeca55c1079cdebd8
push id2155
push userfranziskuskiefer@gmail.com
push dateWed, 19 Apr 2017 12:47:29 +0000
reviewersmt
bugs1355422
Bug 1355422 - fix DoCipher return values, r=mt Differential Revision: https://nss-review.dev.mozaws.net/D287
nss-tool/enc/enctool.cc
--- a/nss-tool/enc/enctool.cc
+++ b/nss-tool/enc/enctool.cc
@@ -233,31 +233,31 @@ bool EncTool::DoCipher(std::string file_
   unsigned int outLen = 0, chunkSize = 1024;
   char buffer[chunkSize + 16];
   const unsigned char* bufferStart =
       reinterpret_cast<const unsigned char*>(buffer);
 
   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;
   std::ofstream output_file(out_file, std::ios::out | std::ios::binary);
   if (!out_file.empty()) {
     if (!output_file.good()) {
       return false;
     }