Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 91a68a88 authored by Phanindra Babu Pabba's avatar Phanindra Babu Pabba
Browse files

fscrypt: Handle support for v1 encryption policy



FS_IOC_ADD_ENCRYPTION_KEY ioctl need to support both
v1 policy with 'key_descriptor' as well along with
v2 encryption policy.

Change-Id: I7638191bc8926ba306b11c3e8a5dafdb3d396764
Signed-off-by: default avatarPhanindra Babu Pabba <pabba@codeaurora.org>
parent 0086d774
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -670,7 +670,8 @@ int fscrypt_ioctl_add_key(struct file *filp, void __user *_uarg)
	if (arg.__flags) {
		if (arg.__flags & ~__FSCRYPT_ADD_KEY_FLAG_HW_WRAPPED)
			return -EINVAL;
		if (arg.key_spec.type != FSCRYPT_KEY_SPEC_TYPE_IDENTIFIER)
		if ((arg.key_spec.type != FSCRYPT_KEY_SPEC_TYPE_IDENTIFIER) &&
		    (arg.key_spec.type != FSCRYPT_KEY_SPEC_TYPE_DESCRIPTOR))
			return -EINVAL;
		secret.is_hw_wrapped = true;
	}