0003-Fix-build-for-Linux-6-7-rc1.patch 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. From 5e7121e45ff283d30097da381fd7e97c4bb61364 Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Joan=20Bruguera=20Mic=C3=B3?= <joanbrugueram@gmail.com>
  3. Date: Sun, 10 Dec 2023 13:57:55 +0000
  4. Subject: [PATCH] Fix build for Linux 6.7-rc1
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. Since Linux 6.7-rc1, no ahash algorithms set a nonzero alignmask,
  9. and therefore `crypto_ahash_alignmask` has been removed.
  10. See also: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0f8660c82b79af595b056f6b9f4f227edeb88574
  11. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c626910f3f1bbce6ad18bc613d895d2a089ed95e
  12. Signed-off-by: Joan Bruguera Micó <joanbrugueram@gmail.com>
  13. Upstream: https://github.com/cryptodev-linux/cryptodev-linux/commit/5e7121e45ff283d30097da381fd7e97c4bb61364
  14. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  15. ---
  16. cryptlib.c | 4 ++++
  17. 1 file changed, 4 insertions(+)
  18. diff --git a/cryptlib.c b/cryptlib.c
  19. index 4d739e5..0e59d4c 100644
  20. --- a/cryptlib.c
  21. +++ b/cryptlib.c
  22. @@ -381,7 +381,11 @@ int cryptodev_hash_init(struct hash_data *hdata, const char *alg_name,
  23. }
  24. hdata->digestsize = crypto_ahash_digestsize(hdata->async.s);
  25. +#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 7, 0))
  26. hdata->alignmask = crypto_ahash_alignmask(hdata->async.s);
  27. +#else
  28. + hdata->alignmask = 0;
  29. +#endif
  30. init_completion(&hdata->async.result.completion);