| 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 "net/cert/x509_util.h" | 5 #include "net/cert/x509_util.h" |
| 6 #include "net/cert/x509_util_nss.h" | 6 #include "net/cert/x509_util_nss.h" |
| 7 | 7 |
| 8 #include <cert.h> // Must be included before certdb.h | 8 #include <cert.h> // Must be included before certdb.h |
| 9 #include <certdb.h> | 9 #include <certdb.h> |
| 10 #include <cryptohi.h> | 10 #include <cryptohi.h> |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 } | 475 } |
| 476 | 476 |
| 477 X509Certificate::OSCertHandles CreateOSCertHandlesFromBytes( | 477 X509Certificate::OSCertHandles CreateOSCertHandlesFromBytes( |
| 478 const char* data, | 478 const char* data, |
| 479 int length, | 479 int length, |
| 480 X509Certificate::Format format) { | 480 X509Certificate::Format format) { |
| 481 X509Certificate::OSCertHandles results; | 481 X509Certificate::OSCertHandles results; |
| 482 if (length < 0) | 482 if (length < 0) |
| 483 return results; | 483 return results; |
| 484 | 484 |
| 485 LOG(ERROR) << "HIIIIIIIIIIIIIIIIIIIIIIIIIII"; |
| 485 crypto::EnsureNSSInit(); | 486 crypto::EnsureNSSInit(); |
| 486 | 487 |
| 487 if (!NSS_IsInitialized()) | 488 if (!NSS_IsInitialized()) |
| 488 return results; | 489 return results; |
| 489 | 490 |
| 490 switch (format) { | 491 switch (format) { |
| 491 case X509Certificate::FORMAT_SINGLE_CERTIFICATE: { | 492 case X509Certificate::FORMAT_SINGLE_CERTIFICATE: { |
| 492 X509Certificate::OSCertHandle handle = | 493 X509Certificate::OSCertHandle handle = |
| 493 X509Certificate::CreateOSCertHandleFromBytes(data, length); | 494 X509Certificate::CreateOSCertHandleFromBytes(data, length); |
| 494 if (handle) | 495 if (handle) |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 616 } | 617 } |
| 617 | 618 |
| 618 return new_name; | 619 return new_name; |
| 619 } | 620 } |
| 620 | 621 |
| 621 #endif // defined(USE_NSS) || defined(OS_IOS) | 622 #endif // defined(USE_NSS) || defined(OS_IOS) |
| 622 | 623 |
| 623 } // namespace x509_util | 624 } // namespace x509_util |
| 624 | 625 |
| 625 } // namespace net | 626 } // namespace net |
| OLD | NEW |