Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,16 @@ jobs:
if: runner.os == 'macOS'
run: brew install autoconf automake libtool

- name: Resolve wolfSSL master commit
id: wolfssl-rev
run: echo "sha=$(git ls-remote https://github.com/wolfSSL/wolfssl.git HEAD | cut -f1)" >> "$GITHUB_OUTPUT"

- name: Cache wolfSSL
id: cache-wolfssl
uses: actions/cache@v4
with:
path: ~/wolfssl-install
key: wolfssl-${{ matrix.os }}-v3-full
key: wolfssl-${{ matrix.os }}-master-${{ steps.wolfssl-rev.outputs.sha }}

- name: Build wolfSSL
if: steps.cache-wolfssl.outputs.cache-hit != 'true'
Expand All @@ -61,23 +65,23 @@ jobs:
- name: Build wolfCOSE
run: |
export WOLFSSL_DIR=$HOME/wolfssl-install
make CFLAGS="-std=c11 -Os -Wall -Wextra -Wpedantic -Wshadow -Wconversion -I./include -I$WOLFSSL_DIR/include" \
make CFLAGS="-std=c99 -DHAVE_ANONYMOUS_INLINE_AGGREGATES=1 -Os -Wall -Wextra -Wpedantic -Wshadow -Wconversion -I./include -isystem $WOLFSSL_DIR/include" \
LDFLAGS="-L$WOLFSSL_DIR/lib -lwolfssl"

- name: Run unit tests
run: |
export WOLFSSL_DIR=$HOME/wolfssl-install
export LD_LIBRARY_PATH=$WOLFSSL_DIR/lib
export DYLD_LIBRARY_PATH=$WOLFSSL_DIR/lib
make test CFLAGS="-std=c11 -Os -Wall -Wextra -Wpedantic -Wshadow -Wconversion -I./include -I$WOLFSSL_DIR/include" \
make test CFLAGS="-std=c99 -DHAVE_ANONYMOUS_INLINE_AGGREGATES=1 -Os -Wall -Wextra -Wpedantic -Wshadow -Wconversion -I./include -isystem $WOLFSSL_DIR/include" \
LDFLAGS="-L$WOLFSSL_DIR/lib -lwolfssl"

- name: Run tool round-trip test
run: |
export WOLFSSL_DIR=$HOME/wolfssl-install
export LD_LIBRARY_PATH=$WOLFSSL_DIR/lib
export DYLD_LIBRARY_PATH=$WOLFSSL_DIR/lib
make tool-test CFLAGS="-std=c11 -Os -Wall -Wextra -Wpedantic -Wshadow -Wconversion -I./include -I$WOLFSSL_DIR/include" \
make tool-test CFLAGS="-std=c99 -DHAVE_ANONYMOUS_INLINE_AGGREGATES=1 -Os -Wall -Wextra -Wpedantic -Wshadow -Wconversion -I./include -isystem $WOLFSSL_DIR/include" \
LDFLAGS="-L$WOLFSSL_DIR/lib -lwolfssl"

coverage:
Expand All @@ -92,12 +96,16 @@ jobs:
sudo apt-get update
sudo apt-get install -y autoconf automake libtool lcov

- name: Resolve wolfSSL master commit
id: wolfssl-rev
run: echo "sha=$(git ls-remote https://github.com/wolfSSL/wolfssl.git HEAD | cut -f1)" >> "$GITHUB_OUTPUT"

- name: Cache wolfSSL
id: cache-wolfssl
uses: actions/cache@v4
with:
path: ~/wolfssl-install
key: wolfssl-ubuntu-latest-coverage-v3-full
key: wolfssl-ubuntu-latest-coverage-master-${{ steps.wolfssl-rev.outputs.sha }}

- name: Build wolfSSL
if: steps.cache-wolfssl.outputs.cache-hit != 'true'
Expand All @@ -121,14 +129,14 @@ jobs:
run: |
export WOLFSSL_DIR=$HOME/wolfssl-install
make clean
make CFLAGS="-std=c11 -Os --coverage -I./include -I$WOLFSSL_DIR/include" \
make CFLAGS="-std=c99 -DHAVE_ANONYMOUS_INLINE_AGGREGATES=1 -Os --coverage -I./include -isystem $WOLFSSL_DIR/include" \
LDFLAGS="--coverage -L$WOLFSSL_DIR/lib -lwolfssl"

- name: Run tests with coverage
run: |
export WOLFSSL_DIR=$HOME/wolfssl-install
export LD_LIBRARY_PATH=$WOLFSSL_DIR/lib
make test CFLAGS="-std=c11 -Os --coverage -I./include -I$WOLFSSL_DIR/include" \
make test CFLAGS="-std=c99 -DHAVE_ANONYMOUS_INLINE_AGGREGATES=1 -Os --coverage -I./include -isystem $WOLFSSL_DIR/include" \
LDFLAGS="--coverage -L$WOLFSSL_DIR/lib -lwolfssl"

- name: Generate coverage report
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/c99-compliance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: C99 Compliance

on:
push:
branches: [ 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
c99-check:
name: ISO C99 conformance (${{ matrix.cc }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
cc: [gcc, clang]

steps:
- uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y autoconf automake libtool

- name: Resolve wolfSSL master commit
id: wolfssl-rev
run: echo "sha=$(git ls-remote https://github.com/wolfSSL/wolfssl.git HEAD | cut -f1)" >> "$GITHUB_OUTPUT"
- name: Cache wolfSSL
id: cache-wolfssl
uses: actions/cache@v4
with:
path: ~/wolfssl-install
key: wolfssl-ubuntu-latest-v3-full-${{ steps.wolfssl-rev.outputs.sha }}

- name: Build wolfSSL
if: steps.cache-wolfssl.outputs.cache-hit != 'true'
run: |
cd ~
git clone --depth 1 https://github.com/wolfSSL/wolfssl.git
cd wolfssl
./autogen.sh
./configure --enable-ecc --enable-ed25519 --enable-ed448 \
--enable-curve25519 --enable-curve448 \
--enable-aesgcm --enable-aesccm \
--enable-sha384 --enable-sha512 \
--enable-keygen --enable-hkdf --enable-aeskeywrap \
--enable-chacha --enable-poly1305 \
--enable-dilithium --enable-rsapss \
--prefix=$HOME/wolfssl-install
make -j$(nproc)
make install

- name: Strict C99 conformance gate
run: |
make c99-check CC=${{ matrix.cc }} WOLFSSL_INC=$HOME/wolfssl-install/include
9 changes: 6 additions & 3 deletions .github/workflows/comprehensive-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,15 @@ jobs:
sudo apt-get update
sudo apt-get install -y autoconf automake libtool

- name: Resolve wolfSSL master commit
id: wolfssl-rev
run: echo "sha=$(git ls-remote https://github.com/wolfSSL/wolfssl.git HEAD | cut -f1)" >> "$GITHUB_OUTPUT"
- name: Cache wolfSSL
id: cache-wolfssl
uses: actions/cache@v4
with:
path: ~/wolfssl-install
key: wolfssl-ubuntu-latest-comprehensive-v1
key: wolfssl-ubuntu-latest-comprehensive-v1-${{ steps.wolfssl-rev.outputs.sha }}

- name: Build wolfSSL
if: steps.cache-wolfssl.outputs.cache-hit != 'true'
Expand All @@ -50,14 +53,14 @@ jobs:
- name: Build wolfCOSE
run: |
export WOLFSSL_DIR=$HOME/wolfssl-install
make CFLAGS="-std=c11 -Os -Wall -Wextra -Wpedantic -Wshadow -Wconversion -fstack-usage -I./include -I$WOLFSSL_DIR/include" \
make CFLAGS="-std=c99 -DHAVE_ANONYMOUS_INLINE_AGGREGATES=1 -Os -Wall -Wextra -Wpedantic -Wshadow -Wconversion -fstack-usage -I./include -isystem $WOLFSSL_DIR/include" \
LDFLAGS="-L$WOLFSSL_DIR/lib -lwolfssl"

- name: Run comprehensive tests
run: |
export WOLFSSL_DIR=$HOME/wolfssl-install
export LD_LIBRARY_PATH=$WOLFSSL_DIR/lib
make comprehensive CFLAGS="-std=c11 -Os -Wall -Wextra -Wpedantic -Wshadow -Wconversion -fstack-usage -I./include -I$WOLFSSL_DIR/include" \
make comprehensive CFLAGS="-std=c99 -DHAVE_ANONYMOUS_INLINE_AGGREGATES=1 -Os -Wall -Wextra -Wpedantic -Wshadow -Wconversion -fstack-usage -I./include -isystem $WOLFSSL_DIR/include" \
LDFLAGS="-L$WOLFSSL_DIR/lib -lwolfssl"

- name: Test Summary
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@ jobs:
sudo apt-get update
sudo apt-get install -y autoconf automake libtool lcov

- name: Resolve wolfSSL master commit
id: wolfssl-rev
run: echo "sha=$(git ls-remote https://github.com/wolfSSL/wolfssl.git HEAD | cut -f1)" >> "$GITHUB_OUTPUT"
- name: Cache wolfSSL
id: cache-wolfssl
uses: actions/cache@v4
with:
path: ~/wolfssl-install
key: wolfssl-ubuntu-latest-v3
key: wolfssl-ubuntu-latest-v3-${{ steps.wolfssl-rev.outputs.sha }}

- name: Build wolfSSL
if: steps.cache-wolfssl.outputs.cache-hit != 'true'
Expand All @@ -52,7 +55,7 @@ jobs:
export WOLFSSL_DIR=$HOME/wolfssl-install
export LD_LIBRARY_PATH=$WOLFSSL_DIR/lib
make coverage-force-failure CC=gcc \
CFLAGS="-std=c11 -Os -Wall -Wextra -Wpedantic -Wshadow -Wconversion -I./include -I$WOLFSSL_DIR/include" \
CFLAGS="-std=c99 -DHAVE_ANONYMOUS_INLINE_AGGREGATES=1 -Os -Wall -Wextra -Wpedantic -Wshadow -Wconversion -I./include -isystem $WOLFSSL_DIR/include" \
LDFLAGS="-L$WOLFSSL_DIR/lib -lwolfssl"

- name: Check coverage thresholds
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/coverity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,15 @@ jobs:
sudo apt-get update
sudo apt-get install -y autoconf automake libtool

- name: Resolve wolfSSL master commit
id: wolfssl-rev
run: echo "sha=$(git ls-remote https://github.com/wolfSSL/wolfssl.git HEAD | cut -f1)" >> "$GITHUB_OUTPUT"
- name: Cache wolfSSL
id: cache-wolfssl
uses: actions/cache@v4
with:
path: ~/wolfssl-install
key: wolfssl-coverity-v3
key: wolfssl-coverity-v3-${{ steps.wolfssl-rev.outputs.sha }}

- name: Build wolfSSL
if: steps.cache-wolfssl.outputs.cache-hit != 'true'
Expand All @@ -55,4 +58,4 @@ jobs:
token: ${{ secrets.COVERITY_SCAN_TOKEN }}
email: ${{ secrets.COVERITY_SCAN_EMAIL }}
command: |
make CFLAGS="-std=c11 -Os -Wall -Wextra -Wpedantic -Wshadow -Wconversion -I./include -I$HOME/wolfssl-install/include" LDFLAGS="-L$HOME/wolfssl-install/lib -lwolfssl"
make CFLAGS="-std=c99 -DHAVE_ANONYMOUS_INLINE_AGGREGATES=1 -Os -Wall -Wextra -Wpedantic -Wshadow -Wconversion -I./include -isystem $HOME/wolfssl-install/include" LDFLAGS="-L$HOME/wolfssl-install/lib -lwolfssl"
11 changes: 7 additions & 4 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,15 @@ jobs:
sudo apt-get update
sudo apt-get install -y autoconf automake libtool

- name: Resolve wolfSSL master commit
id: wolfssl-rev
run: echo "sha=$(git ls-remote https://github.com/wolfSSL/wolfssl.git HEAD | cut -f1)" >> "$GITHUB_OUTPUT"
- name: Cache wolfSSL
id: cache-wolfssl
uses: actions/cache@v4
with:
path: ~/wolfssl-install
key: wolfssl-ubuntu-latest-v3
key: wolfssl-ubuntu-latest-v3-${{ steps.wolfssl-rev.outputs.sha }}

- name: Build wolfSSL
if: steps.cache-wolfssl.outputs.cache-hit != 'true'
Expand All @@ -50,21 +53,21 @@ jobs:
- name: Build wolfCOSE
run: |
export WOLFSSL_DIR=$HOME/wolfssl-install
make CFLAGS="-std=c11 -Os -Wall -Wextra -Wpedantic -Wshadow -Wconversion -fstack-usage -I./include -I$WOLFSSL_DIR/include" \
make CFLAGS="-std=c99 -DHAVE_ANONYMOUS_INLINE_AGGREGATES=1 -Os -Wall -Wextra -Wpedantic -Wshadow -Wconversion -fstack-usage -I./include -isystem $WOLFSSL_DIR/include" \
LDFLAGS="-L$WOLFSSL_DIR/lib -lwolfssl"

- name: Run lifecycle demo (all algorithms)
run: |
export WOLFSSL_DIR=$HOME/wolfssl-install
export LD_LIBRARY_PATH=$WOLFSSL_DIR/lib
make demo CFLAGS="-std=c11 -Os -Wall -Wextra -Wpedantic -Wshadow -Wconversion -fstack-usage -I./include -I$WOLFSSL_DIR/include" \
make demo CFLAGS="-std=c99 -DHAVE_ANONYMOUS_INLINE_AGGREGATES=1 -Os -Wall -Wextra -Wpedantic -Wshadow -Wconversion -fstack-usage -I./include -isystem $WOLFSSL_DIR/include" \
LDFLAGS="-L$WOLFSSL_DIR/lib -lwolfssl"

- name: Run tool round-trip test (all algorithms)
run: |
export WOLFSSL_DIR=$HOME/wolfssl-install
export LD_LIBRARY_PATH=$WOLFSSL_DIR/lib
make tool-test CFLAGS="-std=c11 -Os -Wall -Wextra -Wpedantic -Wshadow -Wconversion -fstack-usage -I./include -I$WOLFSSL_DIR/include" \
make tool-test CFLAGS="-std=c99 -DHAVE_ANONYMOUS_INLINE_AGGREGATES=1 -Os -Wall -Wextra -Wpedantic -Wshadow -Wconversion -fstack-usage -I./include -isystem $WOLFSSL_DIR/include" \
LDFLAGS="-L$WOLFSSL_DIR/lib -lwolfssl"

- name: Binary size audit
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/minimal-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,16 @@ jobs:
sudo apt-get update
sudo apt-get install -y autoconf automake libtool

- name: Resolve wolfSSL master commit
id: wolfssl-rev
run: echo "sha=$(git ls-remote https://github.com/wolfSSL/wolfssl.git HEAD | cut -f1)" >> "$GITHUB_OUTPUT"

- name: Cache wolfSSL (${{ matrix.name }})
id: cache-wolfssl
uses: actions/cache@v4
with:
path: ~/wolfssl-minimal
key: ${{ matrix.cache_key }}
key: ${{ matrix.cache_key }}-${{ steps.wolfssl-rev.outputs.sha }}

- name: Build wolfSSL (${{ matrix.name }})
if: steps.cache-wolfssl.outputs.cache-hit != 'true'
Expand All @@ -77,19 +81,19 @@ jobs:
- name: Build wolfCOSE
run: |
export WOLFSSL_DIR=$HOME/wolfssl-minimal
make CFLAGS="-std=c11 -Os -Wall -Wextra -Wpedantic -Wshadow -Wconversion -I./include -I$WOLFSSL_DIR/include" \
make CFLAGS="-std=c99 -DHAVE_ANONYMOUS_INLINE_AGGREGATES=1 -Os -Wall -Wextra -Wpedantic -Wshadow -Wconversion -I./include -isystem $WOLFSSL_DIR/include" \
LDFLAGS="-L$WOLFSSL_DIR/lib -lwolfssl"

- name: Run unit tests
run: |
export WOLFSSL_DIR=$HOME/wolfssl-minimal
export LD_LIBRARY_PATH=$WOLFSSL_DIR/lib
make test CFLAGS="-std=c11 -Os -Wall -Wextra -Wpedantic -Wshadow -Wconversion -I./include -I$WOLFSSL_DIR/include" \
make test CFLAGS="-std=c99 -DHAVE_ANONYMOUS_INLINE_AGGREGATES=1 -Os -Wall -Wextra -Wpedantic -Wshadow -Wconversion -I./include -isystem $WOLFSSL_DIR/include" \
LDFLAGS="-L$WOLFSSL_DIR/lib -lwolfssl"

- name: Run tool round-trip test
run: |
export WOLFSSL_DIR=$HOME/wolfssl-minimal
export LD_LIBRARY_PATH=$WOLFSSL_DIR/lib
make tool-test CFLAGS="-std=c11 -Os -Wall -Wextra -Wpedantic -Wshadow -Wconversion -I./include -I$WOLFSSL_DIR/include" \
make tool-test CFLAGS="-std=c99 -DHAVE_ANONYMOUS_INLINE_AGGREGATES=1 -Os -Wall -Wextra -Wpedantic -Wshadow -Wconversion -I./include -isystem $WOLFSSL_DIR/include" \
LDFLAGS="-L$WOLFSSL_DIR/lib -lwolfssl"
5 changes: 4 additions & 1 deletion .github/workflows/misra-2012.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,15 @@ jobs:
sudo apt-get update
sudo apt-get install -y cppcheck autoconf automake libtool

- name: Resolve wolfSSL master commit
id: wolfssl-rev
run: echo "sha=$(git ls-remote https://github.com/wolfSSL/wolfssl.git HEAD | cut -f1)" >> "$GITHUB_OUTPUT"
- name: Cache wolfSSL
id: cache-wolfssl
uses: actions/cache@v4
with:
path: ~/wolfssl-install
key: wolfssl-ubuntu-latest-v3
key: wolfssl-ubuntu-latest-v3-${{ steps.wolfssl-rev.outputs.sha }}

- name: Build wolfSSL
if: steps.cache-wolfssl.outputs.cache-hit != 'true'
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/misra-2023.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,15 @@ jobs:
sudo apt-get update
sudo apt-get install -y autoconf automake libtool

- name: Resolve wolfSSL master commit
id: wolfssl-rev
run: echo "sha=$(git ls-remote https://github.com/wolfSSL/wolfssl.git HEAD | cut -f1)" >> "$GITHUB_OUTPUT"
- name: Cache wolfSSL
id: cache-wolfssl
uses: actions/cache@v4
with:
path: ~/wolfssl-install
key: wolfssl-ubuntu-latest-v3
key: wolfssl-ubuntu-latest-v3-${{ steps.wolfssl-rev.outputs.sha }}

- name: Build wolfSSL
if: steps.cache-wolfssl.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -81,7 +84,7 @@ jobs:
# -Wdouble-promotion Rule 10.x implicit float-to-double
# -Wnull-dereference Safety null pointer dereference
# -Wsign-conversion Rule 10.x signed/unsigned conversion
MISRA_FLAGS="-std=c11 -Os \
MISRA_FLAGS="-std=c99 -DHAVE_ANONYMOUS_INLINE_AGGREGATES=1 -Os \
-Wall -Wextra -Wpedantic -Wshadow -Wconversion \
-Wcast-qual -Wstrict-prototypes -Wmissing-prototypes \
-Wold-style-definition -Wdeclaration-after-statement \
Expand All @@ -108,7 +111,7 @@ jobs:
-DWOLFCOSE_CBOR_ENCODE -DWOLFCOSE_CBOR_DECODE \
-DWOLFCOSE_KEY_ENCODE -DWOLFCOSE_KEY_DECODE \
-DWOLFCOSE_FLOAT \
-I./include -I$WOLFSSL_DIR/include"
-I./include -isystem $WOLFSSL_DIR/include"
for f in src/*.c; do
gcc $MISRA_FLAGS -c "$f" -o /dev/null 2>&1 | tee -a compiler-warnings.txt || true
done
Expand Down Expand Up @@ -166,12 +169,15 @@ jobs:
sudo apt-get update
sudo apt-get install -y clang-tidy autoconf automake libtool

- name: Resolve wolfSSL master commit
id: wolfssl-rev
run: echo "sha=$(git ls-remote https://github.com/wolfSSL/wolfssl.git HEAD | cut -f1)" >> "$GITHUB_OUTPUT"
- name: Cache wolfSSL
id: cache-wolfssl
uses: actions/cache@v4
with:
path: ~/wolfssl-install
key: wolfssl-ubuntu-latest-v3
key: wolfssl-ubuntu-latest-v3-${{ steps.wolfssl-rev.outputs.sha }}

- name: Build wolfSSL
if: steps.cache-wolfssl.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -213,7 +219,7 @@ jobs:
#
clang-tidy src/*.c \
-checks='-*,bugprone-*,cert-*,clang-analyzer-*,misc-*,-misc-include-cleaner,-bugprone-branch-clone,-bugprone-easily-swappable-parameters,-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling' \
-- -std=c11 -I./include -I$WOLFSSL_DIR/include \
-- -std=c99 -DHAVE_ANONYMOUS_INLINE_AGGREGATES=1 -I./include -isystem $WOLFSSL_DIR/include \
-DHAVE_ECC -DHAVE_ED25519 -DHAVE_ED448 \
-DWC_RSA_PSS -DHAVE_DILITHIUM \
-DHAVE_AESGCM -DHAVE_AESCCM \
Expand Down
Loading
Loading