]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commit
fscrypt-crypt-util: refactor get_key_and_iv()
authorEric Biggers <ebiggers@google.com>
Sun, 13 Mar 2022 01:05:56 +0000 (17:05 -0800)
committerEryu Guan <guaneryu@gmail.com>
Sun, 10 Apr 2022 12:40:44 +0000 (20:40 +0800)
commit02222a33a0e59aac403b92a3e0dfb7953566b446
tree219575412887add82e4eba9fd2ee89bec311f7b4
parentcd81e731261d0d062ad8ed8216deb51b110e4fd7
fscrypt-crypt-util: refactor get_key_and_iv()

Split get_key_and_iv() into two distinct parts: (1) deriving the key and
(2) generating the IV.  Also, check for the presence of needed options
just before they are used rather than doing it all up-front.

These changes should make this code much easier to understand.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
src/fscrypt-crypt-util.c