26 lines
1.3 KiB
Diff
26 lines
1.3 KiB
Diff
diff -u -r open-gpu-kernel-modules-545.29.06.orig/kernel-open/nvidia/libspdm_shash.c open-gpu-kernel-modules-545.29.06/kernel-open/nvidia/libspdm_shash.c
|
|
--- open-gpu-kernel-modules-545.29.06.orig/kernel-open/nvidia/libspdm_shash.c 2024-01-24 14:32:54.546727576 +0100
|
|
+++ open-gpu-kernel-modules-545.29.06/kernel-open/nvidia/libspdm_shash.c 2024-01-24 14:47:06.663986342 +0100
|
|
@@ -20,6 +20,7 @@
|
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
* DEALINGS IN THE SOFTWARE.
|
|
*/
|
|
+#include <linux/version.h>
|
|
|
|
#include "internal_crypt_lib.h"
|
|
|
|
@@ -87,8 +88,13 @@
|
|
|
|
struct crypto_shash *src_tfm = src->tfm;
|
|
struct crypto_shash *dst_tfm = dst->tfm;
|
|
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 7, 0)
|
|
+ char *src_ipad = crypto_tfm_ctx_align(&src_tfm->base, crypto_tfm_alg_alignmask(&src_tfm->base) + 1);
|
|
+ char *dst_ipad = crypto_tfm_ctx_align(&dst_tfm->base, crypto_tfm_alg_alignmask(&dst_tfm->base) + 1);
|
|
+#else
|
|
char *src_ipad = crypto_tfm_ctx_aligned(&src_tfm->base);
|
|
char *dst_ipad = crypto_tfm_ctx_aligned(&dst_tfm->base);
|
|
+#endif
|
|
int ss = crypto_shash_statesize(dst_tfm);
|
|
memcpy(dst_ipad, src_ipad, crypto_shash_blocksize(src->tfm));
|
|
memcpy(dst_ipad + ss, src_ipad + ss, crypto_shash_blocksize(src->tfm));
|