| 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_certificate.h" | 5 #include "net/cert/x509_certificate.h" |
| 6 | 6 |
| 7 #include <cert.h> | 7 #include <cert.h> |
| 8 #include <cryptohi.h> | 8 #include <cryptohi.h> |
| 9 #include <keyhi.h> | 9 #include <keyhi.h> |
| 10 #include <nss.h> | 10 #include <nss.h> |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 | 166 |
| 167 // static | 167 // static |
| 168 X509Certificate::OSCertHandle | 168 X509Certificate::OSCertHandle |
| 169 X509Certificate::CreateOSCertHandleFromBytesWithNickname( | 169 X509Certificate::CreateOSCertHandleFromBytesWithNickname( |
| 170 const char* data, | 170 const char* data, |
| 171 int length, | 171 int length, |
| 172 const char* nickname) { | 172 const char* nickname) { |
| 173 if (length < 0) | 173 if (length < 0) |
| 174 return NULL; | 174 return NULL; |
| 175 | 175 |
| 176 LOG(ERROR) << "HIIIIIIIIIIIIIIIIIIIIIIIIIII"; |
| 176 crypto::EnsureNSSInit(); | 177 crypto::EnsureNSSInit(); |
| 177 | 178 |
| 178 if (!NSS_IsInitialized()) | 179 if (!NSS_IsInitialized()) |
| 179 return NULL; | 180 return NULL; |
| 180 | 181 |
| 181 SECItem der_cert; | 182 SECItem der_cert; |
| 182 der_cert.data = reinterpret_cast<unsigned char*>(const_cast<char*>(data)); | 183 der_cert.data = reinterpret_cast<unsigned char*>(const_cast<char*>(data)); |
| 183 der_cert.len = length; | 184 der_cert.len = length; |
| 184 der_cert.type = siDERCertBuffer; | 185 der_cert.type = siDERCertBuffer; |
| 185 | 186 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 } | 261 } |
| 261 | 262 |
| 262 // static | 263 // static |
| 263 void X509Certificate::GetPublicKeyInfo(OSCertHandle cert_handle, | 264 void X509Certificate::GetPublicKeyInfo(OSCertHandle cert_handle, |
| 264 size_t* size_bits, | 265 size_t* size_bits, |
| 265 PublicKeyType* type) { | 266 PublicKeyType* type) { |
| 266 x509_util::GetPublicKeyInfo(cert_handle, size_bits, type); | 267 x509_util::GetPublicKeyInfo(cert_handle, size_bits, type); |
| 267 } | 268 } |
| 268 | 269 |
| 269 } // namespace net | 270 } // namespace net |
| OLD | NEW |