File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 2
2
3
3
if [[ $( id -u) = 0 ]]; then # only root can update crypto policies
4
4
# Set system crypto policies based on the ENABLE_SHA1 environment variable.
5
+ is_el8=false
6
+ is_el9=false
5
7
if grep -q ' ^VERSION_ID=["]8' /etc/os-release; then
6
8
is_el8=true
9
+ elif grep -q ' ^VERSION_ID=["]9' /etc/os-release; then
10
+ is_el9=true
7
11
else
8
- is_el8=false
12
+ : # SHA1 is not supported on el10
9
13
fi
10
14
11
15
if command -v update-crypto-policies & > /dev/null; then
@@ -15,14 +19,16 @@ if [[ $(id -u) = 0 ]]; then # only root can update crypto policies
15
19
YES)
16
20
if $is_el8 ; then
17
21
update-crypto-policies --set DEFAULT > /dev/null
18
- else
22
+ elif $is_el9 ; then
19
23
update-crypto-policies --set DEFAULT:SHA1 > /dev/null
24
+ else
25
+ echo " SHA1 is not supported on this platform; please unset ENABLE_SHA1"
20
26
fi
21
27
;;
22
28
NO)
23
29
if $is_el8 ; then
24
30
update-crypto-policies --set DEFAULT:NO-SHA1 > /dev/null
25
- else
31
+ elif $is_el9 ; then
26
32
update-crypto-policies --set DEFAULT > /dev/null
27
33
fi
28
34
;;
You can’t perform that action at this time.
0 commit comments