On Thu, Aug 15, 2019 at 10:28:55PM +0300, Ard Biesheuvel wrote:
>
> +     /* Synchronous hash, e.g., "sha256" */
> +     ictx->hash = crypto_alloc_shash(shash_name, 0, 0);
> +     if (IS_ERR(ictx->hash)) {
> +             err = PTR_ERR(ictx->hash);
> +             goto out_drop_skcipher;
> +     }

Holding a reference to this algorithm for the life-time of the
instance is not nice.  How about just doing a lookup as you were
doing before with crypto_alg_mod_lookup and getting the cra_name
from that?

Thanks,
-- 
Email: Herbert Xu <herb...@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Reply via email to