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

Side by Side Diff: crypto/nss_util.cc

Issue 407713002: clean up code at crypto folder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: revert code around 84line at p224.cc Created 6 years, 5 months 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/mock_apple_keychain.h ('k') | crypto/p224.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 855 matching lines...) Expand 10 before | Expand all | Expand 10 after
866 static PK11SlotInfo* OpenUserDB(const base::FilePath& path, 866 static PK11SlotInfo* OpenUserDB(const base::FilePath& path,
867 const std::string& description) { 867 const std::string& description) {
868 const std::string modspec = 868 const std::string modspec =
869 base::StringPrintf("configDir='sql:%s' tokenDescription='%s'", 869 base::StringPrintf("configDir='sql:%s' tokenDescription='%s'",
870 path.value().c_str(), 870 path.value().c_str(),
871 description.c_str()); 871 description.c_str());
872 PK11SlotInfo* db_slot = SECMOD_OpenUserDB(modspec.c_str()); 872 PK11SlotInfo* db_slot = SECMOD_OpenUserDB(modspec.c_str());
873 if (db_slot) { 873 if (db_slot) {
874 if (PK11_NeedUserInit(db_slot)) 874 if (PK11_NeedUserInit(db_slot))
875 PK11_InitPin(db_slot, NULL, NULL); 875 PK11_InitPin(db_slot, NULL, NULL);
876 } 876 } else {
877 else {
878 LOG(ERROR) << "Error opening persistent database (" << modspec 877 LOG(ERROR) << "Error opening persistent database (" << modspec
879 << "): " << GetNSSErrorMessage(); 878 << "): " << GetNSSErrorMessage();
880 } 879 }
881 return db_slot; 880 return db_slot;
882 } 881 }
883 882
884 static void DisableAESNIIfNeeded() { 883 static void DisableAESNIIfNeeded() {
885 if (NSS_VersionCheck("3.15") && !NSS_VersionCheck("3.15.4")) { 884 if (NSS_VersionCheck("3.15") && !NSS_VersionCheck("3.15.4")) {
886 // Some versions of NSS have a bug that causes AVX instructions to be 885 // Some versions of NSS have a bug that causes AVX instructions to be
887 // used without testing whether XSAVE is enabled by the operating system. 886 // used without testing whether XSAVE is enabled by the operating system.
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
1162 1161
1163 PRTime BaseTimeToPRTime(base::Time time) { 1162 PRTime BaseTimeToPRTime(base::Time time) {
1164 return time.ToInternalValue() - base::Time::UnixEpoch().ToInternalValue(); 1163 return time.ToInternalValue() - base::Time::UnixEpoch().ToInternalValue();
1165 } 1164 }
1166 1165
1167 PK11SlotInfo* GetPersistentNSSKeySlot() { 1166 PK11SlotInfo* GetPersistentNSSKeySlot() {
1168 return g_nss_singleton.Get().GetPersistentNSSKeySlot(); 1167 return g_nss_singleton.Get().GetPersistentNSSKeySlot();
1169 } 1168 }
1170 1169
1171 } // namespace crypto 1170 } // namespace crypto
OLDNEW
« no previous file with comments | « crypto/mock_apple_keychain.h ('k') | crypto/p224.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698