X-Git-Url: http://git.samba.org/samba.git/?p=sfrench%2Fcifs-2.6.git;a=blobdiff_plain;f=crypto%2Fecb.c;h=a46838e98a71a18de0b4adcdd46a5f65fa556be6;hp=839a0aed8c229c26631ff56032165a19295a0531;hb=d40c2f29f3b0f5937bace575722598dac474c478;hpb=59b8175c771040afcd4ad67022b0cc80c216b866 diff --git a/crypto/ecb.c b/crypto/ecb.c index 839a0aed8c22..a46838e98a71 100644 --- a/crypto/ecb.c +++ b/crypto/ecb.c @@ -115,15 +115,20 @@ static void crypto_ecb_exit_tfm(struct crypto_tfm *tfm) crypto_free_cipher(ctx->child); } -static struct crypto_instance *crypto_ecb_alloc(void *param, unsigned int len) +static struct crypto_instance *crypto_ecb_alloc(struct rtattr **tb) { struct crypto_instance *inst; struct crypto_alg *alg; + int err; + + err = crypto_check_attr_type(tb, CRYPTO_ALG_TYPE_BLKCIPHER); + if (err) + return ERR_PTR(err); - alg = crypto_get_attr_alg(param, len, CRYPTO_ALG_TYPE_CIPHER, - CRYPTO_ALG_TYPE_MASK | CRYPTO_ALG_ASYNC); + alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER, + CRYPTO_ALG_TYPE_MASK); if (IS_ERR(alg)) - return ERR_PTR(PTR_ERR(alg)); + return ERR_CAST(alg); inst = crypto_alloc_instance("ecb", alg); if (IS_ERR(inst))