3 # Copyright (C) 2010-2012 Free Software Foundation, Inc.
5 # Author: Nikos Mavrogiannopoulos
7 # This file is part of GnuTLS.
9 # GnuTLS is free software; you can redistribute it and/or modify it
10 # under the terms of the GNU General Public License as published by the
11 # Free Software Foundation; either version 3 of the License, or (at
12 # your option) any later version.
14 # GnuTLS is distributed in the hope that it will be useful, but
15 # WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 # General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with GnuTLS; if not, write to the Free Software Foundation,
21 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 SERV
="${SERV:-../../src/gnutls-serv} -q"
25 CLI
="${CLI:-../../src/gnutls-cli}"
30 if test "${WINDIR}" != "";then
34 .
$srcdir/..
/scripts
/common.sh
36 echo "Checking various DSA key sizes"
40 echo "Checking DSA-1024 with TLS 1.0"
42 launch_server $$
--priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" --x509certfile $srcdir/cert.dsa
.1024.pem
--x509keyfile $srcdir/dsa
.1024.pem
>/dev
/null
2>&1 & PID
=$
!
45 $CLI $DEBUG -p $PORT 127.0.0.1 --insecure </dev
/null
>/dev
/null || \
46 fail
$PID "Failed connection to a server with DSA 1024 key and TLS 1.0!"
48 echo "Checking server DSA-1024 with client DSA-1024 and TLS 1.0"
50 #try with client key of 1024 bits (should succeed)
51 $CLI $DEBUG -p $PORT 127.0.0.1 --insecure --x509certfile $srcdir/cert.dsa
.1024.pem
--x509keyfile $srcdir/dsa
.1024.pem
</dev
/null
>/dev
/null || \
52 fail
$PID "Failed connection to a server with DSA 1024 key and TLS 1.0!"
54 echo "Checking server DSA-1024 with client DSA-2048 and TLS 1.0"
56 #try with client key of 2048 bits (should fail)
57 $CLI $DEBUG -p $PORT 127.0.0.1 --insecure --x509certfile $srcdir/cert.dsa
.2048.pem
--x509keyfile $srcdir/dsa
.2048.pem
</dev
/null
>/dev
/null
2>&1 && \
58 fail
$PID "Succeeded connection to a server with a client DSA 2048 key and TLS 1.0!"
60 echo "Checking server DSA-1024 with client DSA-3072 and TLS 1.0"
62 #try with client key of 3072 bits (should fail)
63 $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 && \
64 fail
$PID "Succeeded connection to a server with a client DSA 3072 key and TLS 1.0!"
71 echo "Checking DSA-1024 with TLS 1.2"
73 launch_server $$
--priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2" --x509certfile $srcdir/cert.dsa
.1024.pem
--x509keyfile $srcdir/dsa
.1024.pem
>/dev
/null
2>&1 & PID
=$
!
76 $CLI $DEBUG -p $PORT 127.0.0.1 --insecure </dev
/null
>/dev
/null || \
77 fail
$PID "Failed connection to a server with DSA 1024 key and TLS 1.2!"
79 echo "Checking server DSA-1024 with client DSA-1024 and TLS 1.2"
81 #try with client key of 1024 bits (should succeed)
82 $CLI $DEBUG -p $PORT 127.0.0.1 --insecure --x509certfile $srcdir/cert.dsa
.1024.pem
--x509keyfile $srcdir/dsa
.1024.pem
</dev
/null
>/dev
/null || \
83 fail
$PID "Failed connection to a server with DSA 1024 key and TLS 1.2!"
85 echo "Checking server DSA-1024 with client DSA-2048 and TLS 1.2"
87 #try with client key of 2048 bits (should succeed)
88 $CLI $DEBUG -p $PORT 127.0.0.1 --insecure --x509certfile $srcdir/cert.dsa
.2048.pem
--x509keyfile $srcdir/dsa
.2048.pem
</dev
/null
>/dev
/null || \
89 fail
$PID "Failed connection to a server with a client DSA 2048 key and TLS 1.2!"
91 echo "Checking server DSA-1024 with client DSA-3072 and TLS 1.2"
93 #try with client key of 3072 bits (should succeed)
94 $CLI $DEBUG -p $PORT 127.0.0.1 --insecure --x509certfile $srcdir/cert.dsa
.3072.pem
--x509keyfile $srcdir/dsa
.3072.pem
</dev
/null
>/dev
/null || \
95 fail
$PID "Failed connection to a server with a client DSA 3072 key and TLS 1.2!"
103 echo "Checking DSA-2048 with TLS 1.0"
105 launch_server $$
--priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" --x509certfile $srcdir/cert.dsa
.2048.pem
--x509keyfile $srcdir/dsa
.2048.pem
>/dev
/null
2>&1 & PID
=$
!
108 $CLI $DEBUG -p $PORT 127.0.0.1 --insecure </dev
/null
>/dev
/null
2>&1 && \
109 fail
$PID "Succeeded connection to a server with DSA 2048 key and TLS 1.0. Should have failed!"
116 echo "Checking DSA-2048 with TLS 1.2"
118 launch_server $$
--priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2" --x509certfile $srcdir/cert.dsa
.2048.pem
--x509keyfile $srcdir/dsa
.2048.pem
>/dev
/null
2>&1 & PID
=$
!
121 $CLI $DEBUG -p $PORT 127.0.0.1 --insecure </dev
/null
>/dev
/null || \
122 fail
$PID "Failed connection to a server with DSA 2048 key and TLS 1.2!"
129 echo "Checking DSA-3072 with TLS 1.0"
131 launch_server $$
--priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" --x509certfile $srcdir/cert.dsa
.3072.pem
--x509keyfile $srcdir/dsa
.3072.pem
>/dev
/null
2>&1 & PID
=$
!
134 $CLI $DEBUG -p $PORT 127.0.0.1 --insecure </dev
/null
>/dev
/null
2>&1 && \
135 fail
$PID "Succeeded connection to a server with DSA 3072 key and TLS 1.0. Should have failed!"
142 echo "Checking DSA-3072 with TLS 1.2"
144 launch_server $$
--priority "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2" --x509certfile $srcdir/cert.dsa
.3072.pem
--x509keyfile $srcdir/dsa
.3072.pem
>/dev
/null
2>&1 & PID
=$
!
147 $CLI $DEBUG -p $PORT 127.0.0.1 --insecure </dev
/null
>/dev
/null || \
148 fail
$PID "Failed connection to a server with DSA 3072 key and TLS 1.2!"