Skip to content

Commit 048a2e6

Browse files
committed
check candidate runnability before probing ML-DSA support
1 parent 69854c1 commit 048a2e6

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

certs/renewcerts.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,15 +1038,22 @@ EOF
10381038
############################################################
10391039
#### ML-DSA (FIPS 204) self-signed certificates ###
10401040
############################################################
1041-
# ML-DSA requires OpenSSL 3.3+ (oqsprovider or built-in support).
1042-
# Search for a versioned binary if the system default lacks ML-DSA support.
1041+
# ML-DSA requires an OpenSSL 3.x binary with ML-DSA support
1042+
# (via oqsprovider or built-in). Detect support by probing candidates.
10431043
OPENSSL3=""
10441044
for candidate in \
10451045
"/usr/local/opt/openssl@3.2/bin/openssl" \
10461046
"/usr/local/opt/openssl@3/bin/openssl" \
10471047
"/opt/homebrew/opt/openssl@3.2/bin/openssl" \
10481048
"/opt/homebrew/opt/openssl@3/bin/openssl" \
10491049
"openssl"; do
1050+
if [ "$candidate" = "openssl" ]; then
1051+
# Skip if 'openssl' is not available on PATH.
1052+
command -v openssl >/dev/null 2>&1 || continue
1053+
else
1054+
# Skip non-existent or non-executable absolute paths.
1055+
[ -x "$candidate" ] || continue
1056+
fi
10501057
if "$candidate" genpkey -algorithm mldsa44 -out /dev/null 2>/dev/null; then
10511058
OPENSSL3="$candidate"
10521059
break

0 commit comments

Comments
 (0)