Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: crypto/nss_util.cc

Issue 723343002: Update from https://crrev.com/304121 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « crypto/ec_signature_creator_openssl.cc ('k') | crypto/rsa_private_key_nss.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "crypto/nss_util.h" 5 #include "crypto/nss_util.h"
6 #include "crypto/nss_util_internal.h" 6 #include "crypto/nss_util_internal.h"
7 7
8 #include <nss.h> 8 #include <nss.h>
9 #include <pk11pub.h> 9 #include <pk11pub.h>
10 #include <plarena.h> 10 #include <plarena.h>
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 static void DisableAESNIIfNeeded() { 828 static void DisableAESNIIfNeeded() {
829 if (NSS_VersionCheck("3.15") && !NSS_VersionCheck("3.15.4")) { 829 if (NSS_VersionCheck("3.15") && !NSS_VersionCheck("3.15.4")) {
830 // Some versions of NSS have a bug that causes AVX instructions to be 830 // Some versions of NSS have a bug that causes AVX instructions to be
831 // used without testing whether XSAVE is enabled by the operating system. 831 // used without testing whether XSAVE is enabled by the operating system.
832 // In order to work around this, we disable AES-NI in NSS when we find 832 // In order to work around this, we disable AES-NI in NSS when we find
833 // that |has_avx()| is false (which includes the XSAVE test). See 833 // that |has_avx()| is false (which includes the XSAVE test). See
834 // https://bugzilla.mozilla.org/show_bug.cgi?id=940794 834 // https://bugzilla.mozilla.org/show_bug.cgi?id=940794
835 base::CPU cpu; 835 base::CPU cpu;
836 836
837 if (cpu.has_avx_hardware() && !cpu.has_avx()) { 837 if (cpu.has_avx_hardware() && !cpu.has_avx()) {
838 base::Environment::Create()->SetVar("NSS_DISABLE_HW_AES", "1"); 838 scoped_ptr<base::Environment> env(base::Environment::Create());
839 env->SetVar("NSS_DISABLE_HW_AES", "1");
839 } 840 }
840 } 841 }
841 } 842 }
842 843
843 // If this is set to true NSS is forced to be initialized without a DB. 844 // If this is set to true NSS is forced to be initialized without a DB.
844 static bool force_nodb_init_; 845 static bool force_nodb_init_;
845 846
846 bool tpm_token_enabled_for_nss_; 847 bool tpm_token_enabled_for_nss_;
847 bool initializing_tpm_token_; 848 bool initializing_tpm_token_;
848 typedef std::vector<base::Closure> TPMReadyCallbackList; 849 typedef std::vector<base::Closure> TPMReadyCallbackList;
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
1095 return time.ToInternalValue() - base::Time::UnixEpoch().ToInternalValue(); 1096 return time.ToInternalValue() - base::Time::UnixEpoch().ToInternalValue();
1096 } 1097 }
1097 1098
1098 #if !defined(OS_CHROMEOS) 1099 #if !defined(OS_CHROMEOS)
1099 PK11SlotInfo* GetPersistentNSSKeySlot() { 1100 PK11SlotInfo* GetPersistentNSSKeySlot() {
1100 return g_nss_singleton.Get().GetPersistentNSSKeySlot(); 1101 return g_nss_singleton.Get().GetPersistentNSSKeySlot();
1101 } 1102 }
1102 #endif 1103 #endif
1103 1104
1104 } // namespace crypto 1105 } // namespace crypto
OLDNEW
« no previous file with comments | « crypto/ec_signature_creator_openssl.cc ('k') | crypto/rsa_private_key_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698