| 1 |
From: Reinhard Tartler <[email protected]> |
| 2 |
Date: Fri, 25 Sep 2026 06:28:39 -0400 |
| 3 |
Subject: Escape double quotes in test DN to comply with RFC 4514 |
| 4 |
|
| 5 |
In go-ldap >= 3.4.14, unescaped double quotes in DN strings are strictly |
| 6 |
rejected per RFC 4514 Section 2.4. In the Go string literal for validDN3, |
| 7 |
`\"` produced an unescaped literal `"` in the DN string rather than an escaped |
| 8 |
quotation mark `\"`, causing parsing to fail with `got unescaped character: '"'`. |
| 9 |
|
| 10 |
Escaping the double quotes properly as `\\\"` ensures validDN3 represents a |
| 11 |
valid RFC 4514 DN. |
| 12 |
|
| 13 |
Bug-Debian: https://bugs.debian.org/1148141 |
| 14 |
Forwarded: https://github.com/notaryproject/notation-go/pull/586 |
| 15 |
Last-Update: 2026-09-25 |
| 16 |
--- |
| 17 |
verifier/trustpolicy/trustpolicy_test.go | 2 +- |
| 18 |
1 file changed, 1 insertion(+), 1 deletion(-) |
| 19 |
|
| 20 |
diff --git a/verifier/trustpolicy/trustpolicy_test.go b/verifier/trustpolicy/trustpolicy_test.go |
| 21 |
index 07cf845..fcd99aa 100644 |
| 22 |
--- a/verifier/trustpolicy/trustpolicy_test.go |
| 23 |
+++ b/verifier/trustpolicy/trustpolicy_test.go |
| 24 |
@@ -185,7 +185,7 @@ func TestValidateTrustedIdentities(t *testing.T) { |
| 25 |
// Validate rfc4514 DNs |
| 26 |
validDN1 := "x509.subject:C=US,ST=WA,O=MyOrg" |
| 27 |
validDN2 := "x509.subject:C=US,ST=WA,O= My. Org" |
| 28 |
- validDN3 := "x509.subject:C=US,ST=WA,O=My \"special\" Org \\, \\; \\\\ others" |
| 29 |
+ validDN3 := "x509.subject:C=US,ST=WA,O=My \\\"special\\\" Org \\, \\; \\\\ others" |
| 30 |
err = validateTrustedIdentities("test-statement-name", []string{validDN1, validDN2, validDN3}) |
| 31 |
if err != nil { |
| 32 |
t.Fatalf("valid x509.subject identity should not return error. Error : %q", err) |