From be1a5051890b7ad9339b0208424b94aa32c64776 Mon Sep 17 00:00:00 2001 From: moparisthebest Date: Mon, 24 Nov 2014 19:30:09 +0100 Subject: SSL: Add PEM format support for public key pinning --- tests/data/Makefile.inc | 2 +- tests/data/test2034 | 2 +- tests/data/test2035 | 2 +- tests/data/test2037 | 58 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/data/test2038 | 44 +++++++++++++++++++++++++++++++++++++ 5 files changed, 105 insertions(+), 3 deletions(-) create mode 100644 tests/data/test2037 create mode 100644 tests/data/test2038 (limited to 'tests/data') diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc index 3edeceb2a..ee2d84fab 100644 --- a/tests/data/Makefile.inc +++ b/tests/data/Makefile.inc @@ -158,4 +158,4 @@ test2000 test2001 test2002 test2003 test2004 test2005 test2006 test2007 \ test2008 test2009 test2010 test2011 test2012 test2013 test2014 test2015 \ test2016 test2017 test2018 test2019 test2020 test2021 test2022 test2023 \ test2024 test2025 test2026 test2027 test2028 test2029 test2030 test2031 \ -test2032 test2033 test2034 test2035 test2036 +test2032 test2033 test2034 test2035 test2036 test2037 test2038 diff --git a/tests/data/test2034 b/tests/data/test2034 index 965c9a1b1..9bf0a817c 100644 --- a/tests/data/test2034 +++ b/tests/data/test2034 @@ -31,7 +31,7 @@ SSLpinning https Server-localhost-sv.pem -simple HTTPS GET with public key pinning +simple HTTPS GET with DER public key pinning --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost-sv.pub.der https://localhost:%HTTPSPORT/2034 diff --git a/tests/data/test2035 b/tests/data/test2035 index 64282fabe..7002a5b8e 100644 --- a/tests/data/test2035 +++ b/tests/data/test2035 @@ -23,7 +23,7 @@ SSLpinning https Server-localhost-sv.pem -HTTPS wrong pinnedpubkey but right CN +HTTPS wrong DER pinnedpubkey but right CN --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost-sv.der https://localhost:%HTTPSPORT/2035 diff --git a/tests/data/test2037 b/tests/data/test2037 new file mode 100644 index 000000000..d630538e2 --- /dev/null +++ b/tests/data/test2037 @@ -0,0 +1,58 @@ + + + +HTTPS +HTTP GET +PEM certificate + + + +# +# Server-side + + +HTTP/1.1 200 OK +Date: Thu, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 7 + +MooMoo + + + +# +# Client-side + + +SSL +SSLpinning + + +https Server-localhost-sv.pem + + +simple HTTPS GET with PEM public key pinning + + +--cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost-sv.pub.pem https://localhost:%HTTPSPORT/2037 + +# Ensure that we're running on localhost because we're checking the host name + +perl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );" + + + +# +# Verify data after the test has been "shot" + + +^User-Agent:.* + + +GET /2037 HTTP/1.1 +Host: localhost:%HTTPSPORT +Accept: */* + + + + diff --git a/tests/data/test2038 b/tests/data/test2038 new file mode 100644 index 000000000..63d935add --- /dev/null +++ b/tests/data/test2038 @@ -0,0 +1,44 @@ + + + +HTTPS +HTTP GET +PEM certificate + + + +# +# Server-side + + + +# +# Client-side + + +SSL +SSLpinning + + +https Server-localhost-sv.pem + + +HTTPS wrong PEM pinnedpubkey but right CN + + +--cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost-sv.pem https://localhost:%HTTPSPORT/2038 + +# Ensure that we're running on localhost because we're checking the host name + +perl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );" + + + +# +# Verify data after the test has been "shot" + + +90 + + + -- cgit v1.2.3