Skip to content

Commit 585c054

Browse files
authored
Merge pull request #100 from aidangarske/multi-compiler-workflow
multi-compiler.yml - CI Github workflow
2 parents 966c7b9 + 3bb84f0 commit 585c054

File tree

5 files changed

+129
-15
lines changed

5 files changed

+129
-15
lines changed
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: Multi-Compiler 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_wolfprovider:
17+
name: Build with ${{ matrix.CC }}
18+
runs-on: ${{ matrix.OS }}
19+
timeout-minutes: 20
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
include:
24+
- CC: gcc-9
25+
CXX: g++-9
26+
OS: ubuntu-latest
27+
wolfssl_ref: master
28+
- CC: gcc-10
29+
CXX: g++-10
30+
OS: ubuntu-latest
31+
wolfssl_ref: master
32+
- CC: gcc-10
33+
CXX: g++-10
34+
OS: ubuntu-latest
35+
wolfssl_ref: v5.7.4-stable
36+
- CC: gcc-11
37+
CXX: g++-11
38+
OS: ubuntu-latest
39+
wolfssl_ref: master
40+
- CC: gcc-12
41+
CXX: g++-12
42+
OS: ubuntu-latest
43+
wolfssl_ref: master
44+
- CC: clang-12
45+
CXX: clang++-12
46+
OS: ubuntu-22.04
47+
wolfssl_ref: master
48+
- CC: clang-13
49+
CXX: clang++-13
50+
OS: ubuntu-22.04
51+
wolfssl_ref: master
52+
- CC: clang-14
53+
CXX: clang++-14
54+
OS: ubuntu-latest
55+
wolfssl_ref: master
56+
- CC: clang-15
57+
CXX: clang++-15
58+
OS: ubuntu-latest
59+
wolfssl_ref: master
60+
steps:
61+
- name: Checkout wolfProvider
62+
uses: actions/checkout@v4
63+
64+
- name: Install dependencies
65+
run: |
66+
sudo apt-get update
67+
sudo apt-get install -y ${{ matrix.CC }} ${{ matrix.CXX }} automake libtool
68+
69+
# Check if this version of wolfssl/wolfprovider has already been built,
70+
# mark to cache these items on post if we do end up building
71+
- name: Checking wolfSSL/wolfProvider in cache
72+
uses: actions/cache@v4
73+
id: wolfprov-cache
74+
with:
75+
path: |
76+
wolfssl-source
77+
wolfssl-install
78+
wolfprov-install
79+
provider.conf
80+
81+
key: wolfprov-${{ matrix.wolfssl_ref }}-${{ matrix.CC }}-${{ github.sha }}
82+
lookup-only: true
83+
84+
# If wolfssl/wolfprovider have not yet been built, pull ossl from cache
85+
- name: Checking OpenSSL in cache
86+
if: steps.wolfprov-cache.outputs.cache-hit != 'true'
87+
uses: actions/cache@v4
88+
id: openssl-cache
89+
with:
90+
path: |
91+
openssl-source
92+
openssl-install
93+
94+
key: ossl-${{ matrix.CC }}-depends
95+
96+
# If not yet built this version, build it now
97+
- name: Build wolfProvider
98+
if: steps.wolfprov-cache.outputs.cache-hit != 'true'
99+
env:
100+
CC: ${{ matrix.CC }}
101+
CXX: ${{ matrix.CXX }}
102+
run: |
103+
WOLFSSL_TAG=${{ matrix.wolfssl_ref }} ./scripts/build-wolfprovider.sh
104+
105+
- name: Print errors
106+
if: ${{ failure() }}
107+
run: |
108+
if [ -f test-suite.log ]; then
109+
cat test-suite.log
110+
fi
111+
if [ -f config.log ]; then
112+
cat config.log
113+
fi
114+

src/wp_aes_aead.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,7 @@ static int wp_aesgcm_get_rand_iv(wp_AeadCtx* ctx, unsigned char* out,
819819
#ifdef WOLFSSL_AESGCM_STREAM
820820
int rc;
821821

822-
rc = wc_AesGcmInit(&ctx->aes, NULL, 0, ctx->iv, ctx->ivLen);
822+
rc = wc_AesGcmInit(&ctx->aes, NULL, 0, ctx->iv, (word32)ctx->ivLen);
823823
if (rc != 0) {
824824
ok = 0;
825825
}
@@ -1199,7 +1199,7 @@ static int wp_aesgcm_stream_update(wp_AeadCtx *ctx, unsigned char *out,
11991199

12001200
if ((!done) && ok) {
12011201
if (ctx->ivState == IV_STATE_BUFFERED) {
1202-
rc = wc_AesGcmInit(&ctx->aes, NULL, 0, ctx->iv, ctx->ivLen);
1202+
rc = wc_AesGcmInit(&ctx->aes, NULL, 0, ctx->iv, (word32)ctx->ivLen);
12031203
if (rc != 0) {
12041204
ok = 0;
12051205
}

src/wp_rsa_kmgmt.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2224,7 +2224,7 @@ static int wp_rsa_decode_enc_pki(wp_Rsa* rsa, unsigned char* data, word32 len,
22242224
}
22252225
if (ok) {
22262226
/* Decrypt to encoded private key. */
2227-
int ret = wc_DecryptPKCS8Key(data, len, password, passwordSz);
2227+
int ret = wc_DecryptPKCS8Key(data, len, password, (int)passwordSz);
22282228
if (ret <= 0) {
22292229
ok = 0;
22302230
}
@@ -2596,7 +2596,7 @@ static int wp_rsa_encode_spki(const wp_Rsa* rsa, unsigned char* keyData,
25962596
int ok = 1;
25972597
int ret;
25982598

2599-
ret = wc_RsaKeyToPublicDer((RsaKey*)&rsa->key, keyData, *keyLen);
2599+
ret = wc_RsaKeyToPublicDer((RsaKey*)&rsa->key, keyData, (word32)*keyLen);
26002600
if (ret <= 0) {
26012601
ok = 0;
26022602
}
@@ -2692,7 +2692,7 @@ static int wp_rsa_encode_pub(const wp_Rsa* rsa, unsigned char* keyData,
26922692
}
26932693
#else
26942694
/* TODO: Encodes with header. Strip it off. */
2695-
ret = wc_RsaKeyToPublicDer((RsaKey*)&rsa->key, keyData, *keyLen);
2695+
ret = wc_RsaKeyToPublicDer((RsaKey*)&rsa->key, keyData, (word32)*keyLen);
26962696
if (ret <= 0) {
26972697
ok = 0;
26982698
}
@@ -2879,8 +2879,8 @@ static int wp_rsa_encode_enc_pki_size(const wp_RsaEncDecCtx* ctx,
28792879
ok = wp_rsa_encode_pki_size(rsa, &len, RSA_ALGO_ID(ctx));
28802880
if (ok) {
28812881
/* Get encrypted encode private key. */
2882-
if (wc_EncryptPKCS8Key(fakeData, len, NULL, &outSz, "", 0, WP_PKCS5,
2883-
WP_PBES2, ctx->cipher, fakeSalt, sizeof(fakeSalt),
2882+
if (wc_EncryptPKCS8Key(fakeData, (word32)len, NULL, &outSz, "", 0,
2883+
WP_PKCS5, WP_PBES2, ctx->cipher, fakeSalt, sizeof(fakeSalt),
28842884
WP_PKCS12_ITERATIONS_DEFAULT, wp_provctx_get_rng(ctx->provCtx),
28852885
NULL) != LENGTH_ONLY_E) {
28862886
ok = 0;
@@ -2914,7 +2914,7 @@ static int wp_rsa_encode_enc_pki(const wp_RsaEncDecCtx* ctx, const wp_Rsa* rsa,
29142914
{
29152915
int ok = 1;
29162916
size_t len;
2917-
word32 outSz = *keyLen;
2917+
word32 outSz = (word32)*keyLen;
29182918
byte salt[WP_MAX_SALT_SIZE];
29192919
int saltLen = 16;
29202920
char password[1024];
@@ -2947,10 +2947,10 @@ static int wp_rsa_encode_enc_pki(const wp_RsaEncDecCtx* ctx, const wp_Rsa* rsa,
29472947
}
29482948
if (ok) {
29492949
/* Encrypt encoded key - in and out buffers must be different. */
2950-
if (wc_EncryptPKCS8Key(encodedKey, len, keyData, &outSz, password,
2951-
passwordSz, WP_PKCS5, WP_PBES2, ctx->cipher, salt, saltLen,
2952-
WP_PKCS12_ITERATIONS_DEFAULT, wp_provctx_get_rng(ctx->provCtx),
2953-
NULL) <= 0) {
2950+
if (wc_EncryptPKCS8Key(encodedKey, (word32)len, keyData, &outSz,
2951+
password, (word32)passwordSz, WP_PKCS5, WP_PBES2, ctx->cipher,
2952+
salt, saltLen, WP_PKCS12_ITERATIONS_DEFAULT,
2953+
wp_provctx_get_rng(ctx->provCtx), NULL) <= 0) {
29542954
ok = 0;
29552955
}
29562956
else {

src/wp_rsa_sig.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,7 @@ static int wp_rsa_sign_x931(wp_RsaSigCtx* ctx, unsigned char* sig,
867867
}
868868
}
869869
if (ok) {
870-
rc = mp_read_unsigned_bin(&toMp, sig, *sigLen);
870+
rc = mp_read_unsigned_bin(&toMp, sig, (word32)*sigLen);
871871
if (rc != MP_OKAY) {
872872
ok = 0;
873873
}
@@ -882,7 +882,7 @@ static int wp_rsa_sign_x931(wp_RsaSigCtx* ctx, unsigned char* sig,
882882
ok = 0;
883883
}
884884
else if (mp_cmp(&toMp, &nMinusTo) == MP_GT) {
885-
rc = mp_to_unsigned_bin_len(&nMinusTo, sig, *sigLen);
885+
rc = mp_to_unsigned_bin_len(&nMinusTo, sig, (int)*sigLen);
886886
if (rc != MP_OKAY) {
887887
ok = 0;
888888
}

test/test_rsa.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,7 @@ int test_rsa_get_params(void *data)
856856
}
857857
}
858858
if (err == 0) {
859-
eRet = BN_bin2bn(e, params[1].return_size, NULL);
859+
eRet = BN_bin2bn(e, (int)params[1].return_size, NULL);
860860
if (eRet == NULL) {
861861
err = 1;
862862
}

0 commit comments

Comments
 (0)