@@ -45,6 +45,17 @@ func TestSuccessfulDNParsing(t *testing.T) {
45
45
{[]* AttributeTypeAndValue {
46
46
{" A " , " 1 " },
47
47
{" 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" }}}}},
48
59
}
49
60
50
61
for test , answer := range testcases {
@@ -147,6 +158,8 @@ func TestDNEqual(t *testing.T) {
147
158
"cn=John Doe, ou=People, dc=sun.com" ,
148
159
false ,
149
160
},
161
+ // Test parsing of `;` for separating RDNs
162
+ {"cn=john;dc=example,dc=com" , "cn=john,dc=example,dc=com" , true }, // missing values matter
150
163
}
151
164
152
165
for i , tc := range testcases {
0 commit comments