mirror of
https://github.com/foxcpp/maddy.git
synced 2025-04-05 05:57:39 +03:00
modify/dkim: Check RewriteSender error in tests code
This commit is contained in:
parent
134342a366
commit
c44e79a4be
1 changed files with 5 additions and 2 deletions
|
@ -75,7 +75,11 @@ func signTestMsg(t *testing.T, m *Modifier, envelopeFrom string) (textproto.Head
|
||||||
|
|
||||||
// sign_dkim expects RewriteSender to be called to get envelope sender
|
// sign_dkim expects RewriteSender to be called to get envelope sender
|
||||||
// (see module.Modifier docs)
|
// (see module.Modifier docs)
|
||||||
state.RewriteSender(context.Background(), envelopeFrom)
|
|
||||||
|
// RewriteSender does not fail for modify_dkim. It just sets envelopeFrom.
|
||||||
|
if _, err := state.RewriteSender(context.Background(), envelopeFrom); err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
err = state.RewriteBody(context.Background(), &testHdr, buffer.MemoryBuffer{Slice: body})
|
err = state.RewriteBody(context.Background(), &testHdr, buffer.MemoryBuffer{Slice: body})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
|
@ -164,7 +168,6 @@ func TestGenerateSignVerify(t *testing.T) {
|
||||||
|
|
||||||
testHdr, body := signTestMsg(t, m, envelopeFrom)
|
testHdr, body := signTestMsg(t, m, envelopeFrom)
|
||||||
verifyTestMsg(t, dir, expectDomain, testHdr, body)
|
verifyTestMsg(t, dir, expectDomain, testHdr, body)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, algo := range [2]string{"rsa2048", "ed25519"} {
|
for _, algo := range [2]string{"rsa2048", "ed25519"} {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue