Browse Source

[Test] Add ed25519 tests

tags/1.7.6
Vsevolod Stakhov 6 years ago
parent
commit
15a5ad7fa3

+ 8
- 0
test/functional/cases/130_dkim.robot View File

@@ -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

+ 27
- 22
test/functional/configs/dkim.conf View File

@@ -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 {

+ 14
- 0
test/functional/messages/ed25519-broken.eml View File

@@ -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.

+ 14
- 0
test/functional/messages/ed25519.eml View File

@@ -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.

Loading…
Cancel
Save