Skip to content

Commit 0f4d53b

Browse files
committed
Resolve WOLFSSL_TAG default dynamically instead of hand-bumping
The hardcoded v5.8.4-stable default kept the 'default' FIPS scripts test config pinned to an old wolfSSL whose headers no longer satisfy the v5.2.4 FIPS overlay (XXX-fips-test references WC_MIN_DIGEST_SIZE, which only exists from v5.9.0-stable on). Rather than play tag-bump roulette every release, walk a small resolution ladder: 1. WOLFSSL_TAG (explicit caller override) - unchanged 2. WOLFSSL_LATEST - set by the Jenkinsfile 'Resolve versions' stage, so CI gets the dynamic value with zero extra HTTP cost 3. GitHub releases/latest API - for local dev runs without Jenkins 4. v5.9.1-stable hardcoded floor - only used if all of the above fail (e.g. GitHub unreachable), so the script remains buildable offline
1 parent d056825 commit 0f4d53b

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

scripts/utils-wolfssl.sh

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,22 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
2222
source ${SCRIPT_DIR}/utils-general.sh
2323

2424
WOLFSSL_GIT=${WOLFSSL_GIT:-"https://github.com/wolfSSL/wolfssl.git"}
25-
WOLFSSL_TAG=${WOLFSSL_TAG:-"v5.8.4-stable"}
25+
# Resolve WOLFSSL_TAG dynamically so we don't have to hand-bump on every release.
26+
# Order: explicit WOLFSSL_TAG (caller override) -> WOLFSSL_LATEST (Jenkins "Resolve
27+
# versions" stage already sets this with zero extra HTTP cost) -> GitHub releases
28+
# API (for local runs without Jenkins) -> hardcoded floor as a last-resort safety
29+
# net in case GitHub is unreachable.
30+
if [ -z "$WOLFSSL_TAG" ]; then
31+
if [ -n "$WOLFSSL_LATEST" ]; then
32+
WOLFSSL_TAG="$WOLFSSL_LATEST"
33+
else
34+
WOLFSSL_TAG=$(curl -fsSL https://api.github.com/repos/wolfSSL/wolfssl/releases/latest 2>/dev/null \
35+
| grep -oE '"tag_name"[[:space:]]*:[[:space:]]*"[^"]+"' \
36+
| head -1 \
37+
| sed -E 's/.*"([^"]+)"$/\1/')
38+
fi
39+
fi
40+
WOLFSSL_TAG="${WOLFSSL_TAG:-v5.9.1-stable}"
2641
WOLFSSL_SOURCE_DIR=${SCRIPT_DIR}/../wolfssl-source
2742
WOLFSSL_INSTALL_DIR=${SCRIPT_DIR}/../wolfssl-install
2843
WOLFSSL_ISFIPS=${WOLFSSL_ISFIPS:-0}

0 commit comments

Comments
 (0)