mirror of
https://github.com/kasmtech/workspaces-images.git
synced 2026-01-23 02:25:16 +00:00
KASM-7938 exclude SHA1 crypto policy update for older distros
This commit is contained in:
parent
9af039afd4
commit
9fc1a78ae3
1 changed files with 19 additions and 17 deletions
|
|
@ -6,25 +6,27 @@ if [ "$(arch)" == "aarch64" ] ; then
|
|||
exit 0
|
||||
fi
|
||||
|
||||
# Temporarily enable SHA1 in crypto policies to allow importing Sublime's GPG key (can remove this when the gpg key is updated with SHA256 or stronger digest)
|
||||
# Start of SHA1 policy workaround
|
||||
SHA1_POLICY_ORIGINAL=""
|
||||
SHA1_POLICY_ENABLED=0
|
||||
if command -v update-crypto-policies >/dev/null 2>&1; then
|
||||
SHA1_POLICY_ORIGINAL=$(update-crypto-policies --show | tr -d '\n')
|
||||
if [[ -n "${SHA1_POLICY_ORIGINAL}" && "${SHA1_POLICY_ORIGINAL}" != *":SHA1"* ]]; then
|
||||
update-crypto-policies --set "${SHA1_POLICY_ORIGINAL}:SHA1"
|
||||
SHA1_POLICY_ENABLED=1
|
||||
if [[ "${DISTRO}" == @(rhel9|almalinux9|oracle9|rockylinux9) ]]; then
|
||||
# Temporarily enable SHA1 in crypto policies to allow importing Sublime's GPG key (can remove this when the gpg key is updated with SHA256 or stronger digest)
|
||||
# Start of SHA1 policy workaround
|
||||
SHA1_POLICY_ORIGINAL=""
|
||||
SHA1_POLICY_ENABLED=0
|
||||
if command -v update-crypto-policies >/dev/null 2>&1; then
|
||||
SHA1_POLICY_ORIGINAL=$(update-crypto-policies --show | tr -d '\n')
|
||||
if [[ -n "${SHA1_POLICY_ORIGINAL}" && "${SHA1_POLICY_ORIGINAL}" != *":SHA1"* ]]; then
|
||||
update-crypto-policies --set "${SHA1_POLICY_ORIGINAL}:SHA1"
|
||||
SHA1_POLICY_ENABLED=1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
cleanup_sha1_policy() {
|
||||
if [[ ${SHA1_POLICY_ENABLED} -eq 1 ]]; then
|
||||
update-crypto-policies --set "${SHA1_POLICY_ORIGINAL}"
|
||||
fi
|
||||
}
|
||||
trap cleanup_sha1_policy EXIT
|
||||
# End of SHA1 policy workaround
|
||||
cleanup_sha1_policy() {
|
||||
if [[ ${SHA1_POLICY_ENABLED} -eq 1 ]]; then
|
||||
update-crypto-policies --set "${SHA1_POLICY_ORIGINAL}"
|
||||
fi
|
||||
}
|
||||
trap cleanup_sha1_policy EXIT
|
||||
# End of SHA1 policy workaround
|
||||
fi
|
||||
|
||||
rpm -v --import https://download.sublimetext.com/sublimehq-rpm-pub.gpg
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue