Commit c4dd1051 authored by David Benjamin's avatar David Benjamin Committed by Commit Bot

Add a regression test for normalizing custom attributes.

A recent BoringSSL change broke this. Add a regression test for it
before I try to make the change again.

Bug: 789802
Change-Id: Ibe021424fc6b36b2ef71d91b30f523a2cfae1482
Reviewed-on: https://chromium-review.googlesource.com/828381
Commit-Queue: Matt Mueller <mattm@chromium.org>
Reviewed-by: default avatarMatt Mueller <mattm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#524467}
parent b15c4f4e
......@@ -4005,6 +4005,7 @@ bundle_data("net_unittests_bundle_data") {
"data/verify_name_match_unittest/names/ascii-UTF8-unmangled.pem",
"data/verify_name_match_unittest/names/ascii-mixed-rdn_dupetype_sorting_1.pem",
"data/verify_name_match_unittest/names/ascii-mixed-rdn_dupetype_sorting_2.pem",
"data/verify_name_match_unittest/names/custom-custom-normalized.pem",
"data/verify_name_match_unittest/names/invalid-AttributeTypeAndValue-badAttributeType.pem",
"data/verify_name_match_unittest/names/invalid-AttributeTypeAndValue-empty.pem",
"data/verify_name_match_unittest/names/invalid-AttributeTypeAndValue-extradata.pem",
......
......@@ -597,4 +597,16 @@ TEST(NameNormalizationTest, TestEverything) {
EXPECT_EQ(normalized_der, renormalized_der);
}
// Unknown AttributeValue types normalize as-is, even non-primitive tags.
TEST(NameNormalizationTest, NormalizeCustom) {
std::string raw_der;
ASSERT_TRUE(LoadTestData("custom", "custom", "normalized", &raw_der));
std::string normalized_der;
CertErrors errors;
ASSERT_TRUE(NormalizeName(SequenceValueFromString(&raw_der), &normalized_der,
&errors));
EXPECT_EQ(SequenceValueFromString(&raw_der), der::Input(&normalized_der));
}
} // namespace net
0:d=0 hl=2 l= 29 cons: SEQUENCE
2:d=1 hl=2 l= 27 cons: SET
4:d=2 hl=2 l= 25 cons: SEQUENCE
6:d=3 hl=2 l= 12 prim: OBJECT :1.2.840.113554.4.1.72585.1
20:d=3 hl=2 l= 9 cons: cont [ 0 ]
22:d=4 hl=2 l= 7 cons: priv [ 1 ]
24:d=5 hl=2 l= 5 prim: appl [ 2 ]
-----BEGIN NAME-----
MB0xGzAZBgwqhkiG9xIEAYS3CQGgCeEHQgVoZWxsbw==
-----END NAME-----
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment