• Eric Biggers's avatar
    crypto: shash - allow essiv and hmac to use OPTIONAL_KEY algorithms · c2881789
    Eric Biggers authored
    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: default avatarEric Biggers <ebiggers@google.com>
    Acked-by: default avatarArd Biesheuvel <ardb@kernel.org>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    c2881789
hash.h 6.43 KB