Skip to content

Commit a34a05e

Browse files
authored
Merge pull request gost-engine#526 from Mironenko/support-openssl-4
Enable building the provider with OpenSSL 4.0
2 parents a6039df + 8241540 commit a34a05e

37 files changed

Lines changed: 1395 additions & 940 deletions

.github/script.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22

33
PREFIX=$HOME/opt
44
PATH=$PREFIX/bin:$PATH
5+
BUILD_ENGINE=${GOST_BUILD_ENGINE:+-DGOST_BUILD_ENGINE=$GOST_BUILD_ENGINE}
6+
BUILD_PROVIDER=${GOST_BUILD_PROVIDER:+-DGOST_BUILD_PROVIDER=$GOST_BUILD_PROVIDER}
57

68
mkdir build
79
cd build
8-
cmake -DTLS13_PATCHED_OPENSSL=$PATCH_OPENSSL -DOPENSSL_ROOT_DIR=$PREFIX -DOPENSSL_ENGINES_DIR=$PREFIX/engines ${ASAN-} ..
10+
cmake -DTLS13_PATCHED_OPENSSL=$PATCH_OPENSSL -DOPENSSL_ROOT_DIR=$PREFIX \
11+
-DOPENSSL_ENGINES_DIR=$PREFIX/engines ${ASAN-} \
12+
$BUILD_ENGINE $BUILD_PROVIDER ..
13+
914
make
1015
make test CTEST_OUTPUT_ON_FAILURE=1
1116
if [ -z "${ASAN-}" ]; then
12-
make tcl_tests_engine
13-
make tcl_tests_provider
17+
make tcl_tests
1418
fi

.github/workflows/ci.yml

Lines changed: 84 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,48 +12,89 @@ env:
1212
GOST_PROVIDER_ENABLE_ONLINE_TESTS: 1
1313

1414
jobs:
15-
gcc-openssl-stable:
15+
gcc-engine-openssl-3-6-0:
16+
runs-on: ubuntu-latest
17+
if: ${{ github.event_name != 'schedule' }}
18+
env:
19+
GOST_BUILD_PROVIDER: OFF
20+
steps:
21+
- uses: actions/checkout@v2
22+
with:
23+
submodules: true
24+
- run: .github/before_script.sh
25+
- run: .github/script.sh
26+
27+
clang-engine-openssl-3-6-0:
28+
runs-on: ubuntu-latest
29+
if: ${{ github.event_name != 'schedule' }}
30+
env:
31+
CC: clang
32+
GOST_BUILD_PROVIDER: OFF
33+
steps:
34+
- uses: actions/checkout@v2
35+
with:
36+
submodules: true
37+
- run: .github/before_script.sh
38+
- run: .github/script.sh
39+
40+
macos-engine-openssl-3-6-0:
41+
runs-on: macos-latest
42+
if: ${{ github.event_name != 'schedule' }}
43+
env:
44+
USE_RPATH:
45+
GOST_PROVIDER_ENABLE_ONLINE_TESTS: 0 # macOS runner has no network access to infotecs TLS1.3 server
46+
GOST_BUILD_PROVIDER: OFF
47+
steps:
48+
- uses: actions/checkout@v2
49+
with:
50+
submodules: true
51+
- run: .github/before_script.sh
52+
- run: .github/script.sh
53+
54+
gcc-provider-openssl-3-6-0-patch:
1655
runs-on: ubuntu-latest
1756
if: ${{ github.event_name != 'schedule' }}
1857
env:
1958
PATCH_OPENSSL: 1
59+
GOST_BUILD_ENGINE: OFF
2060
steps:
2161
- uses: actions/checkout@v2
2262
with:
2363
submodules: true
2464
- run: .github/before_script.sh
2565
- run: .github/script.sh
2666

27-
clang-openssl-stable:
67+
clang-provider-openssl-3-6-0-patch:
2868
runs-on: ubuntu-latest
2969
if: ${{ github.event_name != 'schedule' }}
3070
env:
3171
CC: clang
3272
PATCH_OPENSSL: 1
73+
GOST_BUILD_ENGINE: OFF
3374
steps:
3475
- uses: actions/checkout@v2
3576
with:
3677
submodules: true
3778
- run: .github/before_script.sh
3879
- run: .github/script.sh
3980

40-
macos-openssl-stable:
81+
macos-provider-openssl-3-6-0-patch:
4182
runs-on: macos-latest
4283
if: ${{ github.event_name != 'schedule' }}
4384
env:
4485
USE_RPATH:
45-
PATCH_OPENSSL: 1
4686
GOST_PROVIDER_ENABLE_ONLINE_TESTS: 0 # macOS runner has no network access to infotecs TLS1.3 server
87+
PATCH_OPENSSL: 1
88+
GOST_BUILD_ENGINE: OFF
4789
steps:
4890
- uses: actions/checkout@v2
4991
with:
5092
submodules: true
5193
- run: .github/before_script.sh
5294
- run: .github/script.sh
5395

54-
gcc-openssl-master:
96+
gcc-provider-openssl-master:
5597
runs-on: ubuntu-latest
56-
if: ${{ github.event_name == 'schedule' }}
5798
env:
5899
OPENSSL_BRANCH: master
59100
steps:
@@ -63,24 +104,37 @@ jobs:
63104
- run: .github/before_script.sh
64105
- run: .github/script.sh
65106

66-
macos-openssl-master:
107+
clang-provider-openssl-4-0-0:
108+
runs-on: ubuntu-latest
109+
if: ${{ github.event_name != 'schedule' }}
110+
env:
111+
CC: clang
112+
OPENSSL_BRANCH: openssl-4.0.0
113+
steps:
114+
- uses: actions/checkout@v2
115+
with:
116+
submodules: true
117+
- run: .github/before_script.sh
118+
- run: .github/script.sh
119+
120+
macos-provider-openssl-4-0-0:
67121
runs-on: macos-latest
68-
if: ${{ github.event_name == 'schedule' }}
122+
if: ${{ github.event_name != 'schedule' }}
69123
env:
70-
OPENSSL_BRANCH: master
124+
OPENSSL_BRANCH: openssl-4.0.0
71125
USE_RPATH:
126+
GOST_PROVIDER_ENABLE_ONLINE_TESTS: 0 # macOS runner has no network access to infotecs TLS1.3 server
72127
steps:
73128
- uses: actions/checkout@v2
74129
with:
75130
submodules: true
76131
- run: .github/before_script.sh
77132
- run: .github/script.sh
78133

79-
gcc-asan-openssl-master:
134+
gcc-asan-openssl-4-0-0:
80135
runs-on: ubuntu-latest
81-
if: ${{ github.event_name == 'schedule' }}
82136
env:
83-
OPENSSL_BRANCH: master
137+
OPENSSL_BRANCH: openssl-4.0.0
84138
ASAN: -DASAN=1
85139
steps:
86140
- uses: actions/checkout@v2
@@ -89,11 +143,10 @@ jobs:
89143
- run: .github/before_script.sh
90144
- run: .github/script.sh
91145

92-
macos-asan-openssl-master:
146+
macos-asan-openssl-4-0-0:
93147
runs-on: macos-latest
94-
if: ${{ github.event_name == 'schedule' }}
95148
env:
96-
OPENSSL_BRANCH: master
149+
OPENSSL_BRANCH: openssl-4.0.0
97150
ASAN: -DASAN=1
98151
USE_RPATH:
99152
steps:
@@ -103,7 +156,7 @@ jobs:
103156
- run: .github/before_script.sh
104157
- run: .github/script.sh
105158

106-
gcc-openssl-stable-x86:
159+
gcc-openssl-3-6-0-x86:
107160
runs-on: ubuntu-latest
108161
if: ${{ github.event_name == 'schedule' }}
109162
env:
@@ -119,3 +172,18 @@ jobs:
119172
- run: .github/before_script.sh
120173
- run: .github/script.sh
121174

175+
gcc-openssl-4-0-0-x86:
176+
runs-on: ubuntu-latest
177+
if: ${{ github.event_name == 'schedule' }}
178+
env:
179+
CFLAGS: -m32
180+
LDFLAGS: -m32
181+
SETARCH: "setarch i386"
182+
APT_INSTALL: gcc-multilib
183+
OPENSSL_BRANCH: openssl-4.0.0
184+
steps:
185+
- uses: actions/checkout@v2
186+
with:
187+
submodules: true
188+
- run: .github/before_script.sh
189+
- run: .github/script.sh

.github/workflows/windows.yml

Lines changed: 155 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ name: CI (windows)
22
on: [push, pull_request]
33

44
jobs:
5-
msvc-openssl:
5+
msvc-openssl-3-6-0-patch:
66
runs-on: windows-latest
77
outputs:
8-
openssl-head: ${{ steps.openssl.outputs.head }}
8+
openssl-head: ${{ steps.openssl.outputs.head }}-${{ steps.patches.outputs.id }}
99
steps:
1010
- uses: actions/checkout@v2
1111
- uses: actions/checkout@v2
@@ -16,11 +16,13 @@ jobs:
1616
fetch-depth: 0
1717
- run: echo "::set-output name=head::$(git -C openssl describe --always --long)"
1818
id: openssl
19+
- run: echo "::set-output name=id::$(git rev-parse HEAD:patches)"
20+
id: patches
1921
- uses: actions/cache@v4
2022
id: cache
2123
with:
2224
path: openssl/_dest
23-
key: ${{ runner.os }}-openssl-${{ steps.openssl.outputs.head }}
25+
key: ${{ runner.os }}-openssl-${{ steps.openssl.outputs.head }}-${{ steps.patches.outputs.id }}
2426
- name: Apply patches
2527
run: |
2628
git apply patches/openssl-tls1.3.patch
@@ -36,8 +38,155 @@ jobs:
3638
nmake /S build_libs build_programs
3739
nmake /S install_sw DESTDIR=_dest
3840
39-
msvc-engine:
40-
needs: msvc-openssl
41+
msvc-openssl-3-6-0:
42+
runs-on: windows-latest
43+
outputs:
44+
openssl-head: ${{ steps.openssl.outputs.head }}
45+
steps:
46+
- uses: actions/checkout@v2
47+
- uses: actions/checkout@v2
48+
with:
49+
repository: openssl/openssl
50+
path: openssl
51+
ref: openssl-3.6.0
52+
fetch-depth: 0
53+
- run: echo "::set-output name=head::$(git -C openssl describe --always --long)"
54+
id: openssl
55+
- uses: actions/cache@v4
56+
id: cache
57+
with:
58+
path: openssl/_dest
59+
key: ${{ runner.os }}-openssl-${{ steps.openssl.outputs.head }}
60+
- uses: ilammy/msvc-dev-cmd@v1
61+
- name: Build OpenSSL
62+
if: steps.cache.outputs.cache-hit != 'true'
63+
working-directory: openssl
64+
run: |
65+
perl Configure no-makedepend no-tests no-asm VC-WIN64A
66+
perl configdata.pm --dump
67+
nmake /S build_libs build_programs
68+
nmake /S install_sw DESTDIR=_dest
69+
70+
msvc-openssl-4-0-0:
71+
runs-on: windows-latest
72+
outputs:
73+
openssl-head: ${{ steps.openssl.outputs.head }}
74+
steps:
75+
- uses: actions/checkout@v2
76+
- uses: actions/checkout@v2
77+
with:
78+
repository: openssl/openssl
79+
path: openssl
80+
ref: openssl-4.0.0
81+
fetch-depth: 0
82+
- run: echo "::set-output name=head::$(git -C openssl describe --always --long)"
83+
id: openssl
84+
- uses: actions/cache@v4
85+
id: cache
86+
with:
87+
path: openssl/_dest
88+
key: ${{ runner.os }}-openssl-${{ steps.openssl.outputs.head }}
89+
- uses: ilammy/msvc-dev-cmd@v1
90+
- name: Build OpenSSL
91+
if: steps.cache.outputs.cache-hit != 'true'
92+
working-directory: openssl
93+
run: |
94+
perl Configure no-makedepend no-tests no-asm VC-WIN64A
95+
perl configdata.pm --dump
96+
nmake /S build_libs build_programs
97+
nmake /S install_sw DESTDIR=_dest
98+
99+
msvc-openssl-master:
100+
runs-on: windows-latest
101+
outputs:
102+
openssl-head: ${{ steps.openssl.outputs.head }}
103+
steps:
104+
- uses: actions/checkout@v2
105+
- uses: actions/checkout@v2
106+
with:
107+
repository: openssl/openssl
108+
path: openssl
109+
ref: master
110+
fetch-depth: 0
111+
- run: echo "::set-output name=head::$(git -C openssl describe --always --long)"
112+
id: openssl
113+
- uses: actions/cache@v4
114+
id: cache
115+
with:
116+
path: openssl/_dest
117+
key: ${{ runner.os }}-openssl-${{ steps.openssl.outputs.head }}
118+
- uses: ilammy/msvc-dev-cmd@v1
119+
- name: Build OpenSSL
120+
if: steps.cache.outputs.cache-hit != 'true'
121+
working-directory: openssl
122+
run: |
123+
perl Configure no-makedepend no-tests no-asm VC-WIN64A
124+
perl configdata.pm --dump
125+
nmake /S build_libs build_programs
126+
nmake /S install_sw DESTDIR=_dest
127+
128+
msvc-engine-openssl-3-6-0:
129+
needs: msvc-openssl-3-6-0
130+
runs-on: windows-latest
131+
steps:
132+
- uses: actions/checkout@v2
133+
with:
134+
submodules: true
135+
- uses: actions/cache@v4
136+
with:
137+
path: openssl/_dest
138+
key: ${{ runner.os }}-openssl-${{ needs.msvc-openssl-3-6-0.outputs.openssl-head }}
139+
- run: cmake -DOPENSSL_ROOT_DIR="openssl\_dest\Program Files\OpenSSL" -DOPENSSL_ENGINES_DIR=bin -DGOST_BUILD_PROVIDER=0 .
140+
- run: cmake --build .
141+
- name: Run tests
142+
run: |
143+
$env:OPENSSL_ENGINES = "$pwd\bin\Debug"
144+
$env:OPENSSL_MODULES = "$pwd\bin\Debug"
145+
Copy-Item -Path "$pwd\openssl\_dest\Program Files\OpenSSL\bin\*.dll" -Destination "$pwd\bin\Debug"
146+
ctest -C Debug --output-on-failure
147+
148+
msvc-provider-openssl-3-6-0-patch:
149+
needs: msvc-openssl-3-6-0-patch
150+
runs-on: windows-latest
151+
steps:
152+
- uses: actions/checkout@v2
153+
with:
154+
submodules: true
155+
- uses: actions/cache@v4
156+
with:
157+
path: openssl/_dest
158+
key: ${{ runner.os }}-openssl-${{ needs.msvc-openssl-3-6-0-patch.outputs.openssl-head }}
159+
- run: cmake -DOPENSSL_ROOT_DIR="openssl\_dest\Program Files\OpenSSL" -DOPENSSL_ENGINES_DIR=bin -DGOST_BUILD_ENGINE=OFF .
160+
- run: cmake --build .
161+
- name: Run tests
162+
run: |
163+
$env:OPENSSL_ENGINES = "$pwd\bin\Debug"
164+
$env:OPENSSL_MODULES = "$pwd\bin\Debug"
165+
Copy-Item -Path "$pwd\openssl\_dest\Program Files\OpenSSL\bin\*.dll" -Destination "$pwd\bin\Debug"
166+
ctest -C Debug --output-on-failure
167+
168+
msvc-provider-openssl-4-0-0:
169+
needs: msvc-openssl-4-0-0
170+
runs-on: windows-latest
171+
steps:
172+
- uses: actions/checkout@v2
173+
with:
174+
submodules: true
175+
- uses: actions/cache@v4
176+
with:
177+
path: openssl/_dest
178+
key: ${{ runner.os }}-openssl-${{ needs.msvc-openssl-4-0-0.outputs.openssl-head }}
179+
- run: cmake -DOPENSSL_ROOT_DIR="openssl\_dest\Program Files\OpenSSL" -DOPENSSL_ENGINES_DIR=bin .
180+
- run: cmake --build .
181+
- name: Run tests
182+
run: |
183+
$env:OPENSSL_ENGINES = "$pwd\bin\Debug"
184+
$env:OPENSSL_MODULES = "$pwd\bin\Debug"
185+
Copy-Item -Path "$pwd\openssl\_dest\Program Files\OpenSSL\bin\*.dll" -Destination "$pwd\bin\Debug"
186+
ctest -C Debug --output-on-failure
187+
188+
msvc-provider-openssl-master:
189+
needs: msvc-openssl-master
41190
runs-on: windows-latest
42191
steps:
43192
- uses: actions/checkout@v2
@@ -46,7 +195,7 @@ jobs:
46195
- uses: actions/cache@v4
47196
with:
48197
path: openssl/_dest
49-
key: ${{ runner.os }}-openssl-${{ needs.msvc-openssl.outputs.openssl-head }}
198+
key: ${{ runner.os }}-openssl-${{ needs.msvc-openssl-master.outputs.openssl-head }}
50199
- run: cmake -DOPENSSL_ROOT_DIR="openssl\_dest\Program Files\OpenSSL" -DOPENSSL_ENGINES_DIR=bin .
51200
- run: cmake --build .
52201
- name: Run tests

0 commit comments

Comments
 (0)