@@ -45,6 +45,17 @@ func TestSuccessfulDNParsing(t *testing.T) {
4545 {[]* AttributeTypeAndValue {
4646 {" A " , " 1 " },
4747 {" B " , " 2 " }}}}},
48+
49+ `cn=john.doe;dc=example,dc=net` : {[]* RelativeDN {
50+ {[]* AttributeTypeAndValue {{"cn" , "john.doe" }}},
51+ {[]* AttributeTypeAndValue {{"dc" , "example" }}},
52+ {[]* AttributeTypeAndValue {{"dc" , "net" }}}}},
53+
54+ // Escaped `;` should not be treated as RDN
55+ `cn=john.doe\;weird name,dc=example,dc=net` : {[]* RelativeDN {
56+ {[]* AttributeTypeAndValue {{"cn" , "john.doe;weird name" }}},
57+ {[]* AttributeTypeAndValue {{"dc" , "example" }}},
58+ {[]* AttributeTypeAndValue {{"dc" , "net" }}}}},
4859 }
4960
5061 for test , answer := range testcases {
@@ -147,6 +158,8 @@ func TestDNEqual(t *testing.T) {
147158 "cn=John Doe, ou=People, dc=sun.com" ,
148159 false ,
149160 },
161+ // Test parsing of `;` for separating RDNs
162+ {"cn=john;dc=example,dc=com" , "cn=john,dc=example,dc=com" , true }, // missing values matter
150163 }
151164
152165 for i , tc := range testcases {
0 commit comments