]> www.infradead.org Git - users/hch/xfsprogs.git/commit
xfs_io/encrypt: extend 'set_encpolicy' to support v2 policies
authorEric Biggers <ebiggers@google.com>
Mon, 30 Sep 2019 19:27:40 +0000 (15:27 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Mon, 30 Sep 2019 19:27:40 +0000 (15:27 -0400)
commita7a5e44c53e8eaf47c3adc869dbce9924debd885
tree03ea54209b52a9101143b5d2ea1b653550c1a264
parentc304c84feb4fecc8b72768fc43d59a0d8dc8fdb3
xfs_io/encrypt: extend 'set_encpolicy' to support v2 policies

Extend the 'set_encpolicy' xfs_io command to support setting v2
encryption policies, in addition to v1 encryption policies which it
currently supports.  This uses the same ioctl, where the 'version' field
at the beginning of the struct is used to determine whether the struct
is fscrypt_policy_v1 or fscrypt_policy_v2.

The command sets a v2 policy when the user either gave the longer key
specification used in such policies (a 16-byte master_key_identifier
rather than an 8-byte master_key_descriptor), or passed '-v 2'.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
io/encrypt.c
man/man8/xfs_io.8