Skip to content

Commit 53ff5ff

Browse files
committed
Update NSS gtests to use OSP NSS patches
1 parent 1885972 commit 53ff5ff

File tree

2 files changed

+63
-10
lines changed

2 files changed

+63
-10
lines changed

.github/workflows/nss-ssltap-test.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,37 @@ jobs:
9191
path: /tmp/src/dist
9292
key: nss-build-${{ env.NSS_VERSION }}-latest
9393

94+
- name: Clone NSS and apply wolfSSL patches
95+
if: steps.cache-nss-source.outputs.cache-hit != 'true'
96+
run: |
97+
mkdir -p /tmp/src
98+
cd /tmp/src
99+
100+
# Clone official Mozilla NSS with specific tag
101+
hg clone https://hg.mozilla.org/projects/nss -r ${{ env.NSS_VERSION }}
102+
103+
# Clone wolfSSL OSP repository for patches
104+
git clone https://github.com/wolfSSL/osp.git
105+
106+
cd nss
107+
108+
# Apply patches from wolfSSL/osp/nss directory
109+
echo "Applying wolfSSL NSS patches..."
110+
if [ -d "../osp/nss" ]; then
111+
for patch in ../osp/nss/*.patch; do
112+
if [ -f "$patch" ]; then
113+
echo "Applying patch: $(basename $patch)"
114+
patch -p1 < "$patch" || {
115+
echo "Warning: Patch $(basename $patch) failed to apply cleanly"
116+
echo "Attempting to apply with --reject-file option..."
117+
patch -p1 --reject-file=/tmp/$(basename $patch).rej < "$patch" || true
118+
}
119+
fi
120+
done
121+
else
122+
echo "No patches found in wolfSSL/osp/nss directory"
123+
fi
124+
94125
- name: Build NSS
95126
if: steps.cache-nss-build.outputs.cache-hit != 'true'
96127
run: |

.github/workflows/nss.yml

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99

1010
env:
1111
NSPR_VERSION: NSPR_4_36_BRANCH
12+
NSS_VERSION: NSS_3_112_RTM
1213
WOLFSSL_VERSION: v5.8.0-stable
1314
#NSS_DEBUG_PKCS11_MODULE: wolfPKCS11
1415
#NSPR_LOG_MODULES: all:5
@@ -65,27 +66,49 @@ jobs:
6566
if: steps.cache-nspr.outputs.cache-hit != 'true'
6667
run: hg clone https://hg.mozilla.org/projects/nspr -r ${{ env.NSPR_VERSION }}
6768

68-
- name: Cache NSS source
69+
- name: Cache NSS source and patches
6970
id: cache-nss-source
7071
uses: actions/cache@v4
7172
with:
72-
path: nss
73+
path: |
74+
nss
75+
osp
7376
key: nss-source-fork
7477

75-
- name: Clone NSS
78+
- name: Clone NSS and apply wolfSSL patches
7679
if: steps.cache-nss-source.outputs.cache-hit != 'true'
77-
uses: actions/checkout@v4
78-
with:
79-
repository: LinuxJedi/nss
80-
ref: nss-tests
81-
path: nss
80+
run: |
81+
# Clone official Mozilla NSS with specific tag
82+
hg clone https://hg.mozilla.org/projects/nss -r ${{ env.NSS_VERSION }}
83+
84+
# Clone wolfSSL OSP repository for patches
85+
git clone https://github.com/wolfSSL/osp.git
86+
87+
cd nss
88+
89+
# Apply patches from wolfSSL/osp/nss directory
90+
echo "Applying wolfSSL NSS patches..."
91+
if [ -d "../osp/nss" ]; then
92+
for patch in ../osp/nss/*.patch; do
93+
if [ -f "$patch" ]; then
94+
echo "Applying patch: $(basename $patch)"
95+
patch -p1 < "$patch" || {
96+
echo "Warning: Patch $(basename $patch) failed to apply cleanly"
97+
echo "Attempting to apply with --reject-file option..."
98+
patch -p1 --reject-file=/tmp/$(basename $patch).rej < "$patch" || true
99+
}
100+
fi
101+
done
102+
else
103+
echo "No patches found in wolfSSL/osp/nss directory"
104+
fi
82105
83106
- name: Cache NSS build
84107
id: cache-nss-build
85108
uses: actions/cache@v4
86109
with:
87110
path: dist
88-
key: nss-build-fork
111+
key: nss-fork-${{ env.NSS_VERSION }}-latest
89112

90113
- name: Build NSS
91114
if: steps.cache-nss-build.outputs.cache-hit != 'true'
@@ -138,4 +161,3 @@ jobs:
138161
- name: Run NSS tests
139162
working-directory: nss/tests
140163
run: LD_LIBRARY_PATH=$GITHUB_WORKSPACE/build-dir/lib ./all.sh
141-

0 commit comments

Comments
 (0)