Skip to content

Commit 2798660

Browse files
committed
Set 10-set-crypto-policies.sh to be a no-op on el10
1 parent c6a2f3f commit 2798660

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

image-init.d/10-set-crypto-policies.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@
22

33
if [[ $(id -u) = 0 ]]; then # only root can update crypto policies
44
# Set system crypto policies based on the ENABLE_SHA1 environment variable.
5+
is_el8=false
6+
is_el9=false
57
if grep -q '^VERSION_ID=["]8' /etc/os-release; then
68
is_el8=true
9+
elif grep -q '^VERSION_ID=["]9' /etc/os-release; then
10+
is_el9=true
711
else
8-
is_el8=false
12+
: # SHA1 is not supported on el10
913
fi
1014

1115
if command -v update-crypto-policies &>/dev/null; then
@@ -15,14 +19,16 @@ if [[ $(id -u) = 0 ]]; then # only root can update crypto policies
1519
YES)
1620
if $is_el8; then
1721
update-crypto-policies --set DEFAULT >/dev/null
18-
else
22+
elif $is_el9; then
1923
update-crypto-policies --set DEFAULT:SHA1 >/dev/null
24+
else
25+
echo "SHA1 is not supported on this platform; please unset ENABLE_SHA1"
2026
fi
2127
;;
2228
NO)
2329
if $is_el8; then
2430
update-crypto-policies --set DEFAULT:NO-SHA1 >/dev/null
25-
else
31+
elif $is_el9; then
2632
update-crypto-policies --set DEFAULT >/dev/null
2733
fi
2834
;;

0 commit comments

Comments
 (0)