1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00
openmptcprouter-feeds/qaa/qca-nss-crypto/patches/0003-nss-crypto-fix-SHA-header-include-in-5.15.patch
2022-09-10 05:56:57 +08:00

51 lines
1.4 KiB
Diff

From 4c0cc66cde0c4a30aa049b586af311501304e9ce Mon Sep 17 00:00:00 2001
From: Robert Marko <robimarko@gmail.com>
Date: Sun, 13 Mar 2022 13:47:24 +0100
Subject: [PATCH 3/3] nss-crypto: fix SHA header include in 5.15
SHA header was split into SHA-1 and SHA-2 headers in kernel 5.11, so
fix the include for newer kernels.
Signed-off-by: Robert Marko <robimarko@gmail.com>
---
v2.0/src/nss_crypto_ctrl.c | 6 ++++++
v2.0/src/nss_crypto_hlos.h | 4 ++++
2 files changed, 10 insertions(+)
diff --git a/v2.0/src/nss_crypto_ctrl.c b/v2.0/src/nss_crypto_ctrl.c
index 72d1602..a462705 100644
--- a/v2.0/src/nss_crypto_ctrl.c
+++ b/v2.0/src/nss_crypto_ctrl.c
@@ -38,7 +38,13 @@
#include <linux/debugfs.h>
#include <linux/log2.h>
#include <linux/completion.h>
+#include <linux/version.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
#include <crypto/sha.h>
+#else
+#include <crypto/sha1.h>
+#include <crypto/sha2.h>
+#endif
#include <crypto/des.h>
#include <crypto/aes.h>
#include <crypto/md5.h>
diff --git a/v2.0/src/nss_crypto_hlos.h b/v2.0/src/nss_crypto_hlos.h
index e827f4f..5565472 100644
--- a/v2.0/src/nss_crypto_hlos.h
+++ b/v2.0/src/nss_crypto_hlos.h
@@ -58,7 +58,11 @@
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)
#include <linux/cryptohash.h>
#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
#include <crypto/sha.h>
+#else
+#include <crypto/sha1.h>
+#endif
#include <crypto/aes.h>
#include <crypto/des.h>
#include <crypto/ghash.h>
--
2.35.1