• Eric Biggers's avatar
    crypto: aead - prevent using AEADs without setting key · dc26c17f
    Eric Biggers authored
    Similar to what was done for the hash API, update the AEAD API to track
    whether each transform has been keyed, and reject encryption/decryption
    if a key is needed but one hasn't been set.
    
    This isn't quite as important as the equivalent fix for the hash API
    because AEADs always require a key, so are unlikely to be used without
    one.  Still, tracking the key will prevent accidental unkeyed use.
    algif_aead also had to track the key anyway, so the new flag replaces
    that and slightly simplifies the algif_aead implementation.
    Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    dc26c17f
algif_aead.c 16 KB