| OLD | NEW |
| 1 // Copyright (c) 2008-2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2008-2010 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 "base/nss_util.h" | 5 #include "base/nss_util.h" |
| 6 | 6 |
| 7 #include <nss.h> | 7 #include <nss.h> |
| 8 #include <plarena.h> | 8 #include <plarena.h> |
| 9 #include <prerror.h> | 9 #include <prerror.h> |
| 10 #include <prinit.h> | 10 #include <prinit.h> |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 base::EnsureNSPRInit(); | 82 base::EnsureNSPRInit(); |
| 83 | 83 |
| 84 // We *must* have NSS >= 3.12.3. See bug 26448. | 84 // We *must* have NSS >= 3.12.3. See bug 26448. |
| 85 COMPILE_ASSERT( | 85 COMPILE_ASSERT( |
| 86 (NSS_VMAJOR == 3 && NSS_VMINOR == 12 && NSS_VPATCH >= 3) || | 86 (NSS_VMAJOR == 3 && NSS_VMINOR == 12 && NSS_VPATCH >= 3) || |
| 87 (NSS_VMAJOR == 3 && NSS_VMINOR > 12) || | 87 (NSS_VMAJOR == 3 && NSS_VMINOR > 12) || |
| 88 (NSS_VMAJOR > 3), | 88 (NSS_VMAJOR > 3), |
| 89 nss_version_check_failed); | 89 nss_version_check_failed); |
| 90 // Also check the run-time NSS version. | 90 // Also check the run-time NSS version. |
| 91 // NSS_VersionCheck is a >= check, not strict equality. | 91 // NSS_VersionCheck is a >= check, not strict equality. |
| 92 CHECK(NSS_VersionCheck("3.12.3")) << "We depend on NSS >= 3.12.3"; | 92 CHECK(NSS_VersionCheck("3.12.3")) << "We depend on NSS >= 3.12.3. " |
| 93 "If NSS is up to date, please " |
| 94 "update NSPR to the latest version."; |
| 93 | 95 |
| 94 SECStatus status = SECFailure; | 96 SECStatus status = SECFailure; |
| 95 #if defined(USE_NSS_FOR_SSL_ONLY) | 97 #if defined(USE_NSS_FOR_SSL_ONLY) |
| 96 // Use the system certificate store, so initialize NSS without database. | 98 // Use the system certificate store, so initialize NSS without database. |
| 97 status = NSS_NoDB_Init(NULL); | 99 status = NSS_NoDB_Init(NULL); |
| 98 if (status != SECSuccess) { | 100 if (status != SECSuccess) { |
| 99 LOG(ERROR) << "Error initializing NSS without a persistent " | 101 LOG(ERROR) << "Error initializing NSS without a persistent " |
| 100 "database: NSS error code " << PR_GetError(); | 102 "database: NSS error code " << PR_GetError(); |
| 101 } | 103 } |
| 102 #else | 104 #else |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 exploded.day_of_month = prxtime.tm_mday; | 184 exploded.day_of_month = prxtime.tm_mday; |
| 183 exploded.hour = prxtime.tm_hour; | 185 exploded.hour = prxtime.tm_hour; |
| 184 exploded.minute = prxtime.tm_min; | 186 exploded.minute = prxtime.tm_min; |
| 185 exploded.second = prxtime.tm_sec; | 187 exploded.second = prxtime.tm_sec; |
| 186 exploded.millisecond = prxtime.tm_usec / 1000; | 188 exploded.millisecond = prxtime.tm_usec / 1000; |
| 187 | 189 |
| 188 return Time::FromUTCExploded(exploded); | 190 return Time::FromUTCExploded(exploded); |
| 189 } | 191 } |
| 190 | 192 |
| 191 } // namespace base | 193 } // namespace base |
| OLD | NEW |