diff --git a/openssh-9.3p1-merged-openssl-evp.patch b/openssh-9.3p1-merged-openssl-evp.patch index d8c2ca359fa4592e5f2ab362099dd6170d3a564b..abb6024a52a959ef92ef053936339bfbddaeecd5 100644 --- a/openssh-9.3p1-merged-openssl-evp.patch +++ b/openssh-9.3p1-merged-openssl-evp.patch @@ -317,7 +317,7 @@ diff --color -ru -x regress -x autom4te.cache -x '*.o' -x '*.lo' -x Makefile -x - digest, sizeof(digest))) != 0) + +#ifdef ENABLE_PKCS11 -+ if (is_ecdsa_pkcs11(key->ecdsa)) { ++ int is_ecdsa_pkcs11(EC_KEY *k); if (key->ecdsa != NULL && is_ecdsa_pkcs11(key->ecdsa)) { + if ((pkey = EVP_PKEY_new()) == NULL || + EVP_PKEY_set1_EC_KEY(pkey, key->ecdsa) != 1) + return SSH_ERR_ALLOC_FAIL; @@ -923,7 +923,7 @@ diff --color -ru -x regress -x autom4te.cache -x '*.o' -x '*.lo' -x Makefile -x - ret = SSH_ERR_ALLOC_FAIL; - goto out; +#ifdef ENABLE_PKCS11 -+ if (is_rsa_pkcs11(key->rsa)) { ++ int is_rsa_pkcs11(EC_KEY *k); if (key->rsa != NULL && is_rsa_pkcs11(key->rsa)) { + if ((pkey = EVP_PKEY_new()) == NULL || + EVP_PKEY_set1_RSA(pkey, key->rsa) != 1) + return SSH_ERR_ALLOC_FAIL; diff --git a/openssh.spec b/openssh.spec index 50b2c374d06d49eb503ec60952c3d3fb7b9b1b68..99064061d6199ac107bb77fc7923f65a9b973fba 100644 --- a/openssh.spec +++ b/openssh.spec @@ -6,7 +6,7 @@ %{?no_gtk2:%global gtk2 0} %global sshd_uid 74 -%global openssh_release 5 +%global openssh_release 6 Name: openssh Version: 9.3p2 @@ -323,15 +323,25 @@ popd %check if [ -e /sys/fs/selinux/enforce ]; then - # Store the SElinux state - cat /sys/fs/selinux/enforce > selinux.tmp - setenforce 0 + # Store the SElinux state only if the file exists + if [ -w /sys/fs/selinux/enforce ] && [ -w. ]; then + cat /sys/fs/selinux/enforce > selinux.tmp + setenforce 0 + else + echo "Insufficient permissions to handle SELinux state. Skipping modification." + fi +else + echo "SELinux is not enabled or enforce file not found. Skipping modification." fi make tests if [ -e /sys/fs/selinux/enforce ]; then - # Restore the SElinux state - cat selinux.tmp > /sys/fs/selinux/enforce - rm -rf selinux.tmp + # Restore the SElinux state only if the file exists + if [ -w /sys/fs/selinux/enforce ] && [ -f selinux.tmp ]; then + cat selinux.tmp > /sys/fs/selinux/enforce + rm -rf selinux.tmp + else + echo "Insufficient permissions or temp file not found. Skipping restoration of SELinux state." + fi fi %install @@ -467,6 +477,9 @@ getent passwd sshd >/dev/null || \ %attr(0644,root,root) %{_mandir}/man8/sftp-server.8* %changelog +* Tue Aug 27 2024 shenchenbang <1944340417@qq.com> - 9.3p2-6 +- Fix Supplement function definition + * Fri Jul 12 2024 renmingshuai - 9.3p2-5 - Type:CVE - CVE:CVE-2023-51384