OLD | NEW |
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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 : tpm_token_enabled_for_nss_(false), | 377 : tpm_token_enabled_for_nss_(false), |
378 chaps_module_(NULL), | 378 chaps_module_(NULL), |
379 software_slot_(NULL), | 379 software_slot_(NULL), |
380 test_slot_(NULL), | 380 test_slot_(NULL), |
381 tpm_slot_(NULL), | 381 tpm_slot_(NULL), |
382 root_(NULL), | 382 root_(NULL), |
383 chromeos_user_logged_in_(false) { | 383 chromeos_user_logged_in_(false) { |
384 base::TimeTicks start_time = base::TimeTicks::Now(); | 384 base::TimeTicks start_time = base::TimeTicks::Now(); |
385 EnsureNSPRInit(); | 385 EnsureNSPRInit(); |
386 | 386 |
387 // We *must* have NSS >= 3.12.3. See bug 26448. | 387 // We *must* have NSS >= 3.14.3. |
388 COMPILE_ASSERT( | 388 COMPILE_ASSERT( |
389 (NSS_VMAJOR == 3 && NSS_VMINOR == 12 && NSS_VPATCH >= 3) || | 389 (NSS_VMAJOR == 3 && NSS_VMINOR == 14 && NSS_VPATCH >= 3) || |
390 (NSS_VMAJOR == 3 && NSS_VMINOR > 12) || | 390 (NSS_VMAJOR == 3 && NSS_VMINOR > 14) || |
391 (NSS_VMAJOR > 3), | 391 (NSS_VMAJOR > 3), |
392 nss_version_check_failed); | 392 nss_version_check_failed); |
393 // Also check the run-time NSS version. | 393 // Also check the run-time NSS version. |
394 // NSS_VersionCheck is a >= check, not strict equality. | 394 // NSS_VersionCheck is a >= check, not strict equality. |
395 if (!NSS_VersionCheck("3.12.3")) { | 395 if (!NSS_VersionCheck("3.14.3")) { |
396 // It turns out many people have misconfigured NSS setups, where | 396 LOG(FATAL) << "NSS_VersionCheck(\"3.14.3\") failed. NSS >= 3.14.3 is " |
397 // their run-time NSPR doesn't match the one their NSS was compiled | 397 "required. Please upgrade to the latest NSS, and if you " |
398 // against. So rather than aborting, complain loudly. | |
399 LOG(ERROR) << "NSS_VersionCheck(\"3.12.3\") failed. " | |
400 "We depend on NSS >= 3.12.3, and this error is not fatal " | |
401 "only because many people have busted NSS setups (for " | |
402 "example, using the wrong version of NSPR). " | |
403 "Please upgrade to the latest NSS and NSPR, and if you " | |
404 "still get this error, contact your distribution " | 398 "still get this error, contact your distribution " |
405 "maintainer."; | 399 "maintainer."; |
406 } | 400 } |
407 | 401 |
408 SECStatus status = SECFailure; | 402 SECStatus status = SECFailure; |
409 bool nodb_init = force_nodb_init_; | 403 bool nodb_init = force_nodb_init_; |
410 | 404 |
411 #if !defined(USE_NSS) | 405 #if !defined(USE_NSS) |
412 // Use the system certificate store, so initialize NSS without database. | 406 // Use the system certificate store, so initialize NSS without database. |
413 nodb_init = true; | 407 nodb_init = true; |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
768 | 762 |
769 PK11SlotInfo* GetPublicNSSKeySlot() { | 763 PK11SlotInfo* GetPublicNSSKeySlot() { |
770 return g_nss_singleton.Get().GetPublicNSSKeySlot(); | 764 return g_nss_singleton.Get().GetPublicNSSKeySlot(); |
771 } | 765 } |
772 | 766 |
773 PK11SlotInfo* GetPrivateNSSKeySlot() { | 767 PK11SlotInfo* GetPrivateNSSKeySlot() { |
774 return g_nss_singleton.Get().GetPrivateNSSKeySlot(); | 768 return g_nss_singleton.Get().GetPrivateNSSKeySlot(); |
775 } | 769 } |
776 | 770 |
777 } // namespace crypto | 771 } // namespace crypto |
OLD | NEW |