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.14.3. | 387 // We *must* have NSS >= 3.12.3. See bug 26448. |
388 COMPILE_ASSERT( | 388 COMPILE_ASSERT( |
389 (NSS_VMAJOR == 3 && NSS_VMINOR == 14 && NSS_VPATCH >= 3) || | 389 (NSS_VMAJOR == 3 && NSS_VMINOR == 12 && NSS_VPATCH >= 3) || |
390 (NSS_VMAJOR == 3 && NSS_VMINOR > 14) || | 390 (NSS_VMAJOR == 3 && NSS_VMINOR > 12) || |
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.14.3")) { | 395 if (!NSS_VersionCheck("3.12.3")) { |
396 LOG(FATAL) << "NSS_VersionCheck(\"3.14.3\") failed. NSS >= 3.14.3 is " | 396 // It turns out many people have misconfigured NSS setups, where |
397 "required. Please upgrade to the latest NSS, and if you " | 397 // their run-time NSPR doesn't match the one their NSS was compiled |
| 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 " |
398 "still get this error, contact your distribution " | 404 "still get this error, contact your distribution " |
399 "maintainer."; | 405 "maintainer."; |
400 } | 406 } |
401 | 407 |
402 SECStatus status = SECFailure; | 408 SECStatus status = SECFailure; |
403 bool nodb_init = force_nodb_init_; | 409 bool nodb_init = force_nodb_init_; |
404 | 410 |
405 #if !defined(USE_NSS) | 411 #if !defined(USE_NSS) |
406 // Use the system certificate store, so initialize NSS without database. | 412 // Use the system certificate store, so initialize NSS without database. |
407 nodb_init = true; | 413 nodb_init = true; |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
762 | 768 |
763 PK11SlotInfo* GetPublicNSSKeySlot() { | 769 PK11SlotInfo* GetPublicNSSKeySlot() { |
764 return g_nss_singleton.Get().GetPublicNSSKeySlot(); | 770 return g_nss_singleton.Get().GetPublicNSSKeySlot(); |
765 } | 771 } |
766 | 772 |
767 PK11SlotInfo* GetPrivateNSSKeySlot() { | 773 PK11SlotInfo* GetPrivateNSSKeySlot() { |
768 return g_nss_singleton.Get().GetPrivateNSSKeySlot(); | 774 return g_nss_singleton.Get().GetPrivateNSSKeySlot(); |
769 } | 775 } |
770 | 776 |
771 } // namespace crypto | 777 } // namespace crypto |
OLD | NEW |