mirror of
https://gitlab.kit.edu/kit/scc/sys/mail/exim-encrypt-dlfunc.git
synced 2025-12-06 07:53:56 +01:00
Changed test output to conform to the TAP protocol (https://testanything.org)
This commit is contained in:
@ -17,7 +17,7 @@ shared_library('exim-encrypt-dlfunc', 'libexim-encrypt-dlfunc.c',
|
|||||||
install: true)
|
install: true)
|
||||||
|
|
||||||
dlfunc_test = find_program('test_libexim-encrypt-dlfunc.sh')
|
dlfunc_test = find_program('test_libexim-encrypt-dlfunc.sh')
|
||||||
test('simple test', dlfunc_test)
|
test('simple test', dlfunc_test, protocol: tap)
|
||||||
|
|
||||||
decrypt_secretbox_test = find_program('test_libexim-encrypt-dlfunc-decrypt-secretbox.sh')
|
decrypt_secretbox_test = find_program('test_libexim-encrypt-dlfunc-decrypt-secretbox.sh')
|
||||||
test('decrypt-secretbox', decrypt_secretbox_test)
|
test('decrypt-secretbox', decrypt_secretbox_test)
|
||||||
@ -1,9 +1,11 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
PATH=/sbin:/usr/sbin:$PATH
|
PATH=/sbin:/usr/sbin:$PATH
|
||||||
|
|
||||||
|
# this script implements the TAP protocol (https://testanything.org)
|
||||||
|
echo 1..2
|
||||||
|
|
||||||
# copy to /tmp to keep call to exim under 256 chars (prevent problems on Ubuntu)
|
# copy to /tmp to keep call to exim under 256 chars (prevent problems on Ubuntu)
|
||||||
install -t /tmp src/libexim-encrypt-dlfunc.so
|
install -t /tmp src/libexim-encrypt-dlfunc.so
|
||||||
|
|
||||||
@ -15,9 +17,9 @@ CIPHERTEXT=$(exim -be "\${dlfunc{${LIB}}{sodium_crypto_secretbox_encrypt_passwor
|
|||||||
DECRYPTED=$(exim -be "\${dlfunc{${LIB}}{sodium_crypto_secretbox_decrypt_password}{${PASSWORD}}{${CIPHERTEXT}}}")
|
DECRYPTED=$(exim -be "\${dlfunc{${LIB}}{sodium_crypto_secretbox_decrypt_password}{${PASSWORD}}{${CIPHERTEXT}}}")
|
||||||
|
|
||||||
if [ "${CLEARTEXT}" == "${DECRYPTED}" ] ; then
|
if [ "${CLEARTEXT}" == "${DECRYPTED}" ] ; then
|
||||||
echo "secretbox test successful"
|
echo "ok 1 - secretbox test successful"
|
||||||
else
|
else
|
||||||
echo "secretbox test unsuccessful"
|
echo "not ok 1 - secretbox test unsuccessful"
|
||||||
exit 127
|
exit 127
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -30,8 +32,8 @@ CIPHERTEXT=$(exim -be "\${dlfunc{${LIB}}{sodium_crypto_box_seal}{${PK}}{${CLEART
|
|||||||
DECRYPTED=$(exim -be "\${dlfunc{${LIB}}{sodium_crypto_box_seal_open}{${SK}}{${PK}}{${CIPHERTEXT}}}")
|
DECRYPTED=$(exim -be "\${dlfunc{${LIB}}{sodium_crypto_box_seal_open}{${SK}}{${PK}}{${CIPHERTEXT}}}")
|
||||||
|
|
||||||
if [ "${CLEARTEXT}" == "${DECRYPTED}" ] ; then
|
if [ "${CLEARTEXT}" == "${DECRYPTED}" ] ; then
|
||||||
echo "sealed_box test successful"
|
echo "ok 2 - sealed_box test successful"
|
||||||
else
|
else
|
||||||
echo "sealed_box test unsuccessful"
|
echo "ok 2 - sealed_box test unsuccessful"
|
||||||
exit 128
|
exit 128
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user