Skip to content

Commit

Permalink
Only generate the HMAC's for libssl.so.1.1 and ``libcrypto.so.1.1…
Browse files Browse the repository at this point in the history
…`` if those files exist.

Fixes saltstack#65581

Signed-off-by: Pedro Algarvio <[email protected]>
  • Loading branch information
s0undt3ch committed Nov 20, 2023
1 parent 9e1bdd1 commit 647cc38
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
1 change: 1 addition & 0 deletions changelog/65581.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Only generate the HMAC's for ``libssl.so.1.1`` and ``libcrypto.so.1.1`` if those files exist.
32 changes: 24 additions & 8 deletions pkg/rpm/salt.spec
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,12 @@ if [ $1 -lt 2 ]; then
# ensure hmac are up to date, master or minion, rest install one or the other
# key used is from openssl/crypto/fips/fips_standalone_hmac.c openssl 1.1.1k
if [ $(cat /etc/os-release | grep VERSION_ID | cut -d '=' -f 2 | sed 's/\"//g' | cut -d '.' -f 1) = "8" ]; then
/bin/openssl sha256 -r -hmac orboDeJITITejsirpADONivirpUkvarP /opt/saltstack/salt/lib/libssl.so.1.1 | cut -d ' ' -f 1 > /opt/saltstack/salt/lib/.libssl.so.1.1.hmac || :
/bin/openssl sha256 -r -hmac orboDeJITITejsirpADONivirpUkvarP /opt/saltstack/salt/lib/libcrypto.so.1.1 | cut -d ' ' -f 1 > /opt/saltstack/salt/lib/.libcrypto.so.1.1.hmac || :
if [ -e /opt/saltstack/salt/lib/libssl.so.1.1 ]; then
/bin/openssl sha256 -r -hmac orboDeJITITejsirpADONivirpUkvarP /opt/saltstack/salt/lib/libssl.so.1.1 | cut -d ' ' -f 1 > /opt/saltstack/salt/lib/.libssl.so.1.1.hmac || :
fi
if [ -e /opt/saltstack/salt/lib/libcrypto.so.1.1 ]; then
/bin/openssl sha256 -r -hmac orboDeJITITejsirpADONivirpUkvarP /opt/saltstack/salt/lib/libcrypto.so.1.1 | cut -d ' ' -f 1 > /opt/saltstack/salt/lib/.libcrypto.so.1.1.hmac || :
fi
fi
fi

Expand All @@ -482,8 +486,12 @@ if [ $1 -lt 2 ]; then
# ensure hmac are up to date, master or minion, rest install one or the other
# key used is from openssl/crypto/fips/fips_standalone_hmac.c openssl 1.1.1k
if [ $(cat /etc/os-release | grep VERSION_ID | cut -d '=' -f 2 | sed 's/\"//g' | cut -d '.' -f 1) = "8" ]; then
/bin/openssl sha256 -r -hmac orboDeJITITejsirpADONivirpUkvarP /opt/saltstack/salt/lib/libssl.so.1.1 | cut -d ' ' -f 1 > /opt/saltstack/salt/lib/.libssl.so.1.1.hmac || :
/bin/openssl sha256 -r -hmac orboDeJITITejsirpADONivirpUkvarP /opt/saltstack/salt/lib/libcrypto.so.1.1 | cut -d ' ' -f 1 > /opt/saltstack/salt/lib/.libcrypto.so.1.1.hmac || :
if [ -e /opt/saltstack/salt/lib/libssl.so.1.1 ]; then
/bin/openssl sha256 -r -hmac orboDeJITITejsirpADONivirpUkvarP /opt/saltstack/salt/lib/libssl.so.1.1 | cut -d ' ' -f 1 > /opt/saltstack/salt/lib/.libssl.so.1.1.hmac || :
fi
if [ -e /opt/saltstack/salt/lib/libcrypto.so.1.1 ]; then
/bin/openssl sha256 -r -hmac orboDeJITITejsirpADONivirpUkvarP /opt/saltstack/salt/lib/libcrypto.so.1.1 | cut -d ' ' -f 1 > /opt/saltstack/salt/lib/.libcrypto.so.1.1.hmac || :
fi
fi
fi

Expand Down Expand Up @@ -537,8 +545,12 @@ if [ $1 -eq 0 ]; then
if [ $(cat /etc/os-release | grep VERSION_ID | cut -d '=' -f 2 | sed 's/\"//g' | cut -d '.' -f 1) = "8" ]; then
if [ -z "$(rpm -qi salt-minion | grep Name | grep salt-minion)" ]; then
# uninstall and no minion running
/bin/rm -f /opt/saltstack/salt/lib/.libssl.so.1.1.hmac || :
/bin/rm -f /opt/saltstack/salt/lib/.libcrypto.so.1.1.hmac || :
if [ -e /opt/saltstack/salt/lib/.libssl.so.1.1.hmac ]; then
/bin/rm -f /opt/saltstack/salt/lib/.libssl.so.1.1.hmac || :
fi
if [ -e /opt/saltstack/salt/lib/.libcrypto.so.1.1.hmac ]; then
/bin/rm -f /opt/saltstack/salt/lib/.libcrypto.so.1.1.hmac || :
fi
fi
fi
fi
Expand All @@ -552,8 +564,12 @@ if [ $1 -eq 0 ]; then
if [ $(cat /etc/os-release | grep VERSION_ID | cut -d '=' -f 2 | sed 's/\"//g' | cut -d '.' -f 1) = "8" ]; then
if [ -z "$(rpm -qi salt-master | grep Name | grep salt-master)" ]; then
# uninstall and no master running
/bin/rm -f /opt/saltstack/salt/lib/.libssl.so.1.1.hmac || :
/bin/rm -f /opt/saltstack/salt/lib/.libcrypto.so.1.1.hmac || :
if [ -e /opt/saltstack/salt/lib/.libssl.so.1.1.hmac ]; then
/bin/rm -f /opt/saltstack/salt/lib/.libssl.so.1.1.hmac || :
fi
if [ -e /opt/saltstack/salt/lib/.libcrypto.so.1.1.hmac ]; then
/bin/rm -f /opt/saltstack/salt/lib/.libcrypto.so.1.1.hmac || :
fi
fi
fi
fi
Expand Down

0 comments on commit 647cc38

Please sign in to comment.