Bug 1115761, Part 2: Use NotReached more consistently in pkixnss.cpp, r=jcj
authorBrian Smith <brian@briansmith.org>
Tue, 23 Dec 2014 22:35:53 -0800
changeset 247626 89cbfbbfa109befca5059c3dbb8096fbbce4be6c
parent 247625 c8a2c89f8a26d175d6bc9fd65df94699f4b8c614
child 247627 f7de7f93a099483093279b13681a14e96f22622a
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjcj
bugs1115761
milestone37.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1115761, Part 2: Use NotReached more consistently in pkixnss.cpp, r=jcj
security/pkix/lib/pkixnss.cpp
--- a/security/pkix/lib/pkixnss.cpp
+++ b/security/pkix/lib/pkixnss.cpp
@@ -122,18 +122,18 @@ VerifySignedData(const SignedDataWithSig
       digestAlg = SEC_OID_SHA256;
       break;
     case SignatureAlgorithm::rsa_pkcs1_with_sha1:
       pubKeyAlg = SEC_OID_PKCS1_RSA_ENCRYPTION;
       digestAlg = SEC_OID_SHA1;
       break;
     case SignatureAlgorithm::unsupported_algorithm:
     default:
-      PR_NOT_REACHED("unknown signature algorithm");
-      return Result::ERROR_CERT_SIGNATURE_ALGORITHM_DISABLED;
+      return NotReached("unknown signature algorithm",
+                        Result::ERROR_CERT_SIGNATURE_ALGORITHM_DISABLED);
   }
 
   Result rv;
   ScopedSECKeyPublicKey pubKey;
   rv = CheckPublicKeySize(subjectPublicKeyInfo, minimumNonECCBits, pubKey);
   if (rv != Success) {
     return rv;
   }
@@ -159,18 +159,17 @@ VerifySignedData(const SignedDataWithSig
 }
 
 Result
 DigestBuf(Input item, /*out*/ uint8_t* digestBuf, size_t digestBufLen)
 {
   static_assert(TrustDomain::DIGEST_LENGTH == SHA1_LENGTH,
                 "TrustDomain::DIGEST_LENGTH must be 20 (SHA-1 digest length)");
   if (digestBufLen != TrustDomain::DIGEST_LENGTH) {
-    PR_NOT_REACHED("invalid hash length");
-    return Result::FATAL_ERROR_INVALID_ARGS;
+    return NotReached("invalid hash length", Result::FATAL_ERROR_INVALID_ARGS);
   }
   SECItem itemSECItem = UnsafeMapInputToSECItem(item);
   if (itemSECItem.len >
         static_cast<decltype(itemSECItem.len)>(
           std::numeric_limits<int32_t>::max())) {
     PR_NOT_REACHED("large items should not be possible here");
     return Result::FATAL_ERROR_INVALID_ARGS;
   }