Skip to content

Commit 3ca26ba

Browse files
committed
Fix is_openssl_patched
1 parent 655b63d commit 3ca26ba

File tree

6 files changed

+48
-35
lines changed

6 files changed

+48
-35
lines changed

.github/scripts/x11vnc/test_x11vnc.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ else
161161
X11VNC_TEST_FAIL=1
162162
fi
163163

164-
killall x11vnc > /dev/null 2> /dev/null
165-
killall Xvfb > /dev/null 2> /dev/null
164+
killall x11vnc > /dev/null 2> /dev/null || true
165+
killall Xvfb > /dev/null 2> /dev/null || true
166166
cat server.log >> x11vnc_test.log
167167

168168
$GITHUB_WORKSPACE/.github/scripts/check-workflow-result.sh $X11VNC_TEST_FAIL "$WOLFPROV_FORCE_FAIL_STR" x11vnc

.github/workflows/build-wolfprovider.yml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -70,22 +70,23 @@ jobs:
7070
git remote add upstream https://github.com/wolfSSL/wolfProvider.git || true
7171
git fetch upstream --tags --no-recurse-submodules
7272
73-
- name: Restore wolfSSL packages
74-
uses: actions/cache@v4
75-
id: wolfssl_cache
76-
with:
77-
path: |
78-
${{ env.WOLFSSL_PACKAGES_PATH }}/*.deb
79-
${{ env.WOLFSSL_PACKAGES_PATH }}/*.dsc
80-
${{ env.WOLFSSL_PACKAGES_PATH }}/*.tar.gz
81-
key: wolfssl-debian-packages-${{ inputs.wolfssl_ref }}
82-
83-
- name: Install wolfSSL packages from cache
84-
if: steps.wolfssl_cache.outputs.cache-hit == 'true'
85-
run: |
86-
printf "Installing wolfSSL packages from cache:\n"
87-
ls -la ${{ env.WOLFSSL_PACKAGES_PATH }}
88-
apt install --reinstall -y ${{ env.WOLFSSL_PACKAGES_PATH }}/*wolfssl*.deb
73+
# Disable cache for debug purposes
74+
# - name: Restore wolfSSL packages
75+
# uses: actions/cache@v4
76+
# id: wolfssl_cache
77+
# with:
78+
# path: |
79+
# ${{ env.WOLFSSL_PACKAGES_PATH }}/*.deb
80+
# ${{ env.WOLFSSL_PACKAGES_PATH }}/*.dsc
81+
# ${{ env.WOLFSSL_PACKAGES_PATH }}/*.tar.gz
82+
# key: wolfssl-debian-packages-${{ inputs.wolfssl_ref }}
83+
84+
# - name: Install wolfSSL packages from cache
85+
# if: steps.wolfssl_cache.outputs.cache-hit == 'true'
86+
# run: |
87+
# printf "Installing wolfSSL packages from cache:\n"
88+
# ls -la ${{ env.WOLFSSL_PACKAGES_PATH }}
89+
# apt install --reinstall -y ${{ env.WOLFSSL_PACKAGES_PATH }}/*wolfssl*.deb
8990

9091
# TODO: roll this step into utils-wolfssl.sh
9192
- name: Build wolfSSL packages and install

.github/workflows/xmlsec.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: xmlsec Tests
33
# START OF COMMON SECTION
44
on:
55
push:
6-
branches: [ '**' ] # 'master', 'main', 'release/**' ]
6+
branches: [ 'master', 'main', 'release/**' ]
77
pull_request:
88
branches: [ '*' ]
99

debian/install-wolfssl.sh

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ AC_CONFIG_FILES([debian/rules],[chmod +x debian/rules])' configure.ac
132132
# Configure with the specified options
133133
echo "Configuring wolfSSL with specified options..."
134134
configure_opts="--enable-opensslcoexist \
135+
--enable-opensslextra \
135136
--enable-cmac \
136137
--with-eccminsz=192 \
137138
--enable-ed25519 \
@@ -145,9 +146,16 @@ AC_CONFIG_FILES([debian/rules],[chmod +x debian/rules])' configure.ac
145146
--enable-keygen \
146147
--enable-shake128 \
147148
--enable-shake256 \
148-
--enable-wolfprovider \
149149
--enable-rsapss \
150-
--enable-scrypt"
150+
--enable-scrypt \
151+
--enable-base16 \
152+
--enable-aesctr \
153+
--enable-des3 \
154+
--enable-enckeys \
155+
--enable-hkdf \
156+
--enable-supportedcurves \
157+
--enable-base64encode \
158+
--enable-wolfprovider"
151159

152160
if [ "$debug_mode" = "true" ]; then
153161
configure_opts="$configure_opts --enable-debug"
@@ -173,7 +181,10 @@ AC_CONFIG_FILES([debian/rules],[chmod +x debian/rules])' configure.ac
173181
-DWC_RSA_DIRECT \
174182
-DWC_RSA_NO_PADDING \
175183
-DACVP_VECTOR_TESTING \
176-
-DWOLFSSL_ECDSA_SET_K" \
184+
-DWOLFSSL_ECDSA_SET_K \
185+
-DWOLFSSL_ASN_ALL \
186+
-DWOLFSSL_ALT_NAMES \
187+
-DWOLFSSL_HAVE_ISSUER_NAMES" \
177188
LIBS="-lm"
178189

179190
# Build Debian packages

scripts/utils-openssl.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -121,20 +121,20 @@ clone_openssl() {
121121
}
122122

123123
is_openssl_patched() {
124-
if [ ! -f "${OPENSSL_SOURCE_DIR}/crypto/provider_predefined.c" ]; then
124+
# Return 0 if patched, 1 if not
125+
local dir="${OPENSSL_SOURCE_DIR:?OPENSSL_SOURCE_DIR not set}"
126+
local file="${dir%/}/crypto/provider_predefined.c"
127+
128+
# File must exist to be patched
129+
[[ -f "$file" ]] || return 1
130+
131+
# Any time we see libwolfprov, we're patched
132+
if grep -q 'libwolfprov' -- "$file"; then
125133
return 0
126134
fi
127135

128-
# Check if $OPENSSL_SOURCE_DIR is a git repository
129-
if [ -d ${OPENSSL_SOURCE_DIR}/.git ]; then
130-
pushd ${OPENSSL_SOURCE_DIR} &> /dev/null
131-
patch_applied=$(git diff --quiet "crypto/provider_predefined.c" 2>/dev/null && echo 1 || echo 0)
132-
popd &> /dev/null
133-
else
134-
# Not a git repo, may have been downloaded separately (from Debian sources)
135-
patch_applied=$(grep -q "libwolfprov" "${OPENSSL_SOURCE_DIR}/crypto/provider_predefined.c" && echo 1 || echo 0)
136-
fi
137-
return $patch_applied
136+
# Not patched
137+
return 1
138138
}
139139

140140
check_openssl_replace_default_mismatch() {

src/wp_wolfprov.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,8 +1242,9 @@ int wolfssl_provider_init(const OSSL_CORE_HANDLE* handle,
12421242
if (ok) {
12431243
if (wolfSSL_Debugging_ON() != 0) {
12441244
WOLFPROV_MSG(WP_LOG_PROVIDER,
1245-
"WARNING: wolfProvider built with debug but underlying wolfSSL is not!"
1246-
"Building wolfSSl with debug is highly recommended, proceeding...");
1245+
"WARNING: wolfProvider built with debug but underlying wolfSSL is not!");
1246+
WOLFPROV_MSG(WP_LOG_PROVIDER,
1247+
"\tBuilding wolfSSl with debug is highly recommended, proceeding...");
12471248
}
12481249
else {
12491250
wolfSSL_SetLoggingPrefix("wolfSSL");

0 commit comments

Comments
 (0)