mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-23 15:37:01 +00:00
dkim: Implement internal dkim signing and verification
This patch implements internal DKIM signing and verification.
This commit is contained in:
@@ -93,3 +93,8 @@ func ToCRLF(in []byte) []byte {
|
||||
}
|
||||
return b.Bytes()
|
||||
}
|
||||
|
||||
// StringToCRLF is like ToCRLF, but operates on strings.
|
||||
func StringToCRLF(in string) string {
|
||||
return string(ToCRLF([]byte(in)))
|
||||
}
|
||||
|
||||
@@ -142,6 +142,11 @@ func TestToCRLF(t *testing.T) {
|
||||
if got != c.out {
|
||||
t.Errorf("ToCRLF(%q) = %q, expected %q", c.in, got, c.out)
|
||||
}
|
||||
|
||||
got = StringToCRLF(c.in)
|
||||
if got != c.out {
|
||||
t.Errorf("StringToCRLF(%q) = %q, expected %q", c.in, got, c.out)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user