11---
2- name : Test kryoptic FIPS module
2+ name : Test kryoptic
33
44on : [push, pull_request, workflow_dispatch]
55
6+ env :
7+ KRYOPTIC_REVISION : main
8+
69jobs :
7- build :
8- name : Test kryoptic FIPS module
10+ tests-kryoptic :
11+ name : Test with kryoptic
912 runs-on : ubuntu-22.04
1013 container : quay.io/fedora/fedora:latest
1114 steps :
2528 path : " /var/cache/libdnf5"
2629 key : fedora-dnf-${{ steps.get-date.outputs.date }}
2730
31+ - name : Install Dependencies
32+ run : |
33+ dnf -y install git cargo clang-devel openssl-devel sqlite-devel
34+
35+ - name : DNF cache
36+ if : ${{ steps.cache-dnf.outputs.cache-hit != 'true' }}
37+ uses : actions/cache/save@v4
38+ with :
39+ path : " /var/cache/libdnf5"
40+ key : fedora-dnf-${{ steps.get-date.outputs.date }}
41+
42+ # #####################
43+ # ## kryoptic build ###
44+ # #####################
45+ - name : Setup kryoptic
46+ run : |
47+ cd ..
48+ git clone https://github.com/latchset/kryoptic.git \
49+ --depth 1 --single-branch --revision "$KRYOPTIC_REVISION" kryoptic
50+
51+ - name : Generate lock file
52+ run : |
53+ cd ../kryoptic &&
54+ cargo generate-lockfile
55+
56+ - name : Cache Rust dependencies
57+ uses : actions/cache@v4
58+ with :
59+ path : |
60+ ~/.cargo/bin/
61+ ~/.cargo/registry/index/
62+ ~/.cargo/registry/cache/
63+ ~/.cargo/git/db/
64+ ../kryoptic/target/
65+ key : fedora-cargo-${{ hashFiles('**/Cargo.lock') }}
66+
67+ - name : Build kryoptic
68+ run : |
69+ FEATURES="standard,pqc,nssdb"
70+
71+ cd kryoptic &&
72+ cargo build -vv --features "$FEATURES"
73+
74+ - name : Checkout rust-cryptoki
75+ uses : actions/checkout@v4
76+
77+ # ################
78+ # ## the tests ###
79+ # ################
80+ - name : Run test script
81+ env :
82+ KRYOPTIC_CONF : /tmp/kryoptic.sql
83+ TEST_PKCS11_MODULE : /__w/rust-cryptoki/kryoptic/target/debug/libkryoptic_pkcs11.so
84+ RUST_BACKTRACE : 1
85+ run : carbo build --all-features && cargo test
86+
87+ tests-kryoptic-fips :
88+ name : Test kryoptic FIPS module
89+ runs-on : ubuntu-22.04
90+ container : quay.io/fedora/fedora:latest
91+ steps :
92+ # ################
93+ # ## DNF cache ###
94+ # ################
95+ - name : Get Date for DNF cache entry
96+ id : get-date
97+ run : |
98+ echo "date=$(/bin/date -u "+%Y%V")" >> $GITHUB_OUTPUT
99+ shell : bash
100+
101+ - name : Restore DNF cache
102+ uses : actions/cache/restore@v4
103+ id : cache-dnf
104+ with :
105+ path : " /var/cache/libdnf5"
106+ key : fedora-dnf-fips-${{ steps.get-date.outputs.date }}
107+
28108 - name : Install Dependencies
29109 run : |
30110 dnf -y install git cargo clang-devel openssl-devel sqlite-devel \
@@ -33,14 +113,14 @@ jobs:
33113 'perl(IPC::Cmd)' 'perl(Pod::Html)' 'perl(Digest::SHA)' \
34114 'perl(Module::Load::Conditional)' 'perl(File::Temp)' \
35115 'perl(Test::Harness)' 'perl(Test::More)' 'perl(Math::BigInt)' \
36- 'perl(Time::Piece)' zlib-devel sed sqlite-devel
116+ 'perl(Time::Piece)' zlib-devel sed
37117
38118 - name : DNF cache
39119 if : ${{ steps.cache-dnf.outputs.cache-hit != 'true' }}
40120 uses : actions/cache/save@v4
41121 with :
42122 path : " /var/cache/libdnf5"
43- key : fedora-dnf-${{ steps.get-date.outputs.date }}
123+ key : fedora-dnf-fips- ${{ steps.get-date.outputs.date }}
44124
45125 # ####################
46126 # ## OpenSSL build ###
82162 # ## kryoptic build ###
83163 # #####################
84164 - name : Setup kryoptic
85- env :
86- KRYOPTIC_REVISION : b38f56bf5dc281fa750146d0378fc62b7c23f95f
87165 run : |
88166 cd ..
89167 git clone https://github.com/latchset/kryoptic.git \
@@ -132,5 +210,5 @@ jobs:
132210 TEST_PKCS11_MODULE : /__w/rust-cryptoki/kryoptic/target/debug/libkryoptic_pkcs11.so
133211 OUT_DIR : /__w/rust-cryptoki/kryoptic/target/debug/deps/
134212 RUST_BACKTRACE : 1
135- run : cargo test
213+ run : carbo build --all-features && cargo test
136214
0 commit comments