diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-06-11 17:30:05 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-06-11 17:30:05 +0100 |
commit | 15a5ad7fa3b877472b5ee7e14883623763eb2bed (patch) | |
tree | a6960b03f4359e5d08161c45023fe3a6e39c11f2 /test | |
parent | 4ac5ff0349cc5d2c1f2475167f6444fef11cf252 (diff) | |
download | rspamd-15a5ad7fa3b877472b5ee7e14883623763eb2bed.tar.gz rspamd-15a5ad7fa3b877472b5ee7e14883623763eb2bed.zip |
[Test] Add ed25519 tests
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/cases/130_dkim.robot | 8 | ||||
-rw-r--r-- | test/functional/configs/dkim.conf | 49 | ||||
-rw-r--r-- | test/functional/messages/ed25519-broken.eml | 14 | ||||
-rw-r--r-- | test/functional/messages/ed25519.eml | 14 |
4 files changed, 63 insertions, 22 deletions
diff --git a/test/functional/cases/130_dkim.robot b/test/functional/cases/130_dkim.robot index 1bb08e639..ad0b27ac4 100644 --- a/test/functional/cases/130_dkim.robot +++ b/test/functional/cases/130_dkim.robot @@ -22,3 +22,11 @@ DKIM Self Verify Run Keyword If ${RAN_SIGNTEST} == 0 Fail "Sign test was not run" ${result} = Scan Message With Rspamc ${SIGNED_MESSAGE} Check Rspamc ${result} R_DKIM_ALLOW + +DKIM Verify ED25519 PASS + ${result} = Scan Message With Rspamc ${TESTDIR}/messages/ed25519.eml + Check Rspamc ${result} R_DKIM_ALLOW + +DKIM Verify ED25519 REJECT + ${result} = Scan Message With Rspamc ${TESTDIR}/messages/ed25519-broken.eml + Check Rspamc ${result} R_DKIM_REJECT
\ No newline at end of file diff --git a/test/functional/configs/dkim.conf b/test/functional/configs/dkim.conf index b10cff0c4..d3593a12d 100644 --- a/test/functional/configs/dkim.conf +++ b/test/functional/configs/dkim.conf @@ -1,33 +1,38 @@ options = { - filters = ["dkim"] - pidfile = "${TMPDIR}/rspamd.pid" - dns { - retransmits = 10; - timeout = 2s; - } + filters = ["dkim"] + pidfile = "${TMPDIR}/rspamd.pid" + dns { + retransmits = 10; + timeout = 2s; + fake_records = [{ # ed25519 + name = "test._domainkey.example.com"; + type = txt; + replies = ["k=ed25519; p=yi50DjK5O9pqbFpNHklsv9lqaS0ArSYu02qp1S0DW1Y="]; + }]; + } } logging = { - type = "file", - level = "debug" - filename = "${TMPDIR}/rspamd.log" + type = "file", + level = "debug" + filename = "${TMPDIR}/rspamd.log" } metric = { - name = "default", - actions = { - reject = 100500, - } - unknown_weight = 1 + name = "default", + actions = { + reject = 100500, + } + unknown_weight = 1 } worker { - type = normal - bind_socket = ${LOCAL_ADDR}:${PORT_NORMAL} - count = 1 - keypair { - pubkey = "${KEY_PUB1}"; - privkey = "${KEY_PVT1}"; - } - task_timeout = 60s; + type = normal + bind_socket = ${LOCAL_ADDR}:${PORT_NORMAL} + count = 1 + keypair { + pubkey = "${KEY_PUB1}"; + privkey = "${KEY_PVT1}"; + } + task_timeout = 60s; } worker { diff --git a/test/functional/messages/ed25519-broken.eml b/test/functional/messages/ed25519-broken.eml new file mode 100644 index 000000000..187c9191d --- /dev/null +++ b/test/functional/messages/ed25519-broken.eml @@ -0,0 +1,14 @@ +DKIM-Signature: v=1; a=ed25519; c=relaxed/simple; d=example.com; + i=@example.com; q=dns/txt; s=test; t=5; h=message-id : + date : from : to : subject : date : from : subject; + bh=wE7NXSkgnx9PGiavN4OZhJztvkqPDlemV3OGuEnLwNo=; + b=wt7P+9DoBwcln1RKE3LN7069ZEEiSyVE/NH1YXnqnJy4JcrSCZUbeIEh + vXssPHelX4yNSXG9eTGTwwk5NxYqBw== +Received: from localhost +Message-ID: <example@example.com> +Date: Mon, 02 Jan 2011 01:02:03 +0400 +From: Test User <test@example.com> +To: somebody@example.com +Subject: Testing + +This is a test message. diff --git a/test/functional/messages/ed25519.eml b/test/functional/messages/ed25519.eml new file mode 100644 index 000000000..b3dfaaa01 --- /dev/null +++ b/test/functional/messages/ed25519.eml @@ -0,0 +1,14 @@ +DKIM-Signature: v=1; a=ed25519; c=relaxed/simple; d=example.com; + i=@example.com; q=dns/txt; s=test; t=5; h=message-id : + date : from : to : subject : date : from : subject; + bh=wE7NXSkgnx9PGiavN4OZhJztvkqPDlemV3OGuEnLwNo=; + b=wt7P+9DoBwcln1RKE3LN7069ZEEiSyVE/NH1YXnqnJy4JcrSCZUbeIEh + vXssPHelX4yNSXG9eTGTwwk5NxYqBw== +Received: from localhost +Message-ID: <example@example.com> +Date: Mon, 01 Jan 2011 01:02:03 +0400 +From: Test User <test@example.com> +To: somebody@example.com +Subject: Testing + +This is a test message. |