X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=crypto%2Fhmac.c;h=44187c5ee5933cbf9195ec799d337053ef0e0b8e;hb=ac98695d6c1508b724f246f38ce57fb4e3cec356;hp=b521bcd2b2c6036f155bc23641d41df877baca18;hpb=250d375d1da45a5e08ab8baf5eaa7eb258afd82b;p=linux-2.6 diff --git a/crypto/hmac.c b/crypto/hmac.c index b521bcd2b2..44187c5ee5 100644 --- a/crypto/hmac.c +++ b/crypto/hmac.c @@ -172,15 +172,16 @@ static int hmac_digest(struct hash_desc *pdesc, struct scatterlist *sg, static int hmac_init_tfm(struct crypto_tfm *tfm) { + struct crypto_hash *hash; struct crypto_instance *inst = (void *)tfm->__crt_alg; struct crypto_spawn *spawn = crypto_instance_ctx(inst); struct hmac_ctx *ctx = hmac_ctx(__crypto_hash_cast(tfm)); - tfm = crypto_spawn_tfm(spawn); - if (IS_ERR(tfm)) - return PTR_ERR(tfm); + hash = crypto_spawn_hash(spawn); + if (IS_ERR(hash)) + return PTR_ERR(hash); - ctx->child = crypto_hash_cast(tfm); + ctx->child = hash; return 0; }