From 148b072defde2fc0d87b4eef086266d08041261c Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 2 Dec 2018 15:28:52 +0100 Subject: backports: Add skcipher_request_zero() 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 --- backport/backport-include/crypto/skcipher.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 backport/backport-include/crypto/skcipher.h 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 + +#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 */ -- cgit v1.2.3