|
| 1 | +name: wolfBoot Integration |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ 'master', 'main', 'release/**' ] |
| 6 | + pull_request: |
| 7 | + branches: [ '*' ] |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +concurrency: |
| 11 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 12 | + cancel-in-progress: true |
| 13 | + |
| 14 | +env: |
| 15 | + WOLFBOOT_REPO: https://github.com/wolfSSL/wolfBoot.git |
| 16 | + WOLFBOOT_BRANCH: master |
| 17 | + |
| 18 | +jobs: |
| 19 | + stm32h5_pkcs11_persist: |
| 20 | + name: stm32h5-pkcs11-persist |
| 21 | + if: toLower(github.repository_owner) == 'wolfssl' |
| 22 | + runs-on: ubuntu-24.04 |
| 23 | + container: |
| 24 | + image: ghcr.io/danielinux/m33mu-ci:1.8 |
| 25 | + timeout-minutes: 25 |
| 26 | + |
| 27 | + steps: |
| 28 | + - name: Checkout wolfPKCS11 |
| 29 | + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 |
| 30 | + |
| 31 | + - name: Clone wolfBoot and link tested wolfPKCS11 |
| 32 | + run: | |
| 33 | + set -euxo pipefail |
| 34 | +
|
| 35 | + git config --global --add safe.directory "${GITHUB_WORKSPACE}" |
| 36 | + git clone --depth 1 --branch "${WOLFBOOT_BRANCH}" "${WOLFBOOT_REPO}" wolfboot |
| 37 | + git -C wolfboot config --global --add safe.directory "${GITHUB_WORKSPACE}/wolfboot" |
| 38 | + git -C wolfboot submodule update --init --recursive |
| 39 | + rm -rf wolfboot/lib/wolfPKCS11 |
| 40 | + ln -s "${GITHUB_WORKSPACE}" wolfboot/lib/wolfPKCS11 |
| 41 | + test -L wolfboot/lib/wolfPKCS11 |
| 42 | + test "$(realpath wolfboot/lib/wolfPKCS11)" = "${GITHUB_WORKSPACE}" |
| 43 | +
|
| 44 | + - name: Clean build tree for PKCS11 test (stm32h5) |
| 45 | + working-directory: wolfboot |
| 46 | + run: | |
| 47 | + make clean distclean |
| 48 | +
|
| 49 | + - name: Configure PKCS11 test (stm32h5) |
| 50 | + working-directory: wolfboot |
| 51 | + run: | |
| 52 | + cp config/examples/stm32h5-tz.config .config |
| 53 | +
|
| 54 | + - name: Build persistent PKCS11 test app (stm32h5) |
| 55 | + working-directory: wolfboot |
| 56 | + run: | |
| 57 | + make PKCS11_TESTAPP=1 |
| 58 | +
|
| 59 | + - name: Prepare PKCS11 persistence directory |
| 60 | + run: | |
| 61 | + rm -rf /tmp/m33mu-pkcs11-persist |
| 62 | + mkdir -p /tmp/m33mu-pkcs11-persist |
| 63 | + rm -f /tmp/m33mu-pkcs11-first.log /tmp/m33mu-pkcs11-second.log |
| 64 | +
|
| 65 | + - name: Run PKCS11 first boot (stm32h5) |
| 66 | + run: | |
| 67 | + cd /tmp/m33mu-pkcs11-persist |
| 68 | + m33mu "${GITHUB_WORKSPACE}/wolfboot/wolfboot.bin" \ |
| 69 | + "${GITHUB_WORKSPACE}/wolfboot/test-app/image_v1_signed.bin:0x60000" \ |
| 70 | + --persist --uart-stdout --timeout 120 --expect-bkpt 0x7d \ |
| 71 | + | tee /tmp/m33mu-pkcs11-first.log |
| 72 | +
|
| 73 | + - name: Verify PKCS11 first boot (stm32h5) |
| 74 | + run: | |
| 75 | + grep -q "pkcs11: first boot path, creating persistent objects" /tmp/m33mu-pkcs11-first.log |
| 76 | + grep -q "pkcs11: created persistent PKCS11 objects" /tmp/m33mu-pkcs11-first.log |
| 77 | + grep -q "pkcs11: success" /tmp/m33mu-pkcs11-first.log |
| 78 | + grep -q "\\[BKPT\\] imm=0x7d" /tmp/m33mu-pkcs11-first.log |
| 79 | + grep -q "\\[EXPECT BKPT\\] Success" /tmp/m33mu-pkcs11-first.log |
| 80 | +
|
| 81 | + - name: Run PKCS11 second boot (stm32h5) |
| 82 | + run: | |
| 83 | + cd /tmp/m33mu-pkcs11-persist |
| 84 | + m33mu "${GITHUB_WORKSPACE}/wolfboot/wolfboot.bin" \ |
| 85 | + "${GITHUB_WORKSPACE}/wolfboot/test-app/image_v1_signed.bin:0x60000" \ |
| 86 | + --persist --uart-stdout --timeout 120 --expect-bkpt 0x7f \ |
| 87 | + | tee /tmp/m33mu-pkcs11-second.log |
| 88 | +
|
| 89 | + - name: Verify PKCS11 second boot (stm32h5) |
| 90 | + run: | |
| 91 | + grep -q "pkcs11: second boot path, restoring persistent objects" /tmp/m33mu-pkcs11-second.log |
| 92 | + grep -q "pkcs11: restored persistent PKCS11 objects" /tmp/m33mu-pkcs11-second.log |
| 93 | + grep -q "pkcs11: success" /tmp/m33mu-pkcs11-second.log |
| 94 | + grep -q "\\[BKPT\\] imm=0x7f" /tmp/m33mu-pkcs11-second.log |
| 95 | + grep -q "\\[EXPECT BKPT\\] Success" /tmp/m33mu-pkcs11-second.log |
0 commit comments