summaryrefslogtreecommitdiff
path: root/crypto/cbc.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2017-05-14 14:07:21 -0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-05-14 14:07:21 -0300
commitc65431e894d86b0baf6131048242944c738c227d (patch)
treec21d54144730f14380d5a58a6c3ae63d5f811b41 /crypto/cbc.c
parent69ef4995da43c512ffa7d4e57d5124489a0b417f (diff)
parentf087d7377871853f7162c3b61bcddb58bf3e6b9b (diff)
downloadlinux-crypto-c65431e894d86b0baf6131048242944c738c227d.tar.gz
linux-crypto-c65431e894d86b0baf6131048242944c738c227d.zip
Merge tag 'v4.12-rc1' into patchwork
Linux 4.12-rc1 * tag 'v4.12-rc1': (13212 commits) Linux 4.12-rc1 mm, docs: update memory.stat description with workingset* entries mm: vmscan: scan until it finds eligible pages mm, thp: copying user pages must schedule on collapse dax: fix PMD data corruption when fault races with write dax: fix data corruption when fault races with write ext4: return to starting transaction in ext4_dax_huge_fault() mm: fix data corruption due to stale mmap reads dax: prevent invalidation of mapped DAX entries Tigran has moved mm, vmalloc: fix vmalloc users tracking properly mm/khugepaged: add missed tracepoint for collapse_huge_page_swapin gcov: support GCC 7.1 mm, vmstat: Remove spurious WARN() during zoneinfo print time: delete current_fs_time() hwpoison, memcg: forcibly uncharge LRU pages sound: Disable the build of OSS drivers drm/i915: Make vblank evade warnings optional Input: cros_ec_keyb - remove extraneous 'const' drm/nouveau/therm: remove ineffective workarounds for alarm bugs ...
Diffstat (limited to 'crypto/cbc.c')
-rw-r--r--crypto/cbc.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/crypto/cbc.c b/crypto/cbc.c
index bc160a31..b761b1f9 100644
--- a/crypto/cbc.c
+++ b/crypto/cbc.c
@@ -10,6 +10,7 @@
*
*/
+#include <crypto/algapi.h>
#include <crypto/cbc.h>
#include <crypto/internal/skcipher.h>
#include <linux/err.h>
@@ -108,8 +109,10 @@ static void crypto_cbc_free(struct skcipher_instance *inst)
static int crypto_cbc_create(struct crypto_template *tmpl, struct rtattr **tb)
{
struct skcipher_instance *inst;
+ struct crypto_attr_type *algt;
struct crypto_spawn *spawn;
struct crypto_alg *alg;
+ u32 mask;
int err;
err = crypto_check_attr_type(tb, CRYPTO_ALG_TYPE_SKCIPHER);
@@ -120,8 +123,16 @@ static int crypto_cbc_create(struct crypto_template *tmpl, struct rtattr **tb)
if (!inst)
return -ENOMEM;
- alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER,
- CRYPTO_ALG_TYPE_MASK);
+ algt = crypto_get_attr_type(tb);
+ err = PTR_ERR(algt);
+ if (IS_ERR(algt))
+ goto err_free_inst;
+
+ mask = CRYPTO_ALG_TYPE_MASK |
+ crypto_requires_off(algt->type, algt->mask,
+ CRYPTO_ALG_NEED_FALLBACK);
+
+ alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER, mask);
err = PTR_ERR(alg);
if (IS_ERR(alg))
goto err_free_inst;