| 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/base/x509_util.h" | 5 #include "net/cert/x509_util.h" |
| 6 #include "net/base/x509_util_nss.h" | 6 #include "net/cert/x509_util_nss.h" |
| 7 | 7 |
| 8 #include <cert.h> | 8 #include <cert.h> |
| 9 #include <secoid.h> | 9 #include <secoid.h> |
| 10 | 10 |
| 11 #include "base/memory/ref_counted.h" |
| 11 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/memory/ref_counted.h" | |
| 13 #include "crypto/ec_private_key.h" | 13 #include "crypto/ec_private_key.h" |
| 14 #include "crypto/scoped_nss_types.h" | 14 #include "crypto/scoped_nss_types.h" |
| 15 #include "crypto/signature_verifier.h" | 15 #include "crypto/signature_verifier.h" |
| 16 #include "net/base/x509_certificate.h" | 16 #include "net/cert/x509_certificate.h" |
| 17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
| 18 | 18 |
| 19 namespace net { | 19 namespace net { |
| 20 | 20 |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 CERTCertificate* CreateNSSCertHandleFromBytes(const char* data, size_t length) { | 23 CERTCertificate* CreateNSSCertHandleFromBytes(const char* data, size_t length) { |
| 24 SECItem der_cert; | 24 SECItem der_cert; |
| 25 der_cert.data = reinterpret_cast<unsigned char*>(const_cast<char*>(data)); | 25 der_cert.data = reinterpret_cast<unsigned char*>(const_cast<char*>(data)); |
| 26 der_cert.len = length; | 26 der_cert.len = length; |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 | 162 |
| 163 #if !defined(OS_WIN) && !defined(OS_MACOSX) | 163 #if !defined(OS_WIN) && !defined(OS_MACOSX) |
| 164 // signature_verifier_win and signature_verifier_mac can't handle EC certs. | 164 // signature_verifier_win and signature_verifier_mac can't handle EC certs. |
| 165 std::vector<uint8> spki; | 165 std::vector<uint8> spki; |
| 166 ASSERT_TRUE(private_key->ExportPublicKey(&spki)); | 166 ASSERT_TRUE(private_key->ExportPublicKey(&spki)); |
| 167 VerifyCertificateSignature(der_cert, spki); | 167 VerifyCertificateSignature(der_cert, spki); |
| 168 #endif | 168 #endif |
| 169 } | 169 } |
| 170 | 170 |
| 171 } // namespace net | 171 } // namespace net |
| OLD | NEW |