This commit is contained in:
2026-07-13 18:01:39 -03:00
parent dab8b09f0c
commit a345e70e5a
33 changed files with 3741 additions and 589 deletions
+17
View File
@@ -50,6 +50,23 @@ func TestManagedServerURLValidation(t *testing.T) {
}
}
func TestRemoteErrorSnippetIsBoundedAndSingleLine(t *testing.T) {
input := make([]byte, 5000)
for i := range input {
input[i] = 'x'
}
copy(input, []byte("first\nsecond\r\tsecret"))
got := remoteErrorSnippet(input)
if len(got) > 4100 {
t.Fatalf("remote error snippet is too long: %d", len(got))
}
for _, r := range got {
if r < 0x20 || r == 0x7f {
t.Fatalf("remote error snippet retained control character %q", r)
}
}
}
func TestMPSignatureRequiresSecretAndValidHMAC(t *testing.T) {
const (
secret = "test-secret-with-enough-entropy"