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

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

Issue 2918913002: Add path validation error expectations for PKITS tests. (Closed)
Patch Set: Address Matt's comments Created 3 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/parsed_certificate.h" 5 #include "net/cert/internal/parsed_certificate.h"
6 6
7 #include "net/cert/internal/cert_errors.h" 7 #include "net/cert/internal/cert_errors.h"
8 #include "net/cert/internal/parse_certificate.h" 8 #include "net/cert/internal/parse_certificate.h"
9 #include "net/cert/internal/test_helpers.h" 9 #include "net/cert/internal/test_helpers.h"
10 #include "net/der/input.h" 10 #include "net/der/input.h"
(...skipping 26 matching lines...) Expand all
37 }; 37 };
38 std::string test_file_path = GetFilePath(file_name); 38 std::string test_file_path = GetFilePath(file_name);
39 EXPECT_TRUE(ReadTestDataFromPemFile(test_file_path, mappings)); 39 EXPECT_TRUE(ReadTestDataFromPemFile(test_file_path, mappings));
40 40
41 CertErrors errors; 41 CertErrors errors;
42 scoped_refptr<ParsedCertificate> cert = ParsedCertificate::Create( 42 scoped_refptr<ParsedCertificate> cert = ParsedCertificate::Create(
43 bssl::UniquePtr<CRYPTO_BUFFER>(CRYPTO_BUFFER_new( 43 bssl::UniquePtr<CRYPTO_BUFFER>(CRYPTO_BUFFER_new(
44 reinterpret_cast<const uint8_t*>(data.data()), data.size(), nullptr)), 44 reinterpret_cast<const uint8_t*>(data.data()), data.size(), nullptr)),
45 options, &errors); 45 options, &errors);
46 46
47 EXPECT_EQ(expected_errors, errors.ToDebugString()) << "Test file: " 47 VerifyCertErrors(expected_errors, errors, test_file_path);
48 << test_file_path;
49 48
50 // TODO(crbug.com/634443): Every parse failure being tested should emit error 49 // TODO(crbug.com/634443): Every parse failure being tested should emit error
51 // information. 50 // information.
52 // if (!cert) 51 // if (!cert)
53 // EXPECT_FALSE(errors.empty()); 52 // EXPECT_FALSE(errors.empty());
54 53
55 return cert; 54 return cert;
56 } 55 }
57 56
58 der::Input DavidBenOid() { 57 der::Input DavidBenOid() {
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 ASSERT_TRUE(cert->GetExtension(InhibitAnyPolicyOid(), &extension)); 436 ASSERT_TRUE(cert->GetExtension(InhibitAnyPolicyOid(), &extension));
438 437
439 uint8_t skip_count; 438 uint8_t skip_count;
440 ASSERT_TRUE(ParseInhibitAnyPolicy(extension.value, &skip_count)); 439 ASSERT_TRUE(ParseInhibitAnyPolicy(extension.value, &skip_count));
441 EXPECT_EQ(3, skip_count); 440 EXPECT_EQ(3, skip_count);
442 } 441 }
443 442
444 } // namespace 443 } // namespace
445 444
446 } // namespace net 445 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/internal/parse_certificate_unittest.cc ('k') | net/cert/internal/path_builder_pkits_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698