Repository navigation
Convert wolfSSL to lib/wolfssl submodule #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: "gitsubmodule" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "daily" | ||
| commit-message: | ||
| prefix: "[ci]" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| name: wolfSSL submodule build | ||
|
|
||
| # Builds the pinned lib/wolfssl submodule with the documented flags and builds | ||
| # plus tests wolfSPDM against it, so Dependabot pin bumps are gated on CI. The | ||
| # wolfssl-versions.yml matrix still covers latest-stable and master. | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ 'main', 'release/**' ] | ||
| pull_request: | ||
| branches: [ '*' ] | ||
| repository_dispatch: | ||
| types: [nightly-trigger] | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| pinned-build: | ||
| name: Build against the pinned wolfSSL submodule | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 25 | ||
| steps: | ||
| - name: Checkout wolfSPDM with direct submodules | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| submodules: true | ||
|
|
||
| - name: Test submodule checkout policy | ||
| run: sh scripts/test-submodule-policy.sh | ||
|
|
||
| - name: Opt in to the standalone wolfSSL checkout | ||
| run: git submodule update --init --checkout lib/wolfssl | ||
|
|
||
| - name: Install build deps | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y autoconf automake libtool | ||
|
|
||
| - name: Build and install the bundled wolfSSL | ||
| run: | | ||
| cd lib/wolfssl | ||
| ./autogen.sh | ||
| ./configure --enable-wolftpm --enable-ecc --enable-sha384 \ | ||
| --enable-aesgcm --enable-hkdf --enable-sp \ | ||
| --prefix=$HOME/wolfssl-install | ||
| make -j"$(nproc)" | ||
| make install | ||
|
|
||
| - name: Build wolfSPDM against the submodule | ||
| run: | | ||
| ./autogen.sh | ||
| ./configure --with-wolfssl=$HOME/wolfssl-install \ | ||
| --enable-nuvoton --enable-nations --enable-responder | ||
| make -j"$(nproc)" | ||
|
|
||
| - name: Run unit tests | ||
| run: | | ||
| export LD_LIBRARY_PATH="$PWD/src/.libs:$HOME/wolfssl-install/lib" | ||
| make check | ||
|
|
||
| - name: Upload failure logs | ||
| if: failure() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: wolfssl-submodule-logs | ||
| path: | | ||
| config.log | ||
| test/*.log | ||
| test-suite.log | ||
| retention-days: 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| [submodule "lib/wolfssl"] | ||
| path = lib/wolfssl | ||
| url = https://github.com/wolfSSL/wolfssl.git | ||
| branch = master | ||
| ignore = dirty | ||
| # Opt in explicitly for standalone builds; skip nested recursive checkouts. | ||
| update = none | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| #!/bin/sh | ||
| # Verify the real .gitmodules policy using small, local Git repositories. | ||
| set -eu | ||
|
|
||
| root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd) | ||
| fixture=$(mktemp -d "${TMPDIR:-/tmp}/wolfspdm-submodules.XXXXXX") | ||
| trap 'rm -rf "$fixture"' EXIT | ||
| export GIT_CONFIG_GLOBAL=/dev/null | ||
| export GIT_CONFIG_NOSYSTEM=1 | ||
|
|
||
| commit_fixture() { | ||
| git -C "$1" -c user.name=Test -c user.email=test@example.com \ | ||
| commit --quiet -m fixture | ||
| } | ||
|
|
||
| assert_skipped() { | ||
| git_dir=$(git -C "$1" rev-parse --absolute-git-dir) | ||
| if [ -e "$1/lib/wolfssl/.git" ] || | ||
| [ -d "$git_dir/modules/lib/wolfssl" ]; then | ||
| echo "FAIL: wolfSPDM downloaded its opt-in wolfSSL: $1" >&2 | ||
| exit 1 | ||
| fi | ||
| } | ||
|
|
||
| git -c init.defaultBranch=master init --quiet "$fixture/wolfssl" | ||
| echo fixture > "$fixture/wolfssl/marker" | ||
| git -C "$fixture/wolfssl" add marker | ||
| commit_fixture "$fixture/wolfssl" | ||
| wolfssl_sha=$(git -C "$fixture/wolfssl" rev-parse HEAD) | ||
|
|
||
| git init --quiet "$fixture/wolfspdm" | ||
| cp "$root/.gitmodules" "$fixture/wolfspdm/.gitmodules" | ||
| git config -f "$fixture/wolfspdm/.gitmodules" \ | ||
| submodule.lib/wolfssl.url "$fixture/wolfssl" | ||
| git -C "$fixture/wolfspdm" add .gitmodules | ||
| git -C "$fixture/wolfspdm" update-index --add --cacheinfo \ | ||
| 160000 "$wolfssl_sha" lib/wolfssl | ||
| commit_fixture "$fixture/wolfspdm" | ||
| wolfspdm_sha=$(git -C "$fixture/wolfspdm" rev-parse HEAD) | ||
|
|
||
| git init --quiet "$fixture/wolftpm" | ||
| for name in wolfssl wolfspdm; do | ||
| case "$name" in | ||
| wolfssl) path=lib/wolfssl; sha=$wolfssl_sha ;; | ||
| wolfspdm) path=lib/wolfSPDM; sha=$wolfspdm_sha ;; | ||
| esac | ||
| git -C "$fixture/wolftpm" config -f .gitmodules \ | ||
| "submodule.$path.path" "$path" | ||
| git -C "$fixture/wolftpm" config -f .gitmodules \ | ||
| "submodule.$path.url" "$fixture/$name" | ||
| git -C "$fixture/wolftpm" update-index --add --cacheinfo \ | ||
| 160000 "$sha" "$path" | ||
| done | ||
| git -C "$fixture/wolftpm" add .gitmodules | ||
| commit_fixture "$fixture/wolftpm" | ||
|
|
||
| git -c protocol.file.allow=always clone --quiet --recursive \ | ||
| "$fixture/wolftpm" "$fixture/recursive" | ||
| test -f "$fixture/recursive/lib/wolfssl/marker" | ||
| assert_skipped "$fixture/recursive/lib/wolfSPDM" | ||
| echo 'PASS: recursive parent clone gets one wolfSSL' | ||
|
|
||
| git clone --quiet "$fixture/wolftpm" "$fixture/update" | ||
| git -C "$fixture/update" -c protocol.file.allow=always \ | ||
| submodule update --quiet --init --force --recursive | ||
| test -f "$fixture/update/lib/wolfssl/marker" | ||
| assert_skipped "$fixture/update/lib/wolfSPDM" | ||
| echo 'PASS: recursive forced update skips nested wolfSSL' | ||
|
|
||
| git -c protocol.file.allow=always clone --quiet --recursive \ | ||
| "$fixture/wolfspdm" "$fixture/standalone" | ||
| assert_skipped "$fixture/standalone" | ||
| git -C "$fixture/standalone" -c protocol.file.allow=always \ | ||
| submodule update --quiet --init lib/wolfssl | ||
| assert_skipped "$fixture/standalone" | ||
| echo 'PASS: standalone wolfSSL requires explicit opt-in' | ||
|
|
||
| git -C "$fixture/standalone" -c protocol.file.allow=always \ | ||
| submodule update --quiet --init --checkout lib/wolfssl | ||
| test -f "$fixture/standalone/lib/wolfssl/marker" | ||
| echo 'PASS: explicit standalone checkout gets the pinned wolfSSL' |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.