• E
    fscrypt: only derive the needed portion of the key · 646b7d4f
    Eric Biggers 提交于
    Currently the key derivation function in fscrypt uses the master key
    length as the amount of output key material to derive.  This works, but
    it means we can waste time deriving more key material than is actually
    used, e.g. most commonly, deriving 64 bytes for directories which only
    take a 32-byte AES-256-CTS-CBC key.  It also forces us to validate that
    the master key length is a multiple of AES_BLOCK_SIZE, which wouldn't
    otherwise be necessary.
    
    Fix it to only derive the needed length key.
    Signed-off-by: NEric Biggers <ebiggers@google.com>
    Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
    646b7d4f
keyinfo.c 9.9 KB