| 6 | // |
| 7 | // https://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 |
| 15 | #include "parse_name.h" |
| 16 |
| 17 | #include <gtest/gtest.h> |
| 18 | #include "test_helpers.h" |
| 19 |
| 20 | BSSL_NAMESPACE_BEGIN |
| 21 |
| 22 | namespace { |
| 23 | // Loads test data from file. The filename is constructed from the parameters: |
| 24 | // |prefix| describes the type of data being tested, e.g. "ascii", |
| 25 | // "unicode_bmp", "unicode_supplementary", and "invalid". |
| 26 | // |value_type| indicates what ASN.1 type is used to encode the data. |
| 27 | // |suffix| indicates any additional modifications, such as caseswapping, |
| 28 | // whitespace adding, etc. |
| 29 | ::testing::AssertionResult LoadTestData(const std::string &prefix, |
| 30 | const std::string &value_type, |
| 31 | const std::string &suffix, |
| 32 | std::string *result) { |
| 33 | std::string path = "testdata/verify_name_match_unittest/names/" + prefix + |
| 34 | "-" + value_type + "-" + suffix + ".pem"; |
| 35 |
| 36 | const PemBlockMapping mappings[] = { |
| 37 | {"NAME", result}, |
| 38 | }; |
| 39 |
| 40 | return ReadTestDataFromPemFile(path, mappings); |
| 41 | } |
| 42 |
| 43 | } // anonymous namespace |
| 44 |
| 45 | TEST(ParseNameTest, IA5SafeStringValue) { |
| 46 | const uint8_t der[] = { |
| 47 | 0x46, 0x6f, 0x6f, 0x20, 0x62, 0x61, 0x72, |
| 48 | }; |
| 49 | X509NameAttribute value(der::Input(), CBS_ASN1_IA5STRING, der::Input(der)); |
| 50 | std::string result_unsafe; |
| 51 | ASSERT_TRUE(value.ValueAsStringUnsafe(&result_unsafe)); |
| 52 | ASSERT_EQ("Foo bar", result_unsafe); |
| 53 | std::string result; |
| 54 | ASSERT_TRUE(value.ValueAsString(&result)); |
| 55 | ASSERT_EQ("Foo bar", result); |
| 56 | } |
| 57 |
| 58 | TEST(ParseNameTest, IA5UnsafeStringValue) { |
| 59 | const uint8_t der[] = { |
| 60 | 0x46, 0x6f, 0xFF, 0x20, 0x62, 0x61, 0x72, |
| 61 | }; |
| 62 | X509NameAttribute value(der::Input(), CBS_ASN1_IA5STRING, der::Input(der)); |
| 63 | std::string result_unsafe; |
| 64 | ASSERT_TRUE(value.ValueAsStringUnsafe(&result_unsafe)); |
| 65 | ASSERT_EQ("Fo\377 bar", result_unsafe); |
| 66 | std::string result; |
| 67 | ASSERT_FALSE(value.ValueAsString(&result)); |
| 68 | } |
| 69 |
| 70 | TEST(ParseNameTest, PrintableSafeStringValue) { |
| 71 | const uint8_t der[] = { |
| 72 | 0x46, 0x6f, 0x6f, 0x20, 0x62, 0x61, 0x72, |
| 73 | }; |
| 74 | X509NameAttribute value(der::Input(), CBS_ASN1_PRINTABLESTRING, |
| 75 | der::Input(der)); |
| 76 | std::string result_unsafe; |
| 77 | ASSERT_TRUE(value.ValueAsStringUnsafe(&result_unsafe)); |
| 78 | ASSERT_EQ("Foo bar", result_unsafe); |
| 79 | std::string result; |
| 80 | ASSERT_TRUE(value.ValueAsString(&result)); |
| 81 | ASSERT_EQ("Foo bar", result); |
| 82 | } |
| 83 |
| 84 | TEST(ParseNameTest, PrintableUnsafeStringValue) { |
| 85 | const uint8_t der[] = { |
| 86 | 0x46, 0x6f, 0x5f, 0x20, 0x62, 0x61, 0x72, |
| 87 | }; |
| 88 | X509NameAttribute value(der::Input(), CBS_ASN1_PRINTABLESTRING, |
| 89 | der::Input(der)); |
| 90 | std::string result_unsafe; |
| 91 | ASSERT_TRUE(value.ValueAsStringUnsafe(&result_unsafe)); |
| 92 | ASSERT_EQ("Fo_ bar", result_unsafe); |
| 93 | std::string result; |
| 94 | ASSERT_FALSE(value.ValueAsString(&result)); |
| 95 | } |
| 96 |
| 97 | TEST(ParseNameTest, PrintableStringUnsafeOptions) { |
| 98 | const uint8_t der[] = { |
| 99 | 0x46, 0x6f, 0x5f, 0x20, 0x62, 0x61, 0x72, |
| 100 | }; |
| 101 | X509NameAttribute value(der::Input(), CBS_ASN1_PRINTABLESTRING, |
| 102 | der::Input(der)); |
| 103 | std::string result; |
| 104 | ASSERT_FALSE(value.ValueAsStringWithUnsafeOptions( |
| 105 | X509NameAttribute::PrintableStringHandling::kDefault, &result)); |
| 106 | ASSERT_TRUE(value.ValueAsStringWithUnsafeOptions( |
| 107 | X509NameAttribute::PrintableStringHandling::kAsUTF8Hack, &result)); |
| 108 | ASSERT_EQ("Fo_ bar", result); |
| 109 | } |
| 110 |
| 111 | TEST(ParseNameTest, TeletexSafeStringValue) { |
| 112 | const uint8_t der[] = { |
| 113 | 0x46, 0x6f, 0x6f, 0x20, 0x62, 0x61, 0x72, |
| 114 | }; |
| 115 | X509NameAttribute value(der::Input(), CBS_ASN1_T61STRING, der::Input(der)); |
| 116 | std::string result_unsafe; |
| 117 | ASSERT_TRUE(value.ValueAsStringUnsafe(&result_unsafe)); |
| 118 | ASSERT_EQ("Foo bar", result_unsafe); |
| 119 | std::string result; |
| 120 | ASSERT_TRUE(value.ValueAsString(&result)); |
| 121 | ASSERT_EQ("Foo bar", result); |
| 122 | } |
| 123 |
| 124 | TEST(ParseNameTest, TeletexLatin1StringValue) { |
| 125 | const uint8_t der[] = { |
| 126 | 0x46, 0x6f, 0xd6, 0x20, 0x62, 0x61, 0x72, |
| 127 | }; |
| 128 | X509NameAttribute value(der::Input(), CBS_ASN1_T61STRING, der::Input(der)); |
| 129 | std::string result_unsafe; |
| 130 | ASSERT_TRUE(value.ValueAsStringUnsafe(&result_unsafe)); |
| 131 | ASSERT_EQ("Fo\xd6 bar", result_unsafe); |
| 132 | std::string result; |
| 133 | ASSERT_TRUE(value.ValueAsString(&result)); |
| 134 | ASSERT_EQ("FoÖ bar", result); |
| 135 | } |
| 136 |
| 137 | TEST(ParseNameTest, ConvertBmpString) { |
| 138 | const uint8_t der[] = { |
| 139 | 0x00, 0x66, 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x62, 0x00, 0x61, 0x00, 0x72, |
| 140 | }; |
| 141 | X509NameAttribute value(der::Input(), CBS_ASN1_BMPSTRING, der::Input(der)); |
| 142 | std::string result_unsafe; |
| 143 | ASSERT_TRUE(value.ValueAsStringUnsafe(&result_unsafe)); |
| 144 | ASSERT_EQ("foobar", result_unsafe); |
| 145 | std::string result; |
| 146 | ASSERT_TRUE(value.ValueAsString(&result)); |
| 147 | ASSERT_EQ("foobar", result); |
| 148 | } |
| 149 |
| 150 | // BmpString must encode characters in pairs of 2 bytes. |
| 151 | TEST(ParseNameTest, ConvertInvalidBmpString) { |
| 152 | const uint8_t der[] = {0x66, 0x6f, 0x6f, 0x62, 0x61, 0x72, 0x72}; |
| 153 | X509NameAttribute value(der::Input(), CBS_ASN1_BMPSTRING, der::Input(der)); |
| 154 | std::string result; |
| 155 | ASSERT_FALSE(value.ValueAsStringUnsafe(&result)); |
| 156 | ASSERT_FALSE(value.ValueAsString(&result)); |
| 157 | } |
| 158 |
| 159 | TEST(ParseNameTest, ConvertUniversalString) { |
| 160 | const uint8_t der[] = {0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, 0x6f, |
| 161 | 0x00, 0x00, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x62, |
| 162 | 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0x72}; |
| 163 | X509NameAttribute value(der::Input(), CBS_ASN1_UNIVERSALSTRING, |
| 164 | der::Input(der)); |
| 165 | std::string result_unsafe; |
| 166 | ASSERT_TRUE(value.ValueAsStringUnsafe(&result_unsafe)); |
| 167 | ASSERT_EQ("foobar", result_unsafe); |
| 168 | std::string result; |
| 169 | ASSERT_TRUE(value.ValueAsString(&result)); |
| 170 | ASSERT_EQ("foobar", result); |
| 171 | } |
| 172 |
| 173 | // UniversalString must encode characters in pairs of 4 bytes. |
| 174 | TEST(ParseNameTest, ConvertInvalidUniversalString) { |
| 175 | const uint8_t der[] = {0x66, 0x6f, 0x6f, 0x62, 0x61, 0x72}; |
| 176 | X509NameAttribute value(der::Input(), CBS_ASN1_UNIVERSALSTRING, |
| 177 | der::Input(der)); |
| 178 | std::string result; |
| 179 | ASSERT_FALSE(value.ValueAsStringUnsafe(&result)); |
| 180 | ASSERT_FALSE(value.ValueAsString(&result)); |
| 181 | } |
| 182 |
| 183 | TEST(ParseNameTest, EmptyName) { |
| 184 | const uint8_t der[] = {0x30, 0x00}; |
| 185 | der::Input rdn(der); |
| 186 | RDNSequence atv; |
| 187 | ASSERT_TRUE(ParseName(rdn, &atv)); |
| 188 | ASSERT_EQ(0u, atv.size()); |
| 189 | } |
| 190 |
| 191 | TEST(ParseNameTest, ValidName) { |
| 192 | const uint8_t der[] = {0x30, 0x3c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, |
| 193 | 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x14, 0x30, |
| 194 | 0x12, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0b, 0x47, |
| 195 | 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x20, 0x49, 0x6e, 0x63, |
| 196 | 0x2e, 0x31, 0x17, 0x30, 0x15, 0x06, 0x03, 0x55, 0x04, |
| 197 | 0x03, 0x13, 0x0e, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, |
| 198 | 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x43, 0x41}; |
| 199 | der::Input rdn(der); |
| 200 | RDNSequence atv; |
| 201 | ASSERT_TRUE(ParseName(rdn, &atv)); |
| 202 | ASSERT_EQ(3u, atv.size()); |
| 203 | ASSERT_EQ(1u, atv[0].size()); |
| 204 | ASSERT_EQ(der::Input(kTypeCountryNameOid), atv[0][0].type); |
| 205 | ASSERT_EQ("US", BytesAsStringView(atv[0][0].value)); |
| 206 | ASSERT_EQ(1u, atv[1].size()); |
| 207 | ASSERT_EQ(der::Input(kTypeOrganizationNameOid), atv[1][0].type); |
| 208 | ASSERT_EQ("Google Inc.", BytesAsStringView(atv[1][0].value)); |
| 209 | ASSERT_EQ(1u, atv[2].size()); |
| 210 | ASSERT_EQ(der::Input(kTypeCommonNameOid), atv[2][0].type); |
| 211 | ASSERT_EQ("Google Test CA", BytesAsStringView(atv[2][0].value)); |
| 212 | } |
| 213 |
| 214 | TEST(ParseNameTest, InvalidNameExtraData) { |
| 215 | std::string invalid; |
| 216 | ASSERT_TRUE( |
| 217 | LoadTestData("invalid", "AttributeTypeAndValue", "extradata", &invalid)); |
| 218 | RDNSequence atv; |
| 219 | ASSERT_FALSE(ParseName(SequenceValueFromString(invalid), &atv)); |
| 220 | } |
| 221 |
| 222 | TEST(ParseNameTest, InvalidNameEmpty) { |
| 223 | std::string invalid; |
| 224 | ASSERT_TRUE( |
| 225 | LoadTestData("invalid", "AttributeTypeAndValue", "empty", &invalid)); |
| 226 | RDNSequence atv; |
| 227 | ASSERT_FALSE(ParseName(SequenceValueFromString(invalid), &atv)); |
| 228 | } |
| 229 |
| 230 | TEST(ParseNameTest, InvalidNameBadType) { |
| 231 | std::string invalid; |
| 232 | ASSERT_TRUE(LoadTestData("invalid", "AttributeTypeAndValue", |
| 233 | "badAttributeType", &invalid)); |
| 234 | RDNSequence atv; |
| 235 | ASSERT_FALSE(ParseName(SequenceValueFromString(invalid), &atv)); |
| 236 | } |
| 237 |
| 238 | TEST(ParseNameTest, InvalidNameNotSequence) { |
| 239 | std::string invalid; |
| 240 | ASSERT_TRUE(LoadTestData("invalid", "AttributeTypeAndValue", "setNotSequence", |
| 241 | &invalid)); |
| 242 | RDNSequence atv; |
| 243 | ASSERT_FALSE(ParseName(SequenceValueFromString(invalid), &atv)); |
| 244 | } |
| 245 |
| 246 | TEST(ParseNameTest, InvalidNameNotSet) { |
| 247 | std::string invalid; |
| 248 | ASSERT_TRUE(LoadTestData("invalid", "RDN", "sequenceInsteadOfSet", &invalid)); |
| 249 | RDNSequence atv; |
| 250 | ASSERT_FALSE(ParseName(SequenceValueFromString(invalid), &atv)); |
| 251 | } |
| 252 |
| 253 | TEST(ParseNameTest, InvalidNameEmptyRdn) { |
| 254 | std::string invalid; |
| 255 | ASSERT_TRUE(LoadTestData("invalid", "RDN", "empty", &invalid)); |
| 256 | RDNSequence atv; |
| 257 | ASSERT_FALSE(ParseName(SequenceValueFromString(invalid), &atv)); |
| 258 | } |
| 259 |
| 260 | TEST(ParseNameTest, RFC2253FormatBasic) { |
| 261 | const uint8_t der[] = {0x30, 0x3b, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, |
| 262 | 0x04, 0x06, 0x13, 0x02, 0x47, 0x42, 0x31, 0x16, 0x30, |
| 263 | 0x14, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0d, 0x49, |
| 264 | 0x73, 0x6f, 0x64, 0x65, 0x20, 0x4c, 0x69, 0x6d, 0x69, |
| 265 | 0x74, 0x65, 0x64, 0x31, 0x14, 0x30, 0x12, 0x06, 0x03, |
| 266 | 0x55, 0x04, 0x03, 0x13, 0x0b, 0x53, 0x74, 0x65, 0x76, |
| 267 | 0x65, 0x20, 0x4b, 0x69, 0x6c, 0x6c, 0x65}; |
| 268 | der::Input rdn_input(der); |
| 269 | RDNSequence rdn; |
| 270 | ASSERT_TRUE(ParseName(rdn_input, &rdn)); |
| 271 | std::string output; |
| 272 | ASSERT_TRUE(ConvertToRFC2253(rdn, &output)); |
| 273 | ASSERT_EQ("CN=Steve Kille,O=Isode Limited,C=GB", output); |
| 274 | } |
| 275 |
| 276 | TEST(ParseNameTest, RFC2253FormatMultiRDN) { |
| 277 | const uint8_t der[] = { |
| 278 | 0x30, 0x44, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, |
| 279 | 0x02, 0x55, 0x53, 0x31, 0x14, 0x30, 0x12, 0x06, 0x03, 0x55, 0x04, 0x0a, |
| 280 | 0x13, 0x0b, 0x57, 0x69, 0x64, 0x67, 0x65, 0x74, 0x20, 0x49, 0x6e, 0x63, |
| 281 | 0x2e, 0x31, 0x1f, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x05, |
| 282 | 0x53, 0x61, 0x6c, 0x65, 0x73, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x03, |
| 283 | 0x13, 0x08, 0x4a, 0x2e, 0x20, 0x53, 0x6d, 0x69, 0x74, 0x68}; |
| 284 | der::Input rdn_input(der); |
| 285 | RDNSequence rdn; |
| 286 | ASSERT_TRUE(ParseName(rdn_input, &rdn)); |
| 287 | std::string output; |
| 288 | ASSERT_TRUE(ConvertToRFC2253(rdn, &output)); |
| 289 | ASSERT_EQ("OU=Sales+CN=J. Smith,O=Widget Inc.,C=US", output); |
| 290 | } |
| 291 |
| 292 | TEST(ParseNameTest, RFC2253FormatQuoted) { |
| 293 | const uint8_t der[] = { |
| 294 | 0x30, 0x40, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, |
| 295 | 0x13, 0x02, 0x47, 0x42, 0x31, 0x1e, 0x30, 0x1c, 0x06, 0x03, 0x55, |
| 296 | 0x04, 0x0a, 0x13, 0x15, 0x53, 0x75, 0x65, 0x2c, 0x20, 0x47, 0x72, |
| 297 | 0x61, 0x62, 0x62, 0x69, 0x74, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x52, |
| 298 | 0x75, 0x6e, 0x6e, 0x31, 0x11, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, |
| 299 | 0x03, 0x13, 0x08, 0x4c, 0x2e, 0x20, 0x45, 0x61, 0x67, 0x6c, 0x65}; |
| 300 | der::Input rdn_input(der); |
| 301 | RDNSequence rdn; |
| 302 | ASSERT_TRUE(ParseName(rdn_input, &rdn)); |
| 303 | std::string output; |
| 304 | ASSERT_TRUE(ConvertToRFC2253(rdn, &output)); |
| 305 | ASSERT_EQ("CN=L. Eagle,O=Sue\\, Grabbit and Runn,C=GB", output); |
| 306 | } |
| 307 |
| 308 | TEST(ParseNameTest, RFC2253FormatNonPrintable) { |
| 309 | const uint8_t der[] = {0x30, 0x33, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, |
| 310 | 0x04, 0x06, 0x13, 0x02, 0x47, 0x42, 0x31, 0x0d, 0x30, |
| 311 | 0x0b, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x04, 0x54, |
| 312 | 0x65, 0x73, 0x74, 0x31, 0x15, 0x30, 0x13, 0x06, 0x03, |
| 313 | 0x55, 0x04, 0x03, 0x13, 0x0c, 0x42, 0x65, 0x66, 0x6f, |
| 314 | 0x72, 0x65, 0x0d, 0x41, 0x66, 0x74, 0x65, 0x72}; |
| 315 | der::Input rdn_input(der); |
| 316 | RDNSequence rdn; |
| 317 | ASSERT_TRUE(ParseName(rdn_input, &rdn)); |
| 318 | std::string output; |
| 319 | ASSERT_TRUE(ConvertToRFC2253(rdn, &output)); |
| 320 | ASSERT_EQ("CN=Before\\0DAfter,O=Test,C=GB", output); |
| 321 | } |
| 322 |
| 323 | TEST(ParseNameTest, RFC2253FormatUnknownOid) { |
| 324 | const uint8_t der[] = {0x30, 0x30, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, |
| 325 | 0x04, 0x06, 0x13, 0x02, 0x47, 0x42, 0x31, 0x0d, 0x30, |
| 326 | 0x0b, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x04, 0x54, |
| 327 | 0x65, 0x73, 0x74, 0x31, 0x12, 0x30, 0x10, 0x06, 0x08, |
| 328 | 0x2b, 0x06, 0x01, 0x04, 0x01, 0x8b, 0x3a, 0x00, 0x13, |
| 329 | 0x04, 0x04, 0x02, 0x48, 0x69}; |
| 330 | der::Input rdn_input(der); |
| 331 | RDNSequence rdn; |
| 332 | ASSERT_TRUE(ParseName(rdn_input, &rdn)); |
| 333 | std::string output; |
| 334 | ASSERT_TRUE(ConvertToRFC2253(rdn, &output)); |
| 335 | ASSERT_EQ("1.3.6.1.4.1.1466.0=#04024869,O=Test,C=GB", output); |
| 336 | } |
| 337 |
| 338 | TEST(ParseNameTest, RFC2253FormatLargeOid) { |
| 339 | const uint8_t der[] = {0x30, 0x16, 0x31, 0x14, 0x30, 0x12, 0x06, 0x0a, |
| 340 | 0x81, 0x0d, 0x06, 0x01, 0x99, 0x21, 0x01, 0x8b, |
| 341 | 0x3a, 0x00, 0x13, 0x04, 0x74, 0x65, 0x73, 0x74}; |
| 342 | der::Input rdn_input(der); |
| 343 | RDNSequence rdn; |
| 344 | ASSERT_TRUE(ParseName(rdn_input, &rdn)); |
| 345 | std::string output; |
| 346 | ASSERT_TRUE(ConvertToRFC2253(rdn, &output)); |
| 347 | ASSERT_EQ("2.61.6.1.3233.1.1466.0=#74657374", output); |
| 348 | } |
| 349 |
| 350 | TEST(ParseNameTest, RFC2253FormatInvalidOid) { |
| 351 | // Same DER as RFC2253FormatLargeOid but with the last byte of the OID |
| 352 | // replaced with 0x80, which ends the OID with a truncated multi-byte |
| 353 | // component. |
| 354 | const uint8_t der[] = {0x30, 0x16, 0x31, 0x14, 0x30, 0x12, 0x06, 0x0a, |
| 355 | 0x81, 0x0d, 0x06, 0x01, 0x99, 0x21, 0x01, 0x8b, |
| 356 | 0x3a, 0x80, 0x13, 0x04, 0x74, 0x65, 0x73, 0x74}; |
| 357 | der::Input rdn_input(der); |
| 358 | RDNSequence rdn; |
| 359 | ASSERT_TRUE(ParseName(rdn_input, &rdn)); |
| 360 | std::string output; |
| 361 | EXPECT_FALSE(ConvertToRFC2253(rdn, &output)); |
| 362 | } |
| 363 |
| 364 | TEST(ParseNameTest, RFC2253FormatUTF8) { |
| 365 | const uint8_t der[] = {0x30, 0x12, 0x31, 0x10, 0x30, 0x0e, 0x06, |
| 366 | 0x03, 0x55, 0x04, 0x04, 0x13, 0x07, 0x4c, |
| 367 | 0x75, 0xc4, 0x8d, 0x69, 0xc4, 0x87}; |
| 368 | der::Input rdn_input(der); |
| 369 | RDNSequence rdn; |
| 370 | ASSERT_TRUE(ParseName(rdn_input, &rdn)); |
| 371 | std::string output; |
| 372 | ASSERT_TRUE(ConvertToRFC2253(rdn, &output)); |
| 373 | ASSERT_EQ("SN=Lu\\C4\\8Di\\C4\\87", output); |
| 374 | } |
| 375 |
| 376 | BSSL_NAMESPACE_END |
| 377 |