fix: serialize delegations and repair verification

This commit is contained in:
bryanpedini committed 2026-11-19 15:46:12 +01:00
1 parent 99fa5de747
commit 5f17aab6ca
8 files changed
+99 -43

No files matched your search

+13 -13
View File
@@ -172,18 +172,18 @@ func TestPasswordRules(t *testing.T) {
}
}
cases := map[string]string{
strings.Repeat("a", 11): "password must be 12 to 256 bytes",
strings.Repeat("a", 257): "password must be 12 to 256 bytes",
"long-enough-\xff-password": "password must be valid UTF-8",
"long-enough-\tpassword": "password must not contain control characters",
"long-enough-\x00password": "password must not contain control characters",
"long-enough-\u0085password": "password must not contain control characters",
strings.Repeat("ä", 6): "",
strings.Repeat("ä", 129): "password must be 12 to 256 bytes",
"long-enough-password\n": "password must not contain control characters",
"long-enough-password\u007f": "password must not contain control characters",
"shortä": "password must be 12 to 256 bytes",
"​zero-width-is-printable-ok": "",
strings.Repeat("a", 11): "password must be 12 to 256 bytes",
strings.Repeat("a", 257): "password must be 12 to 256 bytes",
"long-enough-\xff-password": "password must be valid UTF-8",
"long-enough-\tpassword": "password must not contain control characters",
"long-enough-\x00password": "password must not contain control characters",
"long-enough-\u0085password": "password must not contain control characters",
strings.Repeat("ä", 6): "",
strings.Repeat("ä", 129): "password must be 12 to 256 bytes",
"long-enough-password\n": "password must not contain control characters",
"long-enough-password\u007f": "password must not contain control characters",
"shortä": "password must be 12 to 256 bytes",
"\u200bzero-width-is-printable-ok": "",
}
for p, want := range cases {
err := checkPasswordRules(p)
@@ -300,7 +300,7 @@ func TestPrintableText(t *testing.T) {
{"a\x00b\nc\td", 64, "a b c d"},
{"bad\xffbyte", 64, "bad byte"},
{"keep�replacement", 64, "keep�replacement"},
{"‮evil", 64, " evil"},
{"\u202eevil", 64, " evil"},
{strings.Repeat("é", 70), 64, strings.Repeat("é", 64)},
{"abc", 0, ""},
{"abc", -1, "abc"},