summaryrefslogtreecommitdiffstats
path: root/recipes-extended/qat/files/0010-qat-include-sha1.h-and-sha2.h-instead-of-sha.h-in-ke.patch
blob: b86d1dbdcd930133f8c27a9d84e77988b00f4505 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
From c9e04ec8d8be3a1f21a5bdc6c5c79f50191d57dd Mon Sep 17 00:00:00 2001
From: Yongxin Liu <yongxin.liu@windriver.com>
Date: Thu, 28 Jan 2021 13:07:59 +0800
Subject: [PATCH 10/11] qat: include sha1.h and sha2.h instead of sha.h in
 kernel v5.11

In kernel commit a24d22b225ce ("crypto: sha - split sha.h into sha1.h and sha2.h"),
<crypto/sha.h> was split into two headers <crypto/sha1.h> and <crypto/sha2.h>.

Upstream-Status: Inappropriate [Code released in tarball form only]

Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
---
 quickassist/qat/drivers/crypto/qat/qat_common/qat_algs.c             | 5 +++++
 .../utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c      | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/quickassist/qat/drivers/crypto/qat/qat_common/qat_algs.c b/quickassist/qat/drivers/crypto/qat/qat_common/qat_algs.c
index 37ac11e..08680ca 100644
--- a/quickassist/qat/drivers/crypto/qat/qat_common/qat_algs.c
+++ b/quickassist/qat/drivers/crypto/qat/qat_common/qat_algs.c
@@ -52,7 +52,12 @@
 #include <crypto/internal/aead.h>
 #include <crypto/internal/skcipher.h>
 #include <crypto/aes.h>
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0))
+#include <crypto/sha1.h>
+#include <crypto/sha2.h>
+#else
 #include <crypto/sha.h>
+#endif
 #include <crypto/hash.h>
 #include <crypto/algapi.h>
 #include <crypto/authenc.h>
diff --git a/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c b/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c
index 9d2e85c..de24fa0 100644
--- a/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c
+++ b/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c
@@ -69,7 +69,12 @@
 #include <linux/version.h>
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
 #include <crypto/internal/hash.h>
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0))
+#include <crypto/sha1.h>
+#include <crypto/sha2.h>
+#else
 #include <crypto/sha.h>
+#endif
 
 #define OSAL_MAX_SHASH_DECSIZE 512
 
-- 
2.14.5