• E
    fscrypt: separate key lookup from key derivation · 590f497d
    Eric Biggers 提交于
    Refactor the confusingly-named function 'validate_user_key()' into a new
    function 'find_and_derive_key()' which first finds the keyring key, then
    does the key derivation.  Among other benefits this avoids the strange
    behavior we had previously where if key derivation failed for some
    reason, then we would fall back to the alternate key prefix.  Now, we'll
    only fall back to the alternate key prefix if a valid key isn't found.
    
    This patch also improves the warning messages that are logged when the
    keyring key's payload is invalid.
    Signed-off-by: NEric Biggers <ebiggers@google.com>
    Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
    590f497d
keyinfo.c 10.0 KB