diff mbox series

[7/7] backports: Add skcipher_request_zero()

Message ID 20181202205131.13519-8-hauke@hauke-m.de (mailing list archive)
State Accepted
Headers show
Series backports-4.19: Fixes for kernel 4.19 branch | expand

Commit Message

Hauke Mehrtens Dec. 2, 2018, 8:51 p.m. UTC
This was added in commit 1aaa753d918 ("crypto: skcipher - Add helper to
zero stack request")

This is needed by lib80211, the code changes in kernel 4.20, so this is
only needed in kernel 4.19.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/crypto/skcipher.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 backport/backport-include/crypto/skcipher.h
diff mbox series

Patch

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 */