mirror of
https://github.com/mjl-/mox.git
synced 2024-12-28 01:13:47 +03:00
26 lines
457 B
Go
26 lines
457 B
Go
|
package dkim
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func FuzzParseSignature(f *testing.F) {
|
||
|
f.Add([]byte(""))
|
||
|
f.Fuzz(func(t *testing.T, buf []byte) {
|
||
|
parseSignature(buf, false)
|
||
|
})
|
||
|
}
|
||
|
|
||
|
func FuzzParseRecord(f *testing.F) {
|
||
|
f.Add("")
|
||
|
f.Add("v=DKIM1; p=bad")
|
||
|
f.Fuzz(func(t *testing.T, s string) {
|
||
|
r, _, err := ParseRecord(s)
|
||
|
if err == nil {
|
||
|
if _, err := r.Record(); err != nil {
|
||
|
t.Errorf("r.Record() for parsed record %s, %#v: %s", s, r, err)
|
||
|
}
|
||
|
}
|
||
|
})
|
||
|
}
|