Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Side by Side Diff: net/cert/x509_util_nss_unittest.cc

Issue 13006020: net: extract net/cert out of net/base (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/cert/x509_util_nss.cc ('k') | net/cert/x509_util_openssl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « net/cert/x509_util_nss.cc ('k') | net/cert/x509_util_openssl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698