diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2011-03-28 21:27:19 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2011-03-28 21:27:19 +0200 |
commit | 960143d1615e8714c5f79bdfaa3e739c8bc0aa25 (patch) | |
tree | 78c08db699e92e8a935ac5598995fade9f3e301d | |
parent | aa36f26ed10ba84ab2d4f5e4fda4e36ad0e34e8b (diff) | |
download | gnutls-960143d1615e8714c5f79bdfaa3e739c8bc0aa25.tar.gz |
Made scripts bourne shell compliant and not bash.
-rwxr-xr-x | tests/dsa/testdsa | 32 | ||||
-rwxr-xr-x | tests/openpgp-certs/testcerts | 19 |
2 files changed, 31 insertions, 20 deletions
diff --git a/tests/dsa/testdsa b/tests/dsa/testdsa index bbd0802e46..910bf8b167 100755 --- a/tests/dsa/testdsa +++ b/tests/dsa/testdsa @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # Copyright (C) 2010 Free Software Foundation, Inc. # @@ -38,7 +38,8 @@ echo "Checking various DSA key sizes" echo "Checking DSA-1024 with TLS 1.0" -$SERV $DEBUG -p $PORT --priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" --x509certfile $srcdir/cert.dsa.1024.pem --x509keyfile $srcdir/dsa.1024.pem >/dev/null 2>&1 & +$SERV $DEBUG -p $PORT --priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" --x509certfile $srcdir/cert.dsa.1024.pem --x509keyfile $srcdir/dsa.1024.pem >/dev/null 2>&1 & PID=$! +trap "kill $PID" 1 15 2 # give the server a chance to initialize sleep 2 @@ -64,14 +65,15 @@ echo "Checking server DSA-1024 with client DSA-3072 and TLS 1.0" $CLI $DEBUG -p $PORT 127.0.0.1 --insecure --x509certfile $srcdir/cert.dsa.3072.pem --x509keyfile $srcdir/dsa.3072.pem </dev/null >/dev/null 2>&1 && \ fail "Succeeded connection to a server with a client DSA 3072 key and TLS 1.0!" -kill %1 +kill $PID wait # DSA 1024 + TLS 1.2 echo "Checking DSA-1024 with TLS 1.2" -$SERV $DEBUG -p $PORT --priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2" --x509certfile $srcdir/cert.dsa.1024.pem --x509keyfile $srcdir/dsa.1024.pem >/dev/null 2>&1 & +$SERV $DEBUG -p $PORT --priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2" --x509certfile $srcdir/cert.dsa.1024.pem --x509keyfile $srcdir/dsa.1024.pem >/dev/null 2>&1 & PID=$! +trap "kill $PID" 1 15 2 # give the server a chance to initialize sleep 2 @@ -98,14 +100,15 @@ $CLI $DEBUG -p $PORT 127.0.0.1 --insecure --x509certfile $srcdir/cert.dsa.3072.p fail "Failed connection to a server with a client DSA 3072 key and TLS 1.2!" -kill %1 +kill $PID wait # DSA 2048 + TLS 1.0 echo "Checking DSA-2048 with TLS 1.0" -$SERV $DEBUG -p $PORT --priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" --x509certfile $srcdir/cert.dsa.2048.pem --x509keyfile $srcdir/dsa.2048.pem >/dev/null 2>&1 & +$SERV $DEBUG -p $PORT --priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" --x509certfile $srcdir/cert.dsa.2048.pem --x509keyfile $srcdir/dsa.2048.pem >/dev/null 2>&1 & PID=$! +trap "kill $PID" 1 15 2 # give the server a chance to initialize sleep 2 @@ -113,14 +116,15 @@ sleep 2 $CLI $DEBUG -p $PORT 127.0.0.1 --insecure </dev/null >/dev/null 2>&1 && \ fail "Succeeded connection to a server with DSA 2048 key and TLS 1.0. Should have failed!" -kill %1 +kill $PID wait # DSA 2048 + TLS 1.2 echo "Checking DSA-2048 with TLS 1.2" -$SERV $DEBUG -p $PORT --priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2" --x509certfile $srcdir/cert.dsa.2048.pem --x509keyfile $srcdir/dsa.2048.pem >/dev/null 2>&1 & +$SERV $DEBUG -p $PORT --priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2" --x509certfile $srcdir/cert.dsa.2048.pem --x509keyfile $srcdir/dsa.2048.pem >/dev/null 2>&1 & PID=$! +trap "kill $PID" 1 15 2 # give the server a chance to initialize sleep 2 @@ -128,14 +132,15 @@ sleep 2 $CLI $DEBUG -p $PORT 127.0.0.1 --insecure </dev/null >/dev/null || \ fail "Failed connection to a server with DSA 2048 key and TLS 1.2!" -kill %1 +kill $PID wait # DSA 3072 + TLS 1.0 echo "Checking DSA-3072 with TLS 1.0" -$SERV $DEBUG -p $PORT --priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" --x509certfile $srcdir/cert.dsa.3072.pem --x509keyfile $srcdir/dsa.3072.pem >/dev/null 2>&1 & +$SERV $DEBUG -p $PORT --priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" --x509certfile $srcdir/cert.dsa.3072.pem --x509keyfile $srcdir/dsa.3072.pem >/dev/null 2>&1 & PID=$! +trap "kill $PID" 1 15 2 # give the server a chance to initialize sleep 2 @@ -143,14 +148,15 @@ sleep 2 $CLI $DEBUG -p $PORT 127.0.0.1 --insecure </dev/null >/dev/null 2>&1 && \ fail "Succeeded connection to a server with DSA 2048 key and TLS 1.0. Should have failed!" -kill %1 +kill $PID wait # DSA 3072 + TLS 1.2 echo "Checking DSA-3072 with TLS 1.2" -$SERV $DEBUG -p $PORT --priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2" --x509certfile $srcdir/cert.dsa.3072.pem --x509keyfile $srcdir/dsa.3072.pem >/dev/null 2>&1 & +$SERV $DEBUG -p $PORT --priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2" --x509certfile $srcdir/cert.dsa.3072.pem --x509keyfile $srcdir/dsa.3072.pem >/dev/null 2>&1 & PID=$! +trap "kill $PID" 1 15 2 # give the server a chance to initialize sleep 2 @@ -158,7 +164,7 @@ sleep 2 $CLI $DEBUG -p $PORT 127.0.0.1 --insecure </dev/null >/dev/null || \ fail "Failed connection to a server with DSA 3072 key and TLS 1.2!" -kill %1 +kill $PID wait exit 0 diff --git a/tests/openpgp-certs/testcerts b/tests/openpgp-certs/testcerts index dbb0810df8..ecf39810d1 100755 --- a/tests/openpgp-certs/testcerts +++ b/tests/openpgp-certs/testcerts @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # Copyright (C) 2010 Free Software Foundation, Inc. # @@ -33,7 +33,8 @@ fail() { echo "Checking OpenPGP certificate verification" -$SERV -p $PORT --pgpcertfile $srcdir/srv-public-127.0.0.1-signed.gpg --pgpkeyfile $srcdir/srv-secret.gpg >/dev/null 2>&1 & +$SERV -p $PORT --pgpcertfile $srcdir/srv-public-127.0.0.1-signed.gpg --pgpkeyfile $srcdir/srv-secret.gpg >/dev/null 2>&1 & PID=$! +trap "kill $PID" 1 15 2 # give the server a chance to initialize sleep 2 @@ -50,10 +51,12 @@ $CLI -p $PORT 127.0.0.2 --pgpkeyring $srcdir/ca-public.gpg </dev/null >/dev/null $CLI -p $PORT localhost --pgpkeyring $srcdir/ca-public.gpg </dev/null >/dev/null && \ fail "Connection to unverified (but present) 'localhost' should have failed!" -kill %1 +kill $PID wait -$SERV -p $PORT --pgpcertfile $srcdir/srv-public-localhost-signed.gpg --pgpkeyfile $srcdir/srv-secret.gpg >/dev/null 2>&1 & +$SERV -p $PORT --pgpcertfile $srcdir/srv-public-localhost-signed.gpg --pgpkeyfile $srcdir/srv-secret.gpg >/dev/null 2>&1 & PID=$! +trap "kill $PID" 1 15 2 + # give the server a chance to initialize sleep 2 @@ -67,10 +70,12 @@ $CLI -p $PORT 127.0.0.2 --pgpkeyring $srcdir/ca-public.gpg </dev/null >/dev/null #$CLI -p $PORT localhost --pgpkeyring ca-public.gpg </dev/null >/dev/null || \ # fail "Connection to verified 'localhost' should have succeded! (error code $?)" $? -kill %1 >/dev/null 2>&1 +kill $PID wait -$SERV -p $PORT --pgpcertfile $srcdir/srv-public-all-signed.gpg --pgpkeyfile $srcdir/srv-secret.gpg >/dev/null 2>&1 & +$SERV -p $PORT --pgpcertfile $srcdir/srv-public-all-signed.gpg --pgpkeyfile $srcdir/srv-secret.gpg >/dev/null 2>&1 & PID=$! +trap "kill $PID" 1 15 2 + # give the server a chance to initialize sleep 2 echo | $CLI -p $PORT 127.0.0.1 --pgpkeyring $srcdir/ca-public.gpg </dev/null >/dev/null || \ @@ -79,7 +84,7 @@ echo | $CLI -p $PORT 127.0.0.1 --pgpkeyring $srcdir/ca-public.gpg </dev/null >/d $CLI -p $PORT 127.0.0.2 --pgpkeyring $srcdir/ca-public.gpg </dev/null >/dev/null && \ fail "Connection to unrecognized IP address should have failed!" -kill %1 >/dev/null 2>&1 +kill $PID wait exit ${RETCODE:-0} |