Skip to content

Commit 901384e

Browse files
committed
Init SoftHSMv2 support
- wolfSSL_EVP_PKEY_set1_DH: If both private and public present, output private key - ToTraditionalInline_ex2: Add DH checking - wc_ecc_get_curve_id: check index is not negative - Fix i2d_PKCS8_PRIV_KEY_INFO to actually output pkcs8 instead of just der - wolfSSL_EVP_PKEY2PKCS8: Create duplicate to avoid double free - wolfSSL_DH_generate_key: Fix case where not enough buffer was allocated for 128 bit case - pkcs8_encode: Add DSA and DH support - wolfSSL_d2i_PKCS8_PKEY: Correctly advance buffer - RSA_LOW_MEM: export all integers in compat layer - Add softhsm action - Define - OPENSSL_DH_MAX_MODULUS_BITS - OPENSSL_DSA_MAX_MODULUS_BITS - OPENSSL_RSA_MAX_MODULUS_BITS - Implement - BN_mul_word - i2d_ECPKParameters - PEM_write_bio_PKCS8_PRIV_KEY_INFO - PEM_read_bio_PKCS8_PRIV_KEY_INFO - i2d_PKCS8_PRIV_KEY_INFO - RSA_padding_add_PKCS1_PSS_mgf1 - RSA_verify_PKCS1_PSS_mgf1
1 parent ef063aa commit 901384e

File tree

19 files changed

+569
-73
lines changed

19 files changed

+569
-73
lines changed

.github/workflows/softhsm.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: SoftHSMv2 Tests
2+
3+
# START OF COMMON SECTION
4+
on:
5+
push:
6+
branches: [ 'master', 'main', 'release/**' ]
7+
pull_request:
8+
branches: [ '*' ]
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
# END OF COMMON SECTION
14+
15+
jobs:
16+
build_wolfssl:
17+
name: Build wolfSSL
18+
if: github.repository_owner == 'wolfssl'
19+
# Just to keep it the same as the testing target
20+
runs-on: ubuntu-latest
21+
# This should be a safe limit for the tests to run.
22+
timeout-minutes: 10
23+
steps:
24+
- name: Build wolfSSL
25+
uses: wolfSSL/actions-build-autotools-project@v1
26+
with:
27+
path: wolfssl
28+
configure: --enable-all CFLAGS=-DRSA_MIN_SIZE=1024
29+
install: true
30+
check: false
31+
32+
- name: tar build-dir
33+
run: tar -zcf build-dir.tgz build-dir
34+
35+
- name: Upload built lib
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: wolf-install-softhsm
39+
path: build-dir.tgz
40+
retention-days: 5
41+
42+
softhsm_check:
43+
strategy:
44+
fail-fast: false
45+
matrix:
46+
# List of releases to test
47+
ref: [ 2.6.1 ]
48+
name: ${{ matrix.ref }}
49+
if: github.repository_owner == 'wolfssl'
50+
runs-on: ubuntu-latest
51+
# This should be a safe limit for the tests to run.
52+
timeout-minutes: 20
53+
needs: build_wolfssl
54+
steps:
55+
- name: Install dependencies
56+
run: |
57+
# Don't prompt for anything
58+
export DEBIAN_FRONTEND=noninteractive
59+
sudo apt-get update
60+
sudo apt-get install -y libcppunit-dev
61+
62+
- name: Download lib
63+
uses: actions/download-artifact@v4
64+
with:
65+
name: wolf-install-softhsm
66+
67+
- name: untar build-dir
68+
run: tar -xf build-dir.tgz
69+
70+
- name: Checkout OSP
71+
uses: actions/checkout@v4
72+
with:
73+
repository: wolfssl/osp
74+
path: osp
75+
76+
- name: Checkout SoftHSMv2
77+
uses: actions/checkout@v4
78+
with:
79+
repository: opendnssec/SoftHSMv2
80+
path: softhsm
81+
ref: ${{ matrix.ref }}
82+
83+
# Not using wolfSSL/actions-build-autotools-project@v1 because autogen.sh doesn't work
84+
- name: Build softhsm
85+
working-directory: softhsm
86+
run: |
87+
patch -p1 < $GITHUB_WORKSPACE/osp/softhsm/${{ matrix.ref }}.patch
88+
autoreconf -if
89+
./configure --with-crypto-backend=wolfssl WOLFSSL_INSTALL_DIR=$GITHUB_WORKSPACE/build-dir
90+
make -j
91+
92+
- name: Test softhsm
93+
working-directory: softhsm
94+
run: make -j check

0 commit comments

Comments
 (0)