Merge from mozilla-central.
authorDavid Anderson <danderson@mozilla.com>
Mon, 17 Oct 2011 11:52:12 -0700
changeset 20370 96abc634836158f5e60e75e82f90dc361d09948d
parent 20369 48916592d0805940961d6fa77904b25ab95be89d (current diff)
parent 20360 2b9f1defff15b905fc230019bd8bda15c4cd98eb (diff)
child 20371 902e8b16d30627a5bcd48f2172f3376f48c4a773
push id1209
push usermbanner@mozilla.com
push dateTue, 02 Sep 2014 16:59:36 +0000
treeherdercomm-beta@842e0fd167ee [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
Merge from mozilla-central.
mailnews/mime/src/nsCMS.cpp
--- a/mailnews/mime/src/nsCMS.cpp
+++ b/mailnews/mime/src/nsCMS.cpp
@@ -279,29 +279,29 @@ nsresult nsCMSMessage::CommonVerifySigna
     if (NSS_CMSSignedData_SetDigestValue(sigd, SEC_OID_SHA1, &digest)) {
       PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsCMSMessage::CommonVerifySignature - bad digest\n"));
       rv = NS_ERROR_CMS_VERIFY_BAD_DIGEST;
       goto loser;
     }
   }
 
   // Import certs. Note that import failure is not a signature verification failure. //
-  if (NSS_CMSSignedData_ImportCerts(sigd, CERT_GetDefaultCertDB(), certUsageEmailRecipient, PR_TRUE) != SECSuccess) {
+  if (NSS_CMSSignedData_ImportCerts(sigd, CERT_GetDefaultCertDB(), certUsageEmailRecipient, true) != SECSuccess) {
     PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsCMSMessage::CommonVerifySignature - can not import certs\n"));
   }
 
   nsigners = NSS_CMSSignedData_SignerInfoCount(sigd);
   PR_ASSERT(nsigners > 0);
   si = NSS_CMSSignedData_GetSignerInfo(sigd, 0);
 
   // See bug 324474. We want to make sure the signing cert is 
   // still valid at the current time.
 
   if (!nsNSSComponent::globalConstFlagUsePKIXVerification) {
-    if (CERT_VerifyCertificateNow(CERT_GetDefaultCertDB(), si->cert, PR_TRUE, 
+    if (CERT_VerifyCertificateNow(CERT_GetDefaultCertDB(), si->cert, true, 
                                   certificateUsageEmailSigner,
                                   si->cmsg->pwfn_arg, NULL) != SECSuccess) {
       PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsCMSMessage::CommonVerifySignature - signing cert not trusted now\n"));
       rv = NS_ERROR_CMS_VERIFY_UNTRUSTED;
       goto loser;
     }
   }
   else {
@@ -463,46 +463,46 @@ public:
       for (PRUint32 i=0; i < mSize; i++) {
         if (mCerts[i]) {
           CERT_DestroyCertificate(mCerts[i]);
         }
       }
     }
 
     if (mPoolp)
-      PORT_FreeArena(mPoolp, PR_FALSE);
+      PORT_FreeArena(mPoolp, false);
   }
 
   bool allocate(PRUint32 count)
   {
     // only allow allocation once
     if (mPoolp)
-      return PR_FALSE;
+      return false;
   
     mSize = count;
 
     if (!mSize)
-      return PR_FALSE;
+      return false;
   
     mPoolp = PORT_NewArena(1024);
     if (!mPoolp)
-      return PR_FALSE;
+      return false;
 
     mCerts = (CERTCertificate**)PORT_ArenaZAlloc(
       mPoolp, (count+1)*sizeof(CERTCertificate*));
 
     if (!mCerts)
-      return PR_FALSE;
+      return false;
 
     // null array, including zero termination
     for (PRUint32 i = 0; i < count+1; i++) {
       mCerts[i] = nsnull;
     }
 
-    return PR_TRUE;
+    return true;
   }
   
   void set(PRUint32 i, CERTCertificate *c)
   {
     nsNSSShutDownPreventionLock locker;
     if (isAlreadyShutDown())
       return;
 
@@ -604,17 +604,17 @@ NS_IMETHODIMP nsCMSMessage::CreateEncryp
 
   cinfo = NSS_CMSMessage_GetContentInfo(m_cmsMsg);
   if (NSS_CMSContentInfo_SetContent_EnvelopedData(m_cmsMsg, cinfo, envd) != SECSuccess) {
     PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsCMSMessage::CreateEncrypted - can't create content enveloped data\n"));
     goto loser;
   }
 
   cinfo = NSS_CMSEnvelopedData_GetContentInfo(envd);
-  if (NSS_CMSContentInfo_SetContent_Data(m_cmsMsg, cinfo, nsnull, PR_FALSE) != SECSuccess) {
+  if (NSS_CMSContentInfo_SetContent_Data(m_cmsMsg, cinfo, nsnull, false) != SECSuccess) {
     PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsCMSMessage::CreateEncrypted - can't set content data\n"));
     goto loser;
   }
 
   // Create and attach recipient information //
   for (i=0; i < recipientCertCount; i++) {
     CERTCertificate *rc = recipientCerts.get(i);
     CERTCertificateCleaner rcCleaner(rc);
@@ -692,17 +692,17 @@ NS_IMETHODIMP nsCMSMessage::CreateSigned
           != SECSuccess) {
     PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsCMSMessage::CreateSigned - can't set content signed data\n"));
     goto loser;
   }
 
   cinfo = NSS_CMSSignedData_GetContentInfo(sigd);
 
   /* we're always passing data in and detaching optionally */
-  if (NSS_CMSContentInfo_SetContent_Data(m_cmsMsg, cinfo, nsnull, PR_TRUE) 
+  if (NSS_CMSContentInfo_SetContent_Data(m_cmsMsg, cinfo, nsnull, true) 
           != SECSuccess) {
     PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsCMSMessage::CreateSigned - can't set content data\n"));
     goto loser;
   }
 
   /* 
    * create & attach signer information
    */
--- a/mailnews/mime/src/nsCMSSecureMessage.cpp
+++ b/mailnews/mime/src/nsCMSSecureMessage.cpp
@@ -103,17 +103,17 @@ GetCertByPrefID(const char *certID, char
   }
 
   rv = prefs->GetCharPref(certID,
                           getter_Copies(nickname));
   if (NS_FAILED(rv)) goto done;
 
   /* Find a good cert in the user's database */
   cert = CERT_FindUserCertByUsage(CERT_GetDefaultCertDB(), const_cast<char*>(nickname.get()), 
-           certUsageEmailRecipient, PR_TRUE, ctx);
+           certUsageEmailRecipient, true, ctx);
 
   if (!cert) { 
     /* Success, but no value */
     PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsCMSSecureMessage::GetCertByPrefID - can't find user cert\n"));
     goto done;
   } 
 
   /* Convert the DER to a BASE64 String */
@@ -215,17 +215,17 @@ SendMessage(const char *msg, const char 
     PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsCMSSecureMessage::SendMessage - can't create envelope data\n"));
     rv = NS_ERROR_FAILURE;
     goto done;
   }
 
   cinfo = NSS_CMSEnvelopedData_GetContentInfo(env);
   item.data = (unsigned char *)msg;
   item.len = strlen(msg);  /* XPCOM equiv?? */
-  s = NSS_CMSContentInfo_SetContent_Data(cmsMsg, cinfo, 0, PR_FALSE);
+  s = NSS_CMSContentInfo_SetContent_Data(cmsMsg, cinfo, 0, false);
   if (s != SECSuccess) {
     PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsCMSSecureMessage::SendMessage - can't set content data\n"));
     rv = NS_ERROR_FAILURE;
     goto done;
   }
 
   rcpt = NSS_CMSRecipientInfo_Create(cmsMsg, cert);
   if (!rcpt) {
@@ -278,17 +278,17 @@ SendMessage(const char *msg, const char 
 
   /* Step 7. Base64 encode and return the result */
   rv = encode(output.data, output.len, _retval);
 
 done:
   if (certDER) nsCRT::free((char *)certDER);
   if (cert) CERT_DestroyCertificate(cert);
   if (cmsMsg) NSS_CMSMessage_Destroy(cmsMsg);
-  if (arena) PORT_FreeArena(arena, PR_FALSE);  /* PR_FALSE? */
+  if (arena) PORT_FreeArena(arena, false);  /* false? */
 
   return rv;
 }
 
 /*
  * nsCMSSecureMessage::ReceiveMessage
  */
 nsresult nsCMSSecureMessage::