]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
tests: moved dsa tests into key-tests/
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Thu, 28 Jul 2016 11:13:39 +0000 (13:13 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Thu, 28 Jul 2016 16:26:57 +0000 (18:26 +0200)
tests/Makefile.am
tests/dsa/Makefile.am [deleted file]
tests/key-tests/Makefile.am
tests/key-tests/data/cert.dsa.1024.pem [moved from tests/dsa/cert.dsa.1024.pem with 100% similarity]
tests/key-tests/data/cert.dsa.2048.pem [moved from tests/dsa/cert.dsa.2048.pem with 100% similarity]
tests/key-tests/data/cert.dsa.3072.pem [moved from tests/dsa/cert.dsa.3072.pem with 100% similarity]
tests/key-tests/data/dsa-pubkey-1018.pem [moved from tests/dsa/dsa-pubkey-1018.pem with 100% similarity]
tests/key-tests/data/dsa.1024.pem [moved from tests/dsa/dsa.1024.pem with 100% similarity]
tests/key-tests/data/dsa.2048.pem [moved from tests/dsa/dsa.2048.pem with 100% similarity]
tests/key-tests/data/dsa.3072.pem [moved from tests/dsa/dsa.3072.pem with 100% similarity]
tests/key-tests/dsa [moved from tests/dsa/testdsa with 80% similarity]

index d373b083f8b06bf46f314b865a3f6c26db9d70e5..8db56d0d6ce50e80d8913ea1fc0415fdcaaaafa4 100644 (file)
@@ -19,7 +19,7 @@
 # along with this file; if not, write to the Free Software Foundation,
 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
-SUBDIRS = . cert-tests ocsp-tests key-tests sha2 safe-renegotiation dsa scripts ecdsa \
+SUBDIRS = . cert-tests ocsp-tests key-tests sha2 safe-renegotiation scripts ecdsa \
        slow dtls srp windows
 
 if ENABLE_OPENPGP
diff --git a/tests/dsa/Makefile.am b/tests/dsa/Makefile.am
deleted file mode 100644 (file)
index 390503f..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-## Process this file with automake to produce Makefile.in
-# Copyright (C) 2007-2008, 2010, 2012 Free Software Foundation, Inc.
-#
-# Author: Simon Josefsson
-#
-# This file is part of GnuTLS.
-#
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This file is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this file; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-EXTRA_DIST = cert.dsa.1024.pem cert.dsa.2048.pem cert.dsa.3072.pem \
-       dsa.1024.pem dsa.2048.pem dsa.3072.pem dsa-pubkey-1018.pem
-
-dist_check_SCRIPTS = testdsa
-
-if !WINDOWS
-TESTS = testdsa
-endif
-
-TESTS_ENVIRONMENT = EXEEXT=$(EXEEXT) \
-       LC_ALL="C"                                              \
-       top_builddir="$(top_builddir)"                          \
-       srcdir="$(srcdir)"
index 39342e6659457ab93dcdce48f1a6712baba50571..b07d872be7c5c461fcd6b3320953e23af04091b2 100644 (file)
@@ -25,12 +25,18 @@ EXTRA_DIST = README data/key-ca.pem data/key-user.pem \
        data/openssl-key-ecc.p8 data/key-ecc.p8 data/key-ecc.pem suppressions.valgrind
        data/encpkcs8.pem data/unencpkcs8.pem data/enc2pkcs8.pem \
        data/openssl-3des.p8 data/openssl-3des.p8.txt data/openssl-aes128.p8 \
-       data/openssl-aes128.p8.txt data/openssl-aes256.p8 data/openssl-aes256.p8.txt
+       data/openssl-aes128.p8.txt data/openssl-aes256.p8 data/openssl-aes256.p8.txt \
+       data/cert.dsa.1024.pem data/cert.dsa.2048.pem data/cert.dsa.3072.pem \
+       data/dsa.1024.pem data/dsa.2048.pem data/dsa.3072.pem data/dsa-pubkey-1018.pem
 
-dist_check_SCRIPTS = key-id pkcs8 pkcs8-decode
+dist_check_SCRIPTS = key-id pkcs8 pkcs8-decode dsa
 
 TESTS = key-id pkcs8 pkcs8-decode
 
+if !WINDOWS
+TESTS += dsa
+endif
+
 TESTS_ENVIRONMENT = EXEEXT=$(EXEEXT) \
        LC_ALL="C"                                              \
        VALGRIND="$(VALGRIND)"                                  \
similarity index 80%
rename from tests/dsa/testdsa
rename to tests/key-tests/dsa
index e1b9dcf583840a004277d962701802d51d8c0581..17a4472edfcb662721cabf2430550cda92c87f22 100755 (executable)
@@ -37,7 +37,7 @@ fi
 
 . "${srcdir}/../scripts/common.sh"
 
-size=`${VALGRIND} "${CERTTOOL}" -i --infile "${srcdir}/dsa-pubkey-1018.pem"|grep "Algorithm Secur"|cut -d '(' -f 2|cut -d ' ' -f 1`
+size=`${VALGRIND} "${CERTTOOL}" -i --infile "${srcdir}/data/dsa-pubkey-1018.pem"|grep "Algorithm Secur"|cut -d '(' -f 2|cut -d ' ' -f 1`
 
 if test "${size}" != "1024"; then
        echo "The prime size (${size}) doesn't match the expected: 1024"
@@ -52,7 +52,7 @@ echo "Checking various DSA key sizes (port ${PORT})"
 echo "Checking DSA-1024 with TLS 1.0"
 
 eval "${GETPORT}"
-launch_server $$ --priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0:+DHE-DSS:+SIGN-DSA-SHA256:+SIGN-DSA-SHA1" --x509certfile "${srcdir}/cert.dsa.1024.pem" --x509keyfile "${srcdir}/dsa.1024.pem"
+launch_server $$ --priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0:+DHE-DSS:+SIGN-DSA-SHA256:+SIGN-DSA-SHA1" --x509certfile "${srcdir}/data/cert.dsa.1024.pem" --x509keyfile "${srcdir}/data/dsa.1024.pem"
 PID=$!
 wait_server "${PID}"
 
@@ -63,19 +63,19 @@ PRIO="--priority NORMAL:+DHE-DSS:+SIGN-DSA-SHA512:+SIGN-DSA-SHA384:+SIGN-DSA-SHA
 echo "Checking server DSA-1024 with client DSA-1024 and TLS 1.0"
 
 #try with client key of 1024 bits (should succeed) 
-"${CLI}" ${DEBUG} ${PRIO} -p "${PORT}" 127.0.0.1 --insecure --x509certfile "${srcdir}/cert.dsa.1024.pem" --x509keyfile "${srcdir}/dsa.1024.pem" </dev/null >/dev/null || \
+"${CLI}" ${DEBUG} ${PRIO} -p "${PORT}" 127.0.0.1 --insecure --x509certfile "${srcdir}/data/cert.dsa.1024.pem" --x509keyfile "${srcdir}/data/dsa.1024.pem" </dev/null >/dev/null || \
        fail "${PID}" "Failed connection to a server with DSA 1024 key and TLS 1.0!"
 
 echo "Checking server DSA-1024 with client DSA-2048 and TLS 1.0"
 
 #try with client key of 2048 bits (should fail) 
-"${CLI}" ${DEBUG} ${PRIO} -p "${PORT}" 127.0.0.1 --insecure --x509certfile "${srcdir}/cert.dsa.2048.pem" --x509keyfile "${srcdir}/dsa.2048.pem" </dev/null >/dev/null 2>&1 && \
+"${CLI}" ${DEBUG} ${PRIO} -p "${PORT}" 127.0.0.1 --insecure --x509certfile "${srcdir}/data/cert.dsa.2048.pem" --x509keyfile "${srcdir}/data/dsa.2048.pem" </dev/null >/dev/null 2>&1 && \
        fail "${PID}" "Succeeded connection to a server with a client DSA 2048 key and TLS 1.0!"
 
 echo "Checking server DSA-1024 with client DSA-3072 and TLS 1.0"
 
 #try with client key of 3072 bits (should fail) 
-"${CLI}" ${DEBUG} ${PRIO} -p "${PORT}" 127.0.0.1 --insecure --x509certfile "${srcdir}/cert.dsa.3072.pem" --x509keyfile "${srcdir}/dsa.3072.pem" </dev/null >/dev/null 2>&1 && \
+"${CLI}" ${DEBUG} ${PRIO} -p "${PORT}" 127.0.0.1 --insecure --x509certfile "${srcdir}/data/cert.dsa.3072.pem" --x509keyfile "${srcdir}/data/dsa.3072.pem" </dev/null >/dev/null 2>&1 && \
        fail "${PID}" "Succeeded connection to a server with a client DSA 3072 key and TLS 1.0!"
 
 kill "${PID}"
@@ -86,7 +86,7 @@ wait
 echo "Checking DSA-1024 with TLS 1.2"
 
 eval "${GETPORT}"
-launch_server $$ --priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2:+DHE-DSS:+SIGN-DSA-SHA256:+SIGN-DSA-SHA1" --x509certfile "${srcdir}/cert.dsa.1024.pem" --x509keyfile "${srcdir}/dsa.1024.pem"
+launch_server $$ --priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2:+DHE-DSS:+SIGN-DSA-SHA256:+SIGN-DSA-SHA1" --x509certfile "${srcdir}/data/cert.dsa.1024.pem" --x509keyfile "${srcdir}/data/dsa.1024.pem"
 PID=$!
 wait_server "${PID}"
 
@@ -96,19 +96,19 @@ wait_server "${PID}"
 echo "Checking server DSA-1024 with client DSA-1024 and TLS 1.2"
 
 #try with client key of 1024 bits (should succeed) 
-"${CLI}" ${DEBUG} ${PRIO} -p "${PORT}" 127.0.0.1 --insecure --x509certfile "${srcdir}/cert.dsa.1024.pem" --x509keyfile "${srcdir}/dsa.1024.pem" </dev/null >/dev/null || \
+"${CLI}" ${DEBUG} ${PRIO} -p "${PORT}" 127.0.0.1 --insecure --x509certfile "${srcdir}/data/cert.dsa.1024.pem" --x509keyfile "${srcdir}/data/dsa.1024.pem" </dev/null >/dev/null || \
        fail "${PID}" "Failed connection to a server with DSA 1024 key and TLS 1.2!"
 
 echo "Checking server DSA-1024 with client DSA-2048 and TLS 1.2"
 
 #try with client key of 2048 bits (should succeed) 
-"${CLI}" ${DEBUG} ${PRIO} -p "${PORT}" 127.0.0.1 --insecure --x509certfile "${srcdir}/cert.dsa.2048.pem" --x509keyfile "${srcdir}/dsa.2048.pem" </dev/null >/dev/null || \
+"${CLI}" ${DEBUG} ${PRIO} -p "${PORT}" 127.0.0.1 --insecure --x509certfile "${srcdir}/data/cert.dsa.2048.pem" --x509keyfile "${srcdir}/data/dsa.2048.pem" </dev/null >/dev/null || \
        fail "${PID}" "Failed connection to a server with a client DSA 2048 key and TLS 1.2!"
 
 echo "Checking server DSA-1024 with client DSA-3072 and TLS 1.2"
 
 #try with client key of 3072 bits (should succeed) 
-"${CLI}" ${DEBUG} ${PRIO} -p "${PORT}" 127.0.0.1 --insecure --x509certfile "${srcdir}/cert.dsa.3072.pem" --x509keyfile "${srcdir}/dsa.3072.pem" </dev/null >/dev/null || \
+"${CLI}" ${DEBUG} ${PRIO} -p "${PORT}" 127.0.0.1 --insecure --x509certfile "${srcdir}/data/cert.dsa.3072.pem" --x509keyfile "${srcdir}/data/dsa.3072.pem" </dev/null >/dev/null || \
        fail "${PID}" "Failed connection to a server with a client DSA 3072 key and TLS 1.2!"
 
 kill "${PID}"
@@ -119,7 +119,7 @@ wait
 #echo "Checking DSA-2048 with TLS 1.0"
 
 #eval "${GETPORT}"
-#launch_server $$ --priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" --x509certfile "${srcdir}/cert.dsa.2048.pem" --x509keyfile "${srcdir}/dsa.2048.pem"
+#launch_server $$ --priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" --x509certfile "${srcdir}/data/cert.dsa.2048.pem" --x509keyfile "${srcdir}/data/dsa.2048.pem"
 #PID=$!
 #wait_server "${PID}"
 
@@ -133,7 +133,7 @@ wait
 echo "Checking DSA-2048 with TLS 1.2"
 
 eval "${GETPORT}"
-launch_server $$ --priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2:+DHE-DSS:+SIGN-DSA-SHA256:+SIGN-DSA-SHA1" --x509certfile "${srcdir}/cert.dsa.2048.pem" --x509keyfile "${srcdir}/dsa.2048.pem"
+launch_server $$ --priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2:+DHE-DSS:+SIGN-DSA-SHA256:+SIGN-DSA-SHA1" --x509certfile "${srcdir}/data/cert.dsa.2048.pem" --x509keyfile "${srcdir}/data/dsa.2048.pem"
 PID=$!
 wait_server "${PID}"
 
@@ -147,7 +147,7 @@ wait
 
 #echo "Checking DSA-3072 with TLS 1.0"
 
-#launch_server $$ --priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" --x509certfile "${srcdir}/cert.dsa.3072.pem" --x509keyfile "${srcdir}/dsa.3072.pem"
+#launch_server $$ --priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" --x509certfile "${srcdir}/data/cert.dsa.3072.pem" --x509keyfile "${srcdir}/data/dsa.3072.pem"
 #PID=$!
 #wait_server "${PID}"
 #
@@ -162,7 +162,7 @@ wait
 echo "Checking DSA-3072 with TLS 1.2"
 
 eval "${GETPORT}"
-launch_server $$ --priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2:+DHE-DSS:+SIGN-DSA-SHA256:+SIGN-DSA-SHA1" --x509certfile "${srcdir}/cert.dsa.3072.pem" --x509keyfile "${srcdir}/dsa.3072.pem"
+launch_server $$ --priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2:+DHE-DSS:+SIGN-DSA-SHA256:+SIGN-DSA-SHA1" --x509certfile "${srcdir}/data/cert.dsa.3072.pem" --x509keyfile "${srcdir}/data/dsa.3072.pem"
 PID=$!
 wait_server "${PID}"