Skip to content

Commit

Permalink
tests: add Schannel-specific tests or disable unsupported ones
Browse files Browse the repository at this point in the history
Adds Schannel variants of SSLpinning tests that include the option
--ssl-revoke-best-effort to ignore certificate revocation check
failures which is required due to our custom test CA certificate.

Disable the original variants if the Schannel backend is enabled.

This is a step to simplify test exclusions for Windows and MinGW.
  • Loading branch information
mback2k committed Nov 6, 2021
1 parent d1624b9 commit 3543fc6
Show file tree
Hide file tree
Showing 11 changed files with 198 additions and 21 deletions.
20 changes: 10 additions & 10 deletions .azure-pipelines.yml
Expand Up @@ -121,64 +121,64 @@ stages:
container_cmd: C:\msys64\usr\bin\sh
prepare: pacman -S --needed --noconfirm --noprogressbar libssh2-devel mingw-w64-i686-libssh2
configure: --host=i686-w64-mingw32 --build=i686-w64-mingw32 --prefix=/mingw32 --enable-debug --enable-werror --with-libssh2 --with-openssl
tests: ~571 ~612 ~1056 ~1299
tests: ~571 ~612 ~1056
msys2_mingw64_debug_openssl:
name: 64-bit OpenSSL/libssh2
container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys2-mingw64:ltsc2019
container_cmd: C:\msys64\usr\bin\sh
prepare: pacman -S --needed --noconfirm --noprogressbar libssh2-devel mingw-w64-x86_64-libssh2
configure: --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --prefix=/mingw64 --enable-debug --enable-werror --with-libssh2 --with-openssl
tests: ~571 ~612 ~1056 ~1299
tests: ~571 ~612 ~1056
msys1_mingw_debug:
name: 32-bit (legacy)
container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys1-mingw:ltsc2019
container_cmd: C:\MinGW\msys\1.0\bin\sh
configure: --host=i686-pc-mingw32 --build=i686-pc-mingw32 --prefix=/mingw --enable-debug --without-ssl
tests: ~203 ~1056 ~1143
tests: ~203 ~1056 !1143
msys1_mingw32_debug:
name: 32-bit w/o zlib
container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys1-mingw32:ltsc2019
container_cmd: C:\MinGW\msys\1.0\bin\sh
configure: --host=i686-w64-mingw32 --build=i686-w64-mingw32 --prefix=/mingw32 --enable-debug --enable-werror --without-zlib --without-ssl
tests: ~203 ~1056 ~1143 ~1299
tests: ~203 ~1056 !1143
msys1_mingw64_debug:
name: 64-bit w/o zlib
container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys1-mingw64:ltsc2019
container_cmd: C:\MinGW\msys\1.0\bin\sh
configure: --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --prefix=/mingw64 --enable-debug --enable-werror --without-zlib --without-ssl
tests: ~203 ~1056 ~1143 ~1299
tests: ~203 ~1056 !1143
msys2_mingw32_debug_schannel:
name: 32-bit Schannel/SSPI/WinIDN/libssh2
container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys2-mingw32:ltsc2019
container_cmd: C:\msys64\usr\bin\sh
prepare: pacman -S --needed --noconfirm --noprogressbar libssh2-devel mingw-w64-i686-libssh2
configure: --host=i686-w64-mingw32 --build=i686-w64-mingw32 --prefix=/mingw32 --enable-debug --enable-werror --enable-sspi --with-schannel --with-winidn --with-libssh2
tests: ~165 ~310 ~571 ~612 ~1056 ~1299 ~1448 ~2034 ~2037 ~2041 ~2046 ~2047 ~3000 ~3001
tests: ~165 ~571 ~612 ~1056 ~1448 ~2046 ~2047 ~3000 ~3001
msys2_mingw64_debug_schannel:
name: 64-bit Schannel/SSPI/WinIDN/libssh2
container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys2-mingw64:ltsc2019
container_cmd: C:\msys64\usr\bin\sh
prepare: pacman -S --needed --noconfirm --noprogressbar libssh2-devel mingw-w64-x86_64-libssh2
configure: --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --prefix=/mingw64 --enable-debug --enable-werror --enable-sspi --with-schannel --with-winidn --with-libssh2
tests: ~165 ~310 ~571 ~612 ~1056 ~1299 ~1448 ~2034 ~2037 ~2041 ~2046 ~2047 ~3000 ~3001
tests: ~165 ~571 ~612 ~1056 ~1448 ~2046 ~2047 ~3000 ~3001
msys1_mingw_debug_schannel:
name: 32-bit Schannel/SSPI/WinIDN (legacy)
container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys1-mingw:ltsc2019
container_cmd: C:\MinGW\msys\1.0\bin\sh
configure: --host=i686-pc-mingw32 --build=i686-pc-mingw32 --prefix=/mingw --enable-debug --enable-sspi --with-schannel --with-winidn
tests: ~203 ~305 ~310 ~311 ~312 ~313 ~404 ~1056 ~1143 ~2034 ~2035 ~2037 ~2038 ~2041 ~2042 ~2048 ~3000 ~3001
tests: ~203 !305 !311 !312 !313 !404 ~1056 !1143 !2033 !2035 !2038 !2041 !2042 !2048 !2070 !2079 !2087 !3000 !3001
msys1_mingw32_debug_schannel:
name: 32-bit Schannel/SSPI/WinIDN w/o zlib
container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys1-mingw32:ltsc2019
container_cmd: C:\MinGW\msys\1.0\bin\sh
configure: --host=i686-w64-mingw32 --build=i686-w64-mingw32 --prefix=/mingw32 --enable-debug --enable-werror --enable-sspi --with-schannel --with-winidn --without-zlib
tests: ~203 ~310 ~1056 ~1143 ~1299 ~2034 ~2037 ~2041 ~3000 ~3001
tests: ~203 ~1056 !1143 ~3000 ~3001
msys1_mingw64_debug_schannel:
name: 64-bit Schannel/SSPI/WinIDN w/o zlib
container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys1-mingw64:ltsc2019
container_cmd: C:\MinGW\msys\1.0\bin\sh
configure: --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --prefix=/mingw64 --enable-debug --enable-werror --enable-sspi --with-schannel --with-winidn --without-zlib
tests: ~203 ~310 ~1056 ~1143 ~1299 ~2034 ~2037 ~2041 ~3000 ~3001
tests: ~203 ~1056 !1143 ~3000 ~3001
container:
image: $(container_img)
env:
Expand Down
8 changes: 4 additions & 4 deletions .cirrus.yml
Expand Up @@ -85,14 +85,14 @@ windows_task:
container_cmd: C:\msys64\usr\bin\sh
prepare: pacman -S --needed --noconfirm --noprogressbar libssh2-devel mingw-w64-i686-libssh2
configure: --host=i686-w64-mingw32 --build=i686-w64-mingw32 --prefix=/mingw32 --enable-werror --enable-sspi --with-schannel --with-winidn --with-libssh2
tests: ~165 ~310 ~571 ~612 ~1056 ~1299 ~1448 ~2034 ~2037 ~2041 ~2046 ~2047 ~3000 ~3001
tests: ~165 ~571 ~612 ~1056 ~1448 ~2046 ~2047 ~3000 ~3001
- name: Windows 32-bit static/release Schannel/SSPI/WinIDN/libssh2
env:
container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys2-mingw32:ltsc2019
container_cmd: C:\msys64\usr\bin\sh
prepare: pacman -S --needed --noconfirm --noprogressbar libssh2-devel mingw-w64-i686-libssh2
configure: --host=i686-w64-mingw32 --build=i686-w64-mingw32 --prefix=/mingw32 --enable-werror --enable-sspi --with-schannel --with-winidn --with-libssh2 --disable-shared --enable-static
tests: ~165 ~310 ~571 ~612 ~1056 ~1299 ~1448 ~2034 ~2037 ~2041 ~2046 ~2047 ~3000 ~3001
tests: ~165 ~571 ~612 ~1056 ~1448 ~2046 ~2047 ~3000 ~3001
curl_LDFLAGS: -all-static
PKG_CONFIG: pkg-config --static
- name: Windows 64-bit shared/release Schannel/SSPI/WinIDN/libssh2
Expand All @@ -101,14 +101,14 @@ windows_task:
container_cmd: C:\msys64\usr\bin\sh
prepare: pacman -S --needed --noconfirm --noprogressbar libssh2-devel mingw-w64-x86_64-libssh2
configure: --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --prefix=/mingw64 --enable-werror --enable-sspi --with-schannel --with-winidn --with-libssh2
tests: ~165 ~310 ~571 ~612 ~1056 ~1299 ~1448 ~2034 ~2037 ~2041 ~2046 ~2047 ~3000 ~3001
tests: ~165 ~571 ~612 ~1056 ~1448 ~2046 ~2047 ~3000 ~3001
- name: Windows 64-bit static/release Schannel/SSPI/WinIDN/libssh2
env:
container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys2-mingw64:ltsc2019
container_cmd: C:\msys64\usr\bin\sh
prepare: pacman -S --needed --noconfirm --noprogressbar libssh2-devel mingw-w64-x86_64-libssh2
configure: --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --prefix=/mingw64 --enable-werror --enable-sspi --with-schannel --with-winidn --with-libssh2 --disable-shared --enable-static
tests: ~165 ~310 ~571 ~612 ~1056 ~1299 ~1448 ~2034 ~2037 ~2041 ~2046 ~2047 ~3000 ~3001
tests: ~165 ~571 ~612 ~1056 ~1448 ~2046 ~2047 ~3000 ~3001
curl_LDFLAGS: -all-static
PKG_CONFIG: pkg-config --static

Expand Down
10 changes: 4 additions & 6 deletions tests/data/Makefile.inc
Expand Up @@ -222,15 +222,13 @@ test2000 test2001 test2002 test2003 test2004 \
\
test2023 \
test2024 test2025 test2026 test2027 test2028 test2029 test2030 test2031 \
test2032 test2034 test2035 test2036 test2037 test2038 test2039 \
test2032 test2033 test2034 test2035 test2036 test2037 test2038 test2039 \
test2040 test2041 test2042 test2043 test2044 test2045 test2046 test2047 \
test2048 test2049 test2050 test2051 test2052 test2053 test2054 test2055 \
test2056 test2057 test2058 test2059 test2060 test2061 test2062 test2063 \
test2064 test2065 test2066 test2067 test2068 test2069 \
test2064 test2065 test2066 test2067 test2068 test2069 test2070 \
test2071 test2072 test2073 test2074 test2075 test2076 test2077 \
test2078 \
test2080 test2081 test2082 test2083 test2084 test2085 test2086 \
test2064 test2065 test2066 test2067 test2068 test2069 test2070 test2071 \
test2072 test2073 test2074 test2075 test2076 test2077 test2078 test2079 \
test2080 test2081 test2082 test2083 test2084 test2085 test2086 test2087 \
\
test2100 \
\
Expand Down
61 changes: 61 additions & 0 deletions tests/data/test2033
@@ -0,0 +1,61 @@
<testcase>
<info>
<keywords>
HTTPS
HTTP GET
PEM certificate
</keywords>
</info>

#
# Server-side
<reply>
<data>
HTTP/1.1 200 OK
Date: Tue, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 7

MooMoo
</data>
</reply>

#
# Client-side
<client>
<features>
SSL
SSLpinning
Schannel
</features>
<server>
https Server-localhost-sv.pem
</server>
<name>
simple HTTPS GET with DER public key pinning (Schannel variant)
</name>
<setenv>
# This test is pointless if we're not using the schannel backend
CURL_SSL_BACKEND=schannel
</setenv>
<command>
--cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost-sv.pub.der --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER
</command>
# Ensure that we're running on localhost because we're checking the host name
<precheck>
perl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );"
</precheck>
</client>

#
# Verify data after the test has been "shot"
<verify>
<protocol>
GET /%TESTNUMBER HTTP/1.1
Host: localhost:%HTTPSPORT
User-Agent: curl/%VERSION
Accept: */*

</protocol>
</verify>
</testcase>
1 change: 1 addition & 0 deletions tests/data/test2034
Expand Up @@ -26,6 +26,7 @@ MooMoo
<features>
SSL
SSLpinning
!Schannel
</features>
<server>
https Server-localhost-sv.pem
Expand Down
1 change: 1 addition & 0 deletions tests/data/test2037
Expand Up @@ -26,6 +26,7 @@ MooMoo
<features>
SSL
SSLpinning
!Schannel
</features>
<server>
https Server-localhost-sv.pem
Expand Down
1 change: 1 addition & 0 deletions tests/data/test2041
Expand Up @@ -26,6 +26,7 @@ MooMoo
<features>
SSL
SSLpinning
!Schannel
</features>
<server>
https Server-localhost-sv.pem
Expand Down
2 changes: 1 addition & 1 deletion tests/data/test2070
Expand Up @@ -24,8 +24,8 @@ MooMoo
# Client-side
<client>
<features>
SSL
Schannel
!MinGW
</features>
<server>
https Server-localhost-sv.pem
Expand Down
57 changes: 57 additions & 0 deletions tests/data/test2079
@@ -0,0 +1,57 @@
<testcase>
<info>
<keywords>
HTTPS
HTTP GET
PEM certificate
</keywords>
</info>

#
# Server-side
<reply>
<data>
HTTP/1.1 200 OK
Date: Tue, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 7

MooMoo
</data>
</reply>

#
# Client-side
<client>
<features>
SSL
SSLpinning
Schannel
</features>
<server>
https Server-localhost-sv.pem
</server>
<name>
simple HTTPS GET with PEM public key pinning (Schannel variant)
</name>
<command>
--cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey %SRCDIR/certs/Server-localhost-sv.pub.pem --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER
</command>
# Ensure that we're running on localhost because we're checking the host name
<precheck>
perl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );"
</precheck>
</client>

#
# Verify data after the test has been "shot"
<verify>
<protocol>
GET /%TESTNUMBER HTTP/1.1
Host: localhost:%HTTPSPORT
User-Agent: curl/%VERSION
Accept: */*

</protocol>
</verify>
</testcase>
57 changes: 57 additions & 0 deletions tests/data/test2087
@@ -0,0 +1,57 @@
<testcase>
<info>
<keywords>
HTTPS
HTTP GET
PEM certificate
</keywords>
</info>

#
# Server-side
<reply>
<data>
HTTP/1.1 200 OK
Date: Tue, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 7

MooMoo
</data>
</reply>

#
# Client-side
<client>
<features>
SSL
SSLpinning
Schannel
</features>
<server>
https Server-localhost-sv.pem
</server>
<name>
simple HTTPS GET with base64-sha256 public key pinning (Schannel variant)
</name>
<command>
--cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --pinnedpubkey sha256//+JYNkp2GTGRgrvZMUkOxbFJQQqYpwNE6toGmBjz00D8= --ssl-revoke-best-effort https://localhost:%HTTPSPORT/%TESTNUMBER
</command>
# Ensure that we're running on localhost because we're checking the host name
<precheck>
perl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );"
</precheck>
</client>

#
# Verify data after the test has been "shot"
<verify>
<protocol>
GET /%TESTNUMBER HTTP/1.1
Host: localhost:%HTTPSPORT
User-Agent: curl/%VERSION
Accept: */*

</protocol>
</verify>
</testcase>
1 change: 1 addition & 0 deletions tests/data/test310
Expand Up @@ -25,6 +25,7 @@ MooMoo
<client>
<features>
SSL
!Schannel
</features>
<server>
https Server-localhost-sv.pem
Expand Down

0 comments on commit 3543fc6

Please sign in to comment.