TLS-SRP: support added when using GnuTLS

This commit is contained in:
Quinn Slack 2011-01-19 20:35:02 +01:00 committed by Daniel Stenberg
parent 4f13340ab8
commit 59cf93ccdb
20 changed files with 661 additions and 14 deletions

View file

@ -69,7 +69,7 @@ EXTRA_DIST = test1 test108 test117 test127 test20 test27 test34 test46 \
test569 test570 test571 test572 test804 test805 test806 test807 test573 \
test313 test1115 test578 test579 test1116 test1200 test1201 test1202 \
test1203 test1117 test1118 test1119 test1120 test1300 test1301 test1302 \
test1303
test1303 test320 test321 test322 test323 test324
filecheck:
@mkdir test-place; \

95
tests/data/test320 Normal file
View file

@ -0,0 +1,95 @@
<testcase>
<info>
<keywords>
HTTPS
HTTP GET
TLS-SRP
</keywords>
</info>
# Server-side
<reply>
<data nocheck="yes">
HTTP/1.0 200 OK
Content-type: text/html
<HTML><BODY>
<CENTER><H1>This is <a href="http://www.gnu.org/software/gnutls">GNUTLS</a></H1></CENTER>
<p>Session ID: <i>003030000100000001000000000000000030330001000000B062410001000000</i></p>
<h5>If your browser supports session resuming, then you should see the same session ID, when you press the <b>reload</b> button.</h5>
<p>Connected as user 'jsmith'.</p>
<P>
<TABLE border=1><TR><TD>Protocol version:</TD><TD>TLS1.2</TD></TR>
<TR><TD>Key Exchange:</TD><TD>SRP</TD></TR>
<TR><TD>Compression</TD><TD>NULL</TD></TR>
<TR><TD>Cipher</TD><TD>AES-128-CBC</TD></TR>
<TR><TD>MAC</TD><TD>SHA1</TD></TR>
<TR><TD>Ciphersuite</TD><TD>SRP_SHA_AES_128_CBC_SHA1</TD></TR></p></TABLE>
<hr><P>Your HTTP header was:<PRE>User-Agent: curl/7.21.4-DEV (x86_64-apple-darwin10.5.0) libcurl/7.21.4-DEV GnuTLS/2.10.4 zlib/1.2.5 libidn/1.19
Host: localhost:9011
Accept: */*
</PRE></P>
</BODY></HTML>
</data>
</reply>
# Client-side
<client>
<server>
http+tls-srp
</server>
<features>
TLS-SRP
</features>
<name>
simple TLS-SRP HTTPS GET, check user in response
</name>
<command>
--insecure --tlsauthtype SRP --tlsuser jsmith --tlspassword abc https://%HOSTIP:%HTTPTLSSRPPORT
</command>
</client>
# Verify data after the test has been "shot"
<verify>
<protocol>
</protocol>
<file name="log/curl320.out" mode="text">
HTTP/1.0 200 OK
Content-type: text/html
<HTML><BODY>
<CENTER><H1>This is <a href="http://www.gnu.org/software/gnutls">GNUTLS</a></H1></CENTER>
<h5>If your browser supports session resuming, then you should see the same session ID, when you press the <b>reload</b> button.</h5>
<p>Connected as user 'jsmith'.</p>
<P>
<TABLE border=1><TR><TD>
<TR><TD>Key Exchange:</TD><TD>SRP</TD></TR>
<TR><TD>Compression</TD><TD>NULL</TD></TR>
<TR><TD>Cipher</TD><TD>AES-128-CBC</TD></TR>
<TR><TD>MAC</TD><TD>SHA1</TD></TR>
<TR><TD>Ciphersuite</TD><TD>SRP_SHA_AES_128_CBC_SHA1</TD></TR></p></TABLE>
Host: %HOSTIP:%HTTPTLSSRPPORT
Accept: */*
</PRE></P>
</BODY></HTML>
</file>
<stripfile>
s/^<p>Session ID:.*//
s/^<hr><P>Your HTTP header was:.*//
s/Protocol version:.*//
</stripfile>
</verify>
</testcase>

33
tests/data/test321 Normal file
View file

@ -0,0 +1,33 @@
<testcase>
<info>
<keywords>
HTTPS
TLS-SRP
FAILURE
</keywords>
</info>
# Client-side
<client>
<server>
http+tls-srp
</server>
<features>
TLS-SRP
</features>
<name>
TLS-SRP with bad username and password
</name>
<command>
--insecure --tlsauthtype SRP --tlsuser baduser --tlspassword badpass https://%HOSTIP:%HTTPTLSSRPPORT
</command>
</client>
# Verify data after the test has been "shot"
<verify>
<errorcode>
35
</errorcode>
</verify>
</testcase>

33
tests/data/test322 Normal file
View file

@ -0,0 +1,33 @@
<testcase>
<info>
<keywords>
HTTPS
TLS-SRP
FAILURE
</keywords>
</info>
# Client-side
<client>
<server>
http+tls-srp
</server>
<features>
TLS-SRP
</features>
<name>
TLS-SRP with bad password
</name>
<command>
--insecure --tlsauthtype SRP --tlsuser jsmith --tlspassword badpass https://%HOSTIP:%HTTPTLSSRPPORT
</command>
</client>
# Verify data after the test has been "shot"
<verify>
<errorcode>
35
</errorcode>
</verify>
</testcase>

33
tests/data/test323 Normal file
View file

@ -0,0 +1,33 @@
<testcase>
<info>
<keywords>
HTTPS
TLS-SRP
FAILURE
</keywords>
</info>
# Client-side
<client>
<server>
https
</server>
<features>
TLS-SRP
</features>
<name>
TLS-SRP to non-TLS-SRP server
</name>
<command>
--insecure --tlsauthtype SRP --tlsuser jsmith --tlspassword badpass https://%HOSTIP:%HTTPSPORT/want/323
</command>
</client>
# Verify data after the test has been "shot"
<verify>
<errorcode>
35
</errorcode>
</verify>
</testcase>

33
tests/data/test324 Normal file
View file

@ -0,0 +1,33 @@
<testcase>
<info>
<keywords>
HTTPS
TLS-SRP
FAILURE
</keywords>
</info>
# Client-side
<client>
<server>
http+tls-srp
</server>
<features>
TLS-SRP
</features>
<name>
TLS-SRP with server cert checking
</name>
<command> # no --insecure
--tlsauthtype SRP --tlsuser jsmith --tlspassword abc https://%HOSTIP:%HTTPTLSSRPPORT/want/323
</command>
</client>
# Verify data after the test has been "shot"
<verify>
<errorcode>
51
</errorcode>
</verify>
</testcase>