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

Side by Side Diff: net/cert/internal/cert_issuer_source_aia_unittest.cc

Issue 2079273004: Allow Cast certificates to have serial numbers greater than 20 bytes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove allowance of invalid serial numbers for cast roots Created 4 years, 6 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/internal/cert_issuer_source_aia.h" 5 #include "net/cert/internal/cert_issuer_source_aia.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "net/cert/cert_net_fetcher.h" 8 #include "net/cert/cert_net_fetcher.h"
9 #include "net/cert/internal/parsed_certificate.h" 9 #include "net/cert/internal/parsed_certificate.h"
10 #include "net/cert/internal/test_helpers.h" 10 #include "net/cert/internal/test_helpers.h"
(...skipping 20 matching lines...) Expand all
31 31
32 ::testing::AssertionResult ReadTestCert( 32 ::testing::AssertionResult ReadTestCert(
33 const std::string& file_name, 33 const std::string& file_name,
34 scoped_refptr<ParsedCertificate>* result) { 34 scoped_refptr<ParsedCertificate>* result) {
35 std::string der; 35 std::string der;
36 ::testing::AssertionResult r = 36 ::testing::AssertionResult r =
37 ReadTestPem("net/data/cert_issuer_source_aia_unittest/" + file_name, 37 ReadTestPem("net/data/cert_issuer_source_aia_unittest/" + file_name,
38 "CERTIFICATE", &der); 38 "CERTIFICATE", &der);
39 if (!r) 39 if (!r)
40 return r; 40 return r;
41 *result = ParsedCertificate::CreateFromCertificateCopy(der); 41 *result = ParsedCertificate::CreateFromCertificateCopy(der, {});
42 if (!*result) 42 if (!*result)
43 return ::testing::AssertionFailure() << "CreateFromCertificateCopy failed"; 43 return ::testing::AssertionFailure() << "CreateFromCertificateCopy failed";
44 return ::testing::AssertionSuccess(); 44 return ::testing::AssertionSuccess();
45 } 45 }
46 46
47 std::vector<uint8_t> CertDataVector(const ParsedCertificate* cert) { 47 std::vector<uint8_t> CertDataVector(const ParsedCertificate* cert) {
48 std::vector<uint8_t> data( 48 std::vector<uint8_t> data(
49 cert->der_cert().UnsafeData(), 49 cert->der_cert().UnsafeData(),
50 cert->der_cert().UnsafeData() + cert->der_cert().Length()); 50 cert->der_cert().UnsafeData() + cert->der_cert().Length());
51 return data; 51 return data;
(...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after
911 EXPECT_TRUE(req_manager5->is_request_alive()); 911 EXPECT_TRUE(req_manager5->is_request_alive());
912 912
913 // Sixth URL should not have created a request. 913 // Sixth URL should not have created a request.
914 EXPECT_FALSE( 914 EXPECT_FALSE(
915 mock_fetcher.GetRequestManagerForURL(GURL("http://url-for-aia6/I6.foo"))); 915 mock_fetcher.GetRequestManagerForURL(GURL("http://url-for-aia6/I6.foo")));
916 } 916 }
917 917
918 } // namespace 918 } // namespace
919 919
920 } // namespace net 920 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/internal/cert_issuer_source_aia.cc ('k') | net/cert/internal/cert_issuer_source_static_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698