diff options
author | Dominik Sliwa <dominik.sliwa@toradex.com> | 2017-12-22 12:07:34 +0000 |
---|---|---|
committer | Dominik Sliwa <dominik.sliwa@toradex.com> | 2017-12-22 16:46:44 +0100 |
commit | 198e79f0e8f0b24c1e36ab6032d348f40de20262 (patch) | |
tree | d8dd6411978560fd0b6832761b085ac431253389 /compat/crypto-skcipher.c | |
parent | c8beff5117bd4614be26bf28e97b885e8af42a67 (diff) |
backports: bluetooth: Support 4.9 kernelsColibri-iMX7_LXDE-Image_2.8b3.111-20180627Colibri-iMX7_LXDE-Image_2.8b2.97-20180331Colibri-iMX7_LXDE-Image_2.8b1.64-20171229Colibri-iMX6_LXDE-Image_2.8b3.111-20180627Colibri-iMX6_LXDE-Image_2.8b2.97-20180331Colibri-iMX6_LXDE-Image_2.8b1.64-20171229Colibri-iMX6ULL_LXDE-Image_2.8b3.111-20180627Colibri-iMX6ULL_LXDE-Image_2.8b2.97-20180331Colibri-iMX6ULL_LXDE-Image_2.8b1.64-20171229Colibri-VF_LXDE-Image_2.8b3.111-20180626Colibri-VF_LXDE-Image_2.8b2.97-20180331Colibri-VF_LXDE-Image_2.8b1.64-20171229Colibri-T30_LXDE-Image_2.8b3.111-20180627Colibri-T30_LXDE-Image_2.8b2.97-20180331Colibri-T30_LXDE-Image_2.8b1.64-20171229Colibri-T20_LXDE-Image_2.8b3.111-20180626Colibri-T20_LXDE-Image_2.8b2.97-20180331Colibri-T20_LXDE-Image_2.8b1.64-20171229Apalis-iMX6_LXDE-Image_2.8b3.111-20180626Apalis-iMX6_LXDE-Image_2.8b2.97-20180331Apalis-iMX6_LXDE-Image_2.8b1.64-20171229Apalis-TK1_LXDE-Image_2.8b3.111-20180626Apalis-TK1_LXDE-Image_2.8b2.97-20180331Apalis-TK1_LXDE-Image_2.8b1.64-20171229Apalis-TK1-Mainline_LXDE-Image_2.8b3.111-20180627Apalis-TK1-Mainline_LXDE-Image_2.8b2.97-20180331Apalis-TK1-Mainline_LXDE-Image_2.8b1.64-20171229Apalis-T30_LXDE-Image_2.8b3.111-20180626Apalis-T30_LXDE-Image_2.8b2.97-20180331Apalis-T30_LXDE-Image_2.8b1.64-20171229toradex-4.14
Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com>
Diffstat (limited to 'compat/crypto-skcipher.c')
-rw-r--r-- | compat/crypto-skcipher.c | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/compat/crypto-skcipher.c b/compat/crypto-skcipher.c index 05b520d..3c53735 100644 --- a/compat/crypto-skcipher.c +++ b/compat/crypto-skcipher.c @@ -48,7 +48,7 @@ static inline u32 skcipher_request_flags(struct skcipher_request *req) { return req->base.flags; } - +#if LINUX_VERSION_IS_GEQ(4,8,0) enum { SKCIPHER_WALK_PHYS = 1 << 0, SKCIPHER_WALK_SLOW = 1 << 1, @@ -593,6 +593,35 @@ int skcipher_walk_aead_decrypt(struct skcipher_walk *walk, } EXPORT_SYMBOL_GPL(skcipher_walk_aead_decrypt); +#endif /* LINUX_VERSION_IS_GEQ(4,8,0) */ + +#if LINUX_VERSION_IS_LESS(4,2,0) + +unsigned int crypto_alg_extsize(struct crypto_alg *alg) +{ + return alg->cra_ctxsize + + (alg->cra_alignmask & ~(crypto_tfm_ctx_alignment() - 1)); +} +EXPORT_SYMBOL_GPL(crypto_alg_extsize); + +int crypto_type_has_alg(const char *name, const struct crypto_type *frontend, + u32 type, u32 mask) +{ +#if 0 + int ret = 0; + struct crypto_alg *alg = crypto_find_alg(name, frontend, type, mask); + + if (!IS_ERR(alg)) { + crypto_mod_put(alg); + ret = 1; + } +#endif + return -EINVAL; +} +EXPORT_SYMBOL_GPL(crypto_type_has_alg); + +#endif + static unsigned int crypto_skcipher_extsize(struct crypto_alg *alg) { if (alg->cra_type == &crypto_blkcipher_type) @@ -922,7 +951,9 @@ static int crypto_skcipher_report(struct sk_buff *skb, struct crypto_alg *alg) static const struct crypto_type crypto_skcipher_type2 = { .extsize = crypto_skcipher_extsize, .init_tfm = crypto_skcipher_init_tfm, +#if LINUX_VERSION_IS_GEQ(4,3,0) .free = crypto_skcipher_free_instance, +#endif #ifdef CONFIG_PROC_FS .show = crypto_skcipher_show, #endif @@ -936,8 +967,10 @@ static const struct crypto_type crypto_skcipher_type2 = { int crypto_grab_skcipher(struct crypto_skcipher_spawn *spawn, const char *name, u32 type, u32 mask) { +#if 0 spawn->base.frontend = &crypto_skcipher_type2; return crypto_grab_spawn(&spawn->base, name, type, mask); +#endif } EXPORT_SYMBOL_GPL(crypto_grab_skcipher); |