From 2a27d0e4e61c2eecbb9557e8ad5d0a55077ee4ff Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Sat, 28 Jan 2017 14:21:19 +0000 Subject: [PATCH] Testsuite: testcase for DKIM bug 2029 --- test/confs/4506 | 1 + test/confs/{4503 => 4520} | 2 +- test/confs/{4509 => 4521} | 0 test/confs/{4510 => 4522} | 0 test/log/4506 | 9 +++ test/log/{4503 => 4520} | 0 test/log/{4509 => 4521} | 0 test/log/{4510 => 4522} | 0 test/scripts/4500-DKIM/4506 | 105 ++++++++++++++++++++++++++ test/scripts/4500-DKIM/{4503 => 4520} | 0 test/scripts/4500-DKIM/{4509 => 4521} | 2 +- test/scripts/4500-DKIM/{4510 => 4522} | 2 +- test/src/client.c | 2 +- test/stderr/{4503 => 4520} | 0 test/stderr/{4509 => 4521} | 0 test/stderr/{4510 => 4522} | 0 test/stdout/{4510 => 4522} | 0 17 files changed, 119 insertions(+), 4 deletions(-) create mode 120000 test/confs/4506 rename test/confs/{4503 => 4520} (96%) rename test/confs/{4509 => 4521} (100%) rename test/confs/{4510 => 4522} (100%) create mode 100644 test/log/4506 rename test/log/{4503 => 4520} (100%) rename test/log/{4509 => 4521} (100%) rename test/log/{4510 => 4522} (100%) create mode 100644 test/scripts/4500-DKIM/4506 rename test/scripts/4500-DKIM/{4503 => 4520} (100%) rename test/scripts/4500-DKIM/{4509 => 4521} (99%) rename test/scripts/4500-DKIM/{4510 => 4522} (98%) rename test/stderr/{4503 => 4520} (100%) rename test/stderr/{4509 => 4521} (100%) rename test/stderr/{4510 => 4522} (100%) rename test/stdout/{4510 => 4522} (100%) diff --git a/test/confs/4506 b/test/confs/4506 new file mode 120000 index 000000000..c4f73bacd --- /dev/null +++ b/test/confs/4506 @@ -0,0 +1 @@ +4500 \ No newline at end of file diff --git a/test/confs/4503 b/test/confs/4520 similarity index 96% rename from test/confs/4503 rename to test/confs/4520 index cbd82d8f5..70454c33c 100644 --- a/test/confs/4503 +++ b/test/confs/4520 @@ -1,4 +1,4 @@ -# Exim test configuration 4503 +# Exim test configuration 4520 SERVER= OPT= diff --git a/test/confs/4509 b/test/confs/4521 similarity index 100% rename from test/confs/4509 rename to test/confs/4521 diff --git a/test/confs/4510 b/test/confs/4522 similarity index 100% rename from test/confs/4510 rename to test/confs/4522 diff --git a/test/log/4506 b/test/log/4506 new file mode 100644 index 000000000..d50bbe1f4 --- /dev/null +++ b/test/log/4506 @@ -0,0 +1,9 @@ + +******** SERVER ******** +1999-03-02 09:44:33 exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port 1225 +1999-03-02 09:44:33 10HmaX-0005vi-00 DKIM: d=test.ex s=sel c=simple/simple a=rsa-sha1 b=0 [invalid - signature tag missing or invalid] +1999-03-02 09:44:33 10HmaX-0005vi-00 signer: test.ex bits: 0 +1999-03-02 09:44:33 10HmaX-0005vi-00 <= CALLER@bloggs.com H=(xxx) [127.0.0.1] P=smtp S=sss id=qwerty1234@disco-zombie.net +1999-03-02 09:44:33 10HmaY-0005vi-00 DKIM: d=test.ex s=sel c=simple/simple a=rsa-sha1 b=1024 [verification failed - body hash mismatch (body probably modified in transit)] +1999-03-02 09:44:33 10HmaY-0005vi-00 signer: test.ex bits: 1024 +1999-03-02 09:44:33 10HmaY-0005vi-00 <= CALLER@bloggs.com H=(xxx) [127.0.0.1] P=smtp S=sss id=qwerty1234@disco-zombie.net diff --git a/test/log/4503 b/test/log/4520 similarity index 100% rename from test/log/4503 rename to test/log/4520 diff --git a/test/log/4509 b/test/log/4521 similarity index 100% rename from test/log/4509 rename to test/log/4521 diff --git a/test/log/4510 b/test/log/4522 similarity index 100% rename from test/log/4510 rename to test/log/4522 diff --git a/test/scripts/4500-DKIM/4506 b/test/scripts/4500-DKIM/4506 new file mode 100644 index 000000000..b2d53e8fc --- /dev/null +++ b/test/scripts/4500-DKIM/4506 @@ -0,0 +1,105 @@ +# DKIM verify, errors +# +exim -d-all+acl -DSERVER=server -bd -oX PORT_D +**** +# +# This should fail verify (missing header hash in sig header) +# - sha1, 1024b +# Mail original in aux-fixed/4500.msg1.txt +# Sig generated by: perl aux-fixed/dkim/sign.pl --method=simple/simple < aux-fixed/4500.msg1.txt +client 127.0.0.1 PORT_D +??? 220 +HELO xxx +??? 250 +MAIL FROM: +??? 250 +RCPT TO: +??? 250 +DATA +??? 354 +DKIM-Signature: v=1; a=rsa-sha1; c=simple/simple; d=test.ex; h=from:to + :date:message-id:subject; s=sel; bh=OB9dZVu7+5/ufs3TH9leIcEpXSo=; +From: mrgus@text.ex +To: bakawolf@yahoo.com +Date: Thu, 19 Nov 2015 17:00:07 -0700 +Message-ID: +Subject: simple test + +This is a simple test. +. +??? 250 +QUIT +??? 221 +**** +# +# +# This should fail verify (missing body hash in sig header) +# - sha1, 1024b +# Mail original in aux-fixed/4500.msg1.txt +# Sig generated by: perl aux-fixed/dkim/sign.pl --method=simple/simple < aux-fixed/4500.msg1.txt +client 127.0.0.1 PORT_D +??? 220 +HELO xxx +??? 250 +MAIL FROM: +??? 250 +RCPT TO: +??? 250 +DATA +??? 354 +DKIM-Signature: v=1; a=rsa-sha1; c=simple/simple; d=test.ex; h=from:to + :date:message-id:subject; s=sel; b= + PeUA8iBGfStWv+9/BBKkvCEYj/AVMl4e9k+AqWOXKyuEUfHxqAnV+sPnOejpmvT8 + 41kuM4u0bICvK371YvB/yO61vtliRhyqU76Y2e55p2uvMADb3UyDhLyzpco4+yBo + 1w0AuIxu0VU4TK8UmOLyCw/1hxrh1DcEInbEMEKJ7kI= +From: mrgus@text.ex +To: bakawolf@yahoo.com +Date: Thu, 19 Nov 2015 17:00:07 -0700 +Message-ID: +Subject: simple test + +This is a simple test. +. +??? 250 +QUIT +??? 221 +**** +# +# +# This should fail verify (missing body) +# - sha1, 1024b +# Mail original in aux-fixed/4500.msg1.txt +# Sig generated by: perl aux-fixed/dkim/sign.pl --method=simple/simple < aux-fixed/4500.msg1.txt +client 127.0.0.1 PORT_D +??? 220 +HELO xxx +??? 250 +MAIL FROM: +??? 250 +RCPT TO: +??? 250 +DATA +??? 354 +DKIM-Signature: v=1; a=rsa-sha1; c=simple/simple; d=test.ex; h=from:to + :date:message-id:subject; s=sel; bh=OB9dZVu7+5/ufs3TH9leIcEpXSo=; b= + PeUA8iBGfStWv+9/BBKkvCEYj/AVMl4e9k+AqWOXKyuEUfHxqAnV+sPnOejpmvT8 + 41kuM4u0bICvK371YvB/yO61vtliRhyqU76Y2e55p2uvMADb3UyDhLyzpco4+yBo + 1w0AuIxu0VU4TK8UmOLyCw/1hxrh1DcEInbEMEKJ7kI= +From: mrgus@text.ex +To: bakawolf@yahoo.com +Date: Thu, 19 Nov 2015 17:00:07 -0700 +Message-ID: +Subject: simple test +. +??? 250 +QUIT +??? 221 +**** +# +# +# +# +# +killdaemon +no_stdout_check +no_msglog_check diff --git a/test/scripts/4500-DKIM/4503 b/test/scripts/4500-DKIM/4520 similarity index 100% rename from test/scripts/4500-DKIM/4503 rename to test/scripts/4500-DKIM/4520 diff --git a/test/scripts/4500-DKIM/4509 b/test/scripts/4500-DKIM/4521 similarity index 99% rename from test/scripts/4500-DKIM/4509 rename to test/scripts/4500-DKIM/4521 index 3447fa10b..7b341521f 100644 --- a/test/scripts/4500-DKIM/4509 +++ b/test/scripts/4500-DKIM/4521 @@ -1,4 +1,4 @@ -# DKIM signing, with CHUNKING +# DKIM signing, with CHUNKING, stdin # exim -bd -DSERVER=server -oX PORT_S **** diff --git a/test/scripts/4500-DKIM/4510 b/test/scripts/4500-DKIM/4522 similarity index 98% rename from test/scripts/4500-DKIM/4510 rename to test/scripts/4500-DKIM/4522 index 938b10e61..e8924b84e 100644 --- a/test/scripts/4500-DKIM/4510 +++ b/test/scripts/4500-DKIM/4522 @@ -1,4 +1,4 @@ -# DKIM signing, with CHUNKING +# DKIM signing, with CHUNKING, smtp/tcp # exim -bd -DSERVER=server -oX PORT_S **** diff --git a/test/src/client.c b/test/src/client.c index c1ac6b7f1..f34cf784c 100644 --- a/test/src/client.c +++ b/test/src/client.c @@ -939,7 +939,7 @@ while (fgets(CS outbuffer, sizeof(outbuffer), stdin) != NULL) } else { - printf("Enexpected EOF read\n"); + printf("Unexpected EOF read\n"); close(sock); exit(80); } diff --git a/test/stderr/4503 b/test/stderr/4520 similarity index 100% rename from test/stderr/4503 rename to test/stderr/4520 diff --git a/test/stderr/4509 b/test/stderr/4521 similarity index 100% rename from test/stderr/4509 rename to test/stderr/4521 diff --git a/test/stderr/4510 b/test/stderr/4522 similarity index 100% rename from test/stderr/4510 rename to test/stderr/4522 diff --git a/test/stdout/4510 b/test/stdout/4522 similarity index 100% rename from test/stdout/4510 rename to test/stdout/4522 -- 2.30.2