summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2018-12-02 15:28:52 +0100
committerHauke Mehrtens <hauke@hauke-m.de>2018-12-06 23:29:43 +0100
commit148b072defde2fc0d87b4eef086266d08041261c (patch)
tree157b85b4e8369e35f57a43898e5746ed10aa8249
parent6838b1c0cbef41aef3f7f7c715fa15bb6bf5cbb0 (diff)
backports: Add skcipher_request_zero()v4.19.7-1linux-4.19.y
This was added in commit 1aaa753d918 ("crypto: skcipher - Add helper to zero stack request") lib80211 does not use skcipher in kernel 4.20 any more, so only add this to the 4.19 branch. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r--backport/backport-include/crypto/skcipher.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/backport/backport-include/crypto/skcipher.h b/backport/backport-include/crypto/skcipher.h
new file mode 100644
index 00000000..19a5a73d
--- /dev/null
+++ b/backport/backport-include/crypto/skcipher.h
@@ -0,0 +1,14 @@
+#ifndef __BP_CRYPTO_SKCIPHER_H
+#define __BP_CRYPTO_SKCIPHER_H
+#include_next <crypto/skcipher.h>
+
+#if LINUX_VERSION_IS_LESS(4,6,0)
+static inline void skcipher_request_zero(struct skcipher_request *req)
+{
+ struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
+
+ memzero_explicit(req, sizeof(*req) + crypto_skcipher_reqsize(tfm));
+}
+#endif
+
+#endif /* __BP_CRYPTO_SKCIPHER_H */