aboutsummaryrefslogtreecommitdiffstats
path: root/tests/starttls
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2020-12-09 14:57:11 +0100
committerGuilhem Moulin <guilhem@fripost.org>2020-12-09 14:57:11 +0100
commitb13c9fa6f442f555af65f869b954935dae40fcc4 (patch)
tree18134835502271153c51fa7d0fb60e1c454016e7 /tests/starttls
parent1630f2387c52a0ac460922eda6535165fdb279d1 (diff)
test suite: use a RSA certificate rather than ECDSA.
It's arguably the most common use-case. Generated with $ openssl genpkey -algorithm RSA -out tests/snippets/dovecot/dovecot.rsa.key $ openssl req -x509 -days 3650 -subj "/CN=InterIMAP test suite" \ -key tests/snippets/dovecot/dovecot.rsa.key \ -out tests/snippets/dovecot/dovecot.rsa.crt
Diffstat (limited to 'tests/starttls')
-rw-r--r--tests/starttls/t6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/starttls/t b/tests/starttls/t
index 99a39c2..5f9bd4f 100644
--- a/tests/starttls/t
+++ b/tests/starttls/t
@@ -1,3 +1,7 @@
+X509_SHA256="$(doveconf -c "$HOME_remote/.dovecot/config" -hx ssl_cert \
+ | openssl x509 -noout -fingerprint -sha256 \
+ | sed -rn "/^.*=\\s*/ {s///p;q}" | tr -d : | tr "[A-Z]" "[a-z]")"
+
for ((i = 0; i < 32; i++)); do
u="$(shuf -n1 -e "local" "remote")"
sample_message | deliver -u "$u"
@@ -18,7 +22,7 @@ grep -Fx "remote: C: 000000 STARTTLS" <"$STDERR" || error
grep -Fx "remote: C: 000001 CAPABILITY" <"$STDERR" || error
grep -Fx "remote: Disabling SSL protocols: SSLv3, TLSv1, TLSv1.1" <"$STDERR" || error
-grep -Fx "remote: Peer certificate fingerprint: sha256\$35944e3bd3300d3ac310bb497a32cc1eef6931482a587ddbc95343740cdf1323" <"$STDERR" || error
+grep -Fx "remote: Peer certificate fingerprint: sha256\$$X509_SHA256" <"$STDERR" || error
grep "^remote: SSL protocol: TLSv1\.[23] " <"$STDERR" || error
grep "^remote: SSL cipher: " <"$STDERR" || error