diff options
Diffstat (limited to 'src/regress/lib/libssl/interop/version/Makefile')
-rw-r--r-- | src/regress/lib/libssl/interop/version/Makefile | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/src/regress/lib/libssl/interop/version/Makefile b/src/regress/lib/libssl/interop/version/Makefile new file mode 100644 index 0000000000..0f1d891f34 --- /dev/null +++ b/src/regress/lib/libssl/interop/version/Makefile | |||
@@ -0,0 +1,97 @@ | |||
1 | # $OpenBSD: Makefile,v 1.1 2020/09/14 00:51:04 bluhm Exp $ | ||
2 | |||
3 | # Connect a client to a server. Both can be current libressl, or | ||
4 | # openssl 1.0.2, or openssl 1.1. Pin client or server to a fixed TLS | ||
5 | # version number. Incompatible versions must fail. Check that client | ||
6 | # and server have used correct version by grepping in their session | ||
7 | # print out. | ||
8 | |||
9 | LIBRARIES = libressl | ||
10 | .if exists(/usr/local/bin/eopenssl) | ||
11 | LIBRARIES += openssl | ||
12 | .endif | ||
13 | .if exists(/usr/local/bin/eopenssl11) | ||
14 | LIBRARIES += openssl11 | ||
15 | .endif | ||
16 | |||
17 | VERSIONS = any TLS1 TLS1_1 TLS1_2 TLS1_3 | ||
18 | |||
19 | .for cver in ${VERSIONS} | ||
20 | .for sver in ${VERSIONS} | ||
21 | |||
22 | .if "${cver}" == any || "${sver}" == any || "${cver}" == "${sver}" | ||
23 | FAIL_${cver}_${sver} = | ||
24 | .else | ||
25 | FAIL_${cver}_${sver} = ! | ||
26 | .endif | ||
27 | |||
28 | .for clib in ${LIBRARIES} | ||
29 | .for slib in ${LIBRARIES} | ||
30 | |||
31 | .if ("${clib}" != openssl && "${slib}" != openssl) || \ | ||
32 | ("${cver}" != TLS1_3 && "${sver}" != TLS1_3) | ||
33 | |||
34 | REGRESS_TARGETS += run-version-client-${clib}-${cver}-server-${slib}-${sver} | ||
35 | |||
36 | run-version-client-${clib}-${cver}-server-${slib}-${sver} \ | ||
37 | client-version-client-${clib}-${cver}-server-${slib}-${sver}.out \ | ||
38 | server-version-client-${clib}-${cver}-server-${slib}-${sver}.out: \ | ||
39 | 127.0.0.1.crt ../${clib}/client ../${slib}/server | ||
40 | @echo '\n======== $@ ========' | ||
41 | LD_LIBRARY_PATH=/usr/local/lib/e${slib} \ | ||
42 | ../${slib}/server >${@:S/^run/server/}.out \ | ||
43 | -c 127.0.0.1.crt -k 127.0.0.1.key \ | ||
44 | ${sver:Nany:S/^/-V /} \ | ||
45 | 127.0.0.1 0 | ||
46 | ${FAIL_${cver}_${sver}} \ | ||
47 | LD_LIBRARY_PATH=/usr/local/lib/e${clib} \ | ||
48 | ../${clib}/client >${@:S/^run/client/}.out \ | ||
49 | ${cver:Nany:S/^/-V /} \ | ||
50 | `sed -n 's/listen sock: //p' ${@:S/^run/server/}.out` | ||
51 | .if empty(${FAIL_${cver}_${sver}}) | ||
52 | grep -q '^success$$' ${@:S/^run/server/}.out || \ | ||
53 | { sleep 1; grep -q '^success$$' ${@:S/^run/server/}.out; } | ||
54 | grep -q '^success$$' ${@:S/^run/client/}.out | ||
55 | .endif | ||
56 | |||
57 | .if empty(${FAIL_${cver}_${sver}}) | ||
58 | |||
59 | REGRESS_TARGETS += check-version-client-${clib}-${cver}-server-${slib}-${sver} | ||
60 | |||
61 | check-version-client-${clib}-${cver}-server-${slib}-${sver}: \ | ||
62 | client-version-client-${clib}-${cver}-server-${slib}-${sver}.out \ | ||
63 | server-version-client-${clib}-${cver}-server-${slib}-${sver}.out | ||
64 | @echo '\n======== $@ ========' | ||
65 | @grep ' Protocol *: ' ${@:S/^check/client/}.out | ||
66 | @grep ' Protocol *: ' ${@:S/^check/server/}.out | ||
67 | .if "${cver}" == any | ||
68 | .if "${sver}" == any | ||
69 | .if "${clib}" == openssl || "${slib}" == openssl | ||
70 | grep -q ' Protocol *: TLSv1.2$$' ${@:S/^check/client/}.out | ||
71 | grep -q ' Protocol *: TLSv1.2$$' ${@:S/^check/server/}.out | ||
72 | .else | ||
73 | grep -q ' Protocol *: TLSv1.3$$' ${@:S/^check/client/}.out | ||
74 | grep -q ' Protocol *: TLSv1.3$$' ${@:S/^check/server/}.out | ||
75 | .endif | ||
76 | .else | ||
77 | grep -q ' Protocol *: ${sver:S/TLS/TLSv/:S/_/./}$$' \ | ||
78 | ${@:S/^check/client/}.out | ||
79 | grep -q ' Protocol *: ${sver:S/TLS/TLSv/:S/_/./}$$' \ | ||
80 | ${@:S/^check/server/}.out | ||
81 | .endif | ||
82 | .else | ||
83 | grep -q ' Protocol *: ${cver:S/TLS/TLSv/:S/_/./}$$' \ | ||
84 | ${@:S/^check/client/}.out | ||
85 | grep -q ' Protocol *: ${cver:S/TLS/TLSv/:S/_/./}$$' \ | ||
86 | ${@:S/^check/server/}.out | ||
87 | .endif | ||
88 | .endif | ||
89 | |||
90 | .endif | ||
91 | |||
92 | .endfor | ||
93 | .endfor | ||
94 | .endfor | ||
95 | .endfor | ||
96 | |||
97 | .include <bsd.regress.mk> | ||