diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/cases/131_dkim_signing/003_eddsa.robot | 39 | ||||
-rw-r--r-- | test/functional/configs/dkim-eddsa.key | 1 | ||||
-rw-r--r-- | test/functional/configs/dkim_signing/eddsa.conf | 6 | ||||
-rw-r--r-- | test/functional/configs/plugins.conf | 10 |
4 files changed, 56 insertions, 0 deletions
diff --git a/test/functional/cases/131_dkim_signing/003_eddsa.robot b/test/functional/cases/131_dkim_signing/003_eddsa.robot new file mode 100644 index 000000000..ea2fe03be --- /dev/null +++ b/test/functional/cases/131_dkim_signing/003_eddsa.robot @@ -0,0 +1,39 @@ +*** Settings *** +Suite Setup DKIM Signing Setup +Suite Teardown DKIM Signing Teardown +Library ${TESTDIR}/lib/rspamd.py +Resource ${TESTDIR}/lib/rspamd.robot +Variables ${TESTDIR}/lib/vars.py + +*** Variables *** +${CONFIG} ${TESTDIR}/configs/plugins.conf +${MESSAGE} ${TESTDIR}/messages/dmarc/fail_none.eml +${MESSAGE_FAIL} ${TESTDIR}/messages/dmarc/fail_none1.eml +${REDIS_SCOPE} Suite +${RSPAMD_SCOPE} Suite +${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat + +*** Test Cases *** +TEST SIGNED + ${result} = Scan Message With Rspamc ${MESSAGE} -u bob@cacophony.za.org + Check Rspamc ${result} DKIM-Signature: + Should Contain ${result.stdout} DKIM_SIGNED + +TEST NOT SIGNED - USERNAME WRONG DOMAIN + ${result} = Scan Message With Rspamc ${MESSAGE} -u bob@example.tk + Check Rspamc ${result} DKIM-Signature: inverse=1 + Should Not Contain ${result.stdout} DKIM_SIGNED + +TEST NOT SIGNED - USERNAME WRONG PUBKEY + ${result} = Scan Message With Rspamc ${MESSAGE_FAIL} -u bob@invalid.za.org + Check Rspamc ${result} DKIM-Signature: inverse=1 + Should Not Contain ${result.stdout} DKIM_SIGNED + +*** Keywords *** +DKIM Signing Setup + ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/dkim_signing/eddsa.conf + Set Suite Variable ${PLUGIN_CONFIG} + Generic Setup PLUGIN_CONFIG + +DKIM Signing Teardown + Normal Teardown diff --git a/test/functional/configs/dkim-eddsa.key b/test/functional/configs/dkim-eddsa.key new file mode 100644 index 000000000..45282e12b --- /dev/null +++ b/test/functional/configs/dkim-eddsa.key @@ -0,0 +1 @@ +m5kGxtckRfsNe5EuYTe7bvkDjSh7LXaX3aXyIMPGLR0= diff --git a/test/functional/configs/dkim_signing/eddsa.conf b/test/functional/configs/dkim_signing/eddsa.conf new file mode 100644 index 000000000..1a93c9e0b --- /dev/null +++ b/test/functional/configs/dkim_signing/eddsa.conf @@ -0,0 +1,6 @@ +dkim_signing { + path = "${TESTDIR}/configs/dkim-eddsa.key"; + selector = "eddsa"; + check_pubkey = true; + allow_pubkey_mismatch = false; +} diff --git a/test/functional/configs/plugins.conf b/test/functional/configs/plugins.conf index d7a5b009c..507f00b76 100644 --- a/test/functional/configs/plugins.conf +++ b/test/functional/configs/plugins.conf @@ -18,11 +18,21 @@ options = { replies = ["v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDXtxBE5IiNRMcq2/lc2zErfdCvDFyQNBnMjbOjBQrPST2k4fdGbtpe5Iu5uS01Met+dAEf94XL8I0hwmYw+n70PP834zfJGi2egwGqrakpaWsCDPvIJZLkxJCJKQRA/zrQ622uEXdvYixVbsEGVw7U4wAGSmT5rU2eU1y63AlOlQIDAQAB"]; }, { + name = "eddsa._domainkey.cacophony.za.org", + type = "txt"; + replies = ["v=DKIM1; k=ed25519; p=+nU+aC33ICeS4zx8VUjFYCtxj0fRbHWQn2gP2hTkm9w="]; + }, + { name = "dkim._domainkey.invalid.za.org", type = "txt"; replies = ["v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDEEXmNGQq7PUrr9Mg4UakTFHgXBCy2DOztkrZm+0OrVWtiRzGluxBkbOWTBwuU3/Yw97yTphBMQxzWFN603/f/KPAQcF/Lc1l+6kmIBBxNXjjGuOK/3PYKZVntUdKmqcQBYfnHdzH2Tohbuyx1a7xqnv6VSChqQrZU4CwkeT3+eQIDAQAB"]; }, { + name = "eddsa._domainkey.invalid.za.org", + type = "txt"; + replies = ["v=DKIM1; k=ed25519; p=Wkkrp5DJTvknDMGWYv8vm3p3sZjiQp03LZo80RregY8="]; + }, + { name = "dkim._domainkey.rspamd.com", type = "txt"; replies = ["v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCd/XhZBEGGAss48lEuMmwZv9lOFf6FTllBiQ3sPhdTpDdIPaW9TInW7iYnYD/bXHeVxYAyD/sKhYk6+qGBRu10rEi+iyPvLCIED+Boq0tEQosuKuV6Fjoomb+QhZY9KdjyZTjsrFPZ+wCkUY/30uTmpX2SwSqyxxlK0pUIsRgMAQIDAQAB"]; |