-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (75 loc) · 2.82 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: CI
on: [push, pull_request]
jobs:
test-openssls:
name: >-
${{ matrix.openssl }} ${{ matrix.name_extra || '' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- { os: ubuntu-latest, openssl: openssl-3.0.7, fips-enabled: true, name_extra: 'FIPS' }
- { os: ubuntu-latest, openssl: openssl-3.0.7 }
steps:
- name: install deps
run: sudo apt install -qq strace
- name: repo checkout
uses: actions/checkout@v3
- if: matrix.fips-enabled
run: echo "configure_fips_opt=enable-fips" >> $GITHUB_ENV
- name: prepare openssl
run: |
mkdir -p tmp/build-openssl && cd tmp/build-openssl
case ${{ matrix.openssl }} in
openssl-*)
curl -OL https://ftp.openssl.org/source/${{ matrix.openssl }}.tar.gz
tar xf ${{ matrix.openssl }}.tar.gz && cd ${{ matrix.openssl }}
# shared is required for 1.0.x.
./Configure --prefix=$HOME/.openssl/${{ matrix.openssl }} \
shared $configure_fips_opt enable-trace
make depend
;;
*)
false
;;
esac
make -j4
make install_sw
# See <https://github.com/openssl/openssl/blob/master/README-FIPS.md>.
- if: matrix.fips-enabled
name: prepre openssl fips
run: make install_fips
working-directory: tmp/build-openssl/${{ matrix.openssl }}
- if: matrix.fips-enabled
run: ls -l $HOME/.openssl/${{ matrix.openssl }}/ssl/fipsmodule.cnf
- name: compile
run: |
make \
INCFLAGS="-I $HOME/.openssl/${{ matrix.openssl }}/include" \
LDFLAGS="-L $HOME/.openssl/${{ matrix.openssl }}/lib64"
# See <https://www.openssl.org/docs/manmaster/man7/fips_module.html>
# - Selectively making applications use the FIPS module by default
- if: matrix.fips-enabled
run: sed -e "s|@@OPENSSL_DIR@@|$HOME/.openssl/${{ matrix.openssl }}|" ssl/openssl_fips.cnf.tmpl > ssl/openssl_fips.cnf
# Debug
- if: matrix.fips-enabled
run: cat ssl/openssl_fips.cnf
# Change the default OpenSSL config file for FIPS.
- if: matrix.fips-enabled
run: echo "OPENSSL_CONF=$(pwd)/ssl/openssl_fips.cnf" >> $GITHUB_ENV
- name: test FIPS get
run: |
LD_LIBRARY_PATH=$HOME/.openssl/${{ matrix.openssl }}/lib64 \
make test
- name: test FIPS set
run: |
LD_LIBRARY_PATH=$HOME/.openssl/${{ matrix.openssl }}/lib64 \
make test-set
- name: test OpenSSL trace API
run: |
LD_LIBRARY_PATH=$HOME/.openssl/${{ matrix.openssl }}/lib64 \
make test-trace
- if: matrix.fips-enabled
name: strace
run: make strace-test