summaryrefslogtreecommitdiff
path: root/libfscrypt
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2024-01-25 23:51:32 +0000
committerEric Biggers <ebiggers@google.com>2024-01-25 23:52:41 +0000
commitef66a3e347bfacc28eddf58fe524a0b0588b4311 (patch)
treeca41f8d5a5ad49b62f520e3ced343b5d1311b298 /libfscrypt
parentb6a90014a01ab9da3a2e6f84c963f52426390626 (diff)
downloadextras-ef66a3e347bfacc28eddf58fe524a0b0588b4311.tar.gz
Use fscrypt_policy_v2 from <linux/fscrypt.h>
Now that bionic's copy of linux/fscrypt.h has been updated to Linux 6.7, it's no longer necessary for libfscrypt to have its own definition of struct fscrypt_policy_v2. This addresses a TODO in the code. Bug: 299136786 Test: atest libfscrypt_unit_test Change-Id: Ie8d5860774576ebdad956d72e0db88ae4186d5eb
Diffstat (limited to 'libfscrypt')
-rw-r--r--libfscrypt/fscrypt.cpp13
1 files changed, 1 insertions, 12 deletions
diff --git a/libfscrypt/fscrypt.cpp b/libfscrypt/fscrypt.cpp
index ff28ce53..4c756b18 100644
--- a/libfscrypt/fscrypt.cpp
+++ b/libfscrypt/fscrypt.cpp
@@ -46,17 +46,6 @@ using namespace std::string_literals;
#define HEX_LOOKUP "0123456789abcdef"
-// TODO: remove this when <linux/fscrypt.h> is updated to Linux 6.7
-struct fscrypt_policy_v2__with_log2_data_unit_size {
- __u8 version;
- __u8 contents_encryption_mode;
- __u8 filenames_encryption_mode;
- __u8 flags;
- __u8 log2_data_unit_size;
- __u8 __reserved[3];
- __u8 master_key_identifier[FSCRYPT_KEY_IDENTIFIER_SIZE];
-};
-
struct ModeLookupEntry {
std::string name;
int id;
@@ -314,7 +303,7 @@ static int GetFilesystemBlockSize(const std::string& path) {
bool EnsurePolicy(const EncryptionPolicy& policy, const std::string& directory) {
union {
fscrypt_policy_v1 v1;
- fscrypt_policy_v2__with_log2_data_unit_size v2;
+ fscrypt_policy_v2 v2;
} kern_policy;
memset(&kern_policy, 0, sizeof(kern_policy));