From ff9097f560c53bcd91880a724c007afbff88d515 Mon Sep 17 00:00:00 2001 From: Paul Lawrence Date: Wed, 9 Dec 2015 15:45:41 -0800 Subject: [PATCH] Fix create_user_key to take 3 params Change-Id: Ied03e2ee404a1b4f386740213e6ab01f18ec09b9 --- CryptCommandListener.cpp | 4 +++- Ext4Crypt.cpp | 2 +- Ext4Crypt.h | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CryptCommandListener.cpp b/CryptCommandListener.cpp index 09bc6c0..b6397f0 100644 --- a/CryptCommandListener.cpp +++ b/CryptCommandListener.cpp @@ -366,7 +366,9 @@ int CryptCommandListener::CryptfsCmd::runCommand(SocketClient *cli, } else if (cmd == "create_user_key" && argc > 4) { // create_user_key [user] [serial] [ephemeral] return sendGenericOkFail(cli, - e4crypt_create_user_key(atoi(argv[2]), atoi(argv[3]) != 0)); + e4crypt_create_user_key(atoi(argv[2]), + atoi(argv[3]), + atoi(argv[4]) != 0)); } else if (cmd == "destroy_user_key" && argc > 2) { // destroy_user_key [user] diff --git a/Ext4Crypt.cpp b/Ext4Crypt.cpp index 34f0a46..3f6fbdc 100644 --- a/Ext4Crypt.cpp +++ b/Ext4Crypt.cpp @@ -663,7 +663,7 @@ int e4crypt_set_user_crypto_policies(const char *dir) return 0; } -int e4crypt_create_user_key(userid_t user_id, bool ephemeral) { +int e4crypt_create_user_key(userid_t user_id, int serial, bool ephemeral) { SLOGD("e4crypt_create_user_key(%d)", user_id); // TODO: create second key for user_de data if (e4crypt_get_key( diff --git a/Ext4Crypt.h b/Ext4Crypt.h index ed8bf28..a363d39 100644 --- a/Ext4Crypt.h +++ b/Ext4Crypt.h @@ -38,7 +38,7 @@ int e4crypt_set_field(const char* path, const char* fieldname, const char* value); int e4crypt_set_user_crypto_policies(const char *path); -int e4crypt_create_user_key(userid_t user_id, bool ephemeral); +int e4crypt_create_user_key(userid_t user_id, int serial, bool ephemeral); int e4crypt_destroy_user_key(userid_t user_id); int e4crypt_unlock_user_key(userid_t user_id, const char* token);