Skip to content

Commit

Permalink
Add nss interop
Browse files Browse the repository at this point in the history
  • Loading branch information
julek-wolfssl committed Dec 4, 2024
1 parent 35e5074 commit 9168672
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/hostap-vm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
id: cache
with:
path: linux/linux
key: ${{ env.LINUX_REF }}
key: hostap-linux-${{ env.LINUX_REF }}
lookup-only: true

- name: Checkout hostap
Expand Down Expand Up @@ -153,7 +153,7 @@ jobs:
id: cache
with:
path: linux/linux
key: ${{ env.LINUX_REF }}
key: hostap-linux-${{ env.LINUX_REF }}
fail-on-cache-miss: true

- name: show file structure
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/nss.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash

set -e
set -x

# Setup nss cert db
mkdir nssdb
./dist/Debug/bin/certutil -d nssdb -N --empty-password
./dist/Debug/bin/certutil -d nssdb -A -a -i wolfssl/certs/test/server-localhost.pem \
-t TCP -n 'wolf localhost'

# App data for nss
echo Hello from nss > /tmp/in

# TLS 1.3 test
env -C wolfssl ./examples/server/server -v 4 -p 4433 \
-c certs/test/server-localhost.pem -d -w 2>&1 > /tmp/server.log &
sleep 0.1
./dist/Debug/bin/tstclnt -V tls1.3: -h localhost -p 4433 -d nssdb -C -4 -A /tmp/in -v
sleep 0.1

# DTLS 1.3 test
env -C wolfssl ./examples/server/server -v 4 -p 4433 -u \
-c certs/test/server-localhost.pem -d -w 2>&1 > /tmp/server.log &
sleep 0.1
./dist/Debug/bin/tstclnt -V tls1.3: -P client -h localhost -p 4433 -d nssdb -C -4 -A /tmp/in -v
sleep 0.1
91 changes: 91 additions & 0 deletions .github/workflows/nss.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: nss interop Tests

### TODO uncomment stuff

# START OF COMMON SECTION
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# END OF COMMON SECTION

env:
NSS_REF: NSS_3_107_RTM

jobs:
build_nss:
name: Build nss
if: github.repository_owner == 'wolfssl'
runs-on: ubuntu-latest
# This should be a safe limit for the tests to run.
timeout-minutes: 30
steps:
- name: Checking if we have nss in cache
uses: actions/cache@v4
id: cache
with:
path: dist
key: nss-${{ env.NSS_REF }}
lookup-only: true

- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
# Don't prompt for anything
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
# hostap dependencies
sudo apt-get install -y gyp ninja-build
- name: Checkout nss
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: nss-dev/nss
ref: ${{ env.NSS_REF }}
path: nss

- name: Compile nss
if: steps.cache.outputs.cache-hit != 'true'
run: |
hg clone https://hg.mozilla.org/projects/nspr
cd nss
./build.sh
nss_test:
name: Test interop with nss
runs-on: ubuntu-latest
needs: build_nss
timeout-minutes: 10
if: github.repository_owner == 'wolfssl'
steps:
- name: Checking if we have nss in cache
uses: actions/cache/restore@v4
id: cache
with:
path: dist
key: nss-${{ env.NSS_REF }}
fail-on-cache-miss: true

- name: Build wolfSSL
uses: wolfSSL/actions-build-autotools-project@v1
with:
path: wolfssl
configure: --enable-dtls --enable-dtls13
install: false
check: false

- name: Test interop
run: bash wolfssl/.github/workflows/nss.sh

- name: print server logs
if: ${{ failure() }}
run: |
cat /tmp/server.log

0 comments on commit 9168672

Please sign in to comment.