|
| 1 | +name: PKCS7 Interoperability |
| 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 | + pkcs7_interop: |
| 17 | + name: PKCS7 interop (OpenSSL, GnuTLS) |
| 18 | + if: github.repository_owner == 'wolfssl' |
| 19 | + runs-on: ubuntu-24.04 |
| 20 | + timeout-minutes: 14 |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@v4 |
| 23 | + |
| 24 | + - name: Install 3rd party PKCS#7 tools |
| 25 | + run: sudo apt-get install -y openssl gnutls-bin |
| 26 | + |
| 27 | + - name: Sign with 3rd party PKCS#7 tools |
| 28 | + run: | |
| 29 | + echo -n "pkcs7 interop test" > $RUNNER_TEMP/content.bin |
| 30 | + openssl req -x509 -newkey rsa:2048 -keyout $RUNNER_TEMP/key.pem \ |
| 31 | + -out $RUNNER_TEMP/cert.pem -days 1 -nodes \ |
| 32 | + -subj "/CN=wolfssl-pkcs7-interop-test" |
| 33 | + openssl cms -sign -binary -nodetach \ |
| 34 | + -in $RUNNER_TEMP/content.bin \ |
| 35 | + -signer $RUNNER_TEMP/cert.pem -inkey $RUNNER_TEMP/key.pem \ |
| 36 | + -md sha256 -outform DER -out $RUNNER_TEMP/openssl_cms.der |
| 37 | + openssl smime -sign -binary -nodetach \ |
| 38 | + -in $RUNNER_TEMP/content.bin \ |
| 39 | + -signer $RUNNER_TEMP/cert.pem -inkey $RUNNER_TEMP/key.pem \ |
| 40 | + -md sha256 -outform DER -out $RUNNER_TEMP/openssl_smime.der |
| 41 | + certtool --p7-sign \ |
| 42 | + --infile $RUNNER_TEMP/content.bin \ |
| 43 | + --load-certificate $RUNNER_TEMP/cert.pem \ |
| 44 | + --load-privkey $RUNNER_TEMP/key.pem \ |
| 45 | + --outder --outfile $RUNNER_TEMP/gnutls.der |
| 46 | +
|
| 47 | + - name: Build wolfSSL |
| 48 | + run: | |
| 49 | + ./autogen.sh |
| 50 | + ./configure --enable-pkcs7 --enable-certext --enable-examples \ |
| 51 | + --with-pkcs7-test-signed-data=$RUNNER_TEMP/openssl_cms.der,$RUNNER_TEMP/openssl_smime.der,$RUNNER_TEMP/gnutls.der |
| 52 | + make -j$(nproc) |
| 53 | +
|
| 54 | + - name: Run PKCS7 interop test |
| 55 | + run: tests/unit.test -test_wc_PKCS7_VerifySignedData_interop |
0 commit comments