Re: [PATCH] crypto: shash - allow essiv and hmac to use OPTIONAL_KEY algorithms

From
Herbert Xu <herbert@gondor.apana.org.au>
Date
2019-12-11 09:42:25
Reply to
Eric Biggers, 2019-11-29
Eric Biggers [off-list ref] wrote:
From: Eric Biggers <redacted>

The essiv and hmac templates refuse to use any hash algorithm that has a
->setkey() function, which includes not just algorithms that always need
a key, but also algorithms that optionally take a key.

Previously the only optionally-keyed hash algorithms in the crypto API
were non-cryptographic algorithms like crc32, so this didn't really
matter.  But that's changed with BLAKE2 support being added.  BLAKE2
should work with essiv and hmac, just like any other cryptographic hash.

Fix this by allowing the use of both algorithms without a ->setkey()
function and algorithms that have the OPTIONAL_KEY flag set.

Signed-off-by: Eric Biggers <redacted>
---
crypto/essiv.c                 | 2 +-
crypto/hmac.c                  | 4 ++--
crypto/shash.c                 | 3 +--
include/crypto/internal/hash.h | 6 ++++++
4 files changed, 10 insertions(+), 5 deletions(-)
Patch applied.  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 (3 messages) 3 messages, 3 authors, last reply 2019-12-11
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