Re: [PATCH v12 1/4] crypto: essiv - create wrapper template for ESSIV generation

From
Herbert Xu <herbert@gondor.apana.org.au>
Date
2019-08-19 06:32:33
Also in
dm-devel, linux-fscrypt
Reply to
Ard Biesheuvel, 2019-08-15
On Thu, Aug 15, 2019 at 10:28:55PM +0300, Ard Biesheuvel wrote:
quoted hunk ↗ jump to hunk

+	/* 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 [off-list ref]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Thread (11 messages) 11 messages, 3 authors, last reply 2019-08-19
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help