From 3f062383deb3e5ba7b16d4728f5dbc44f40bc178 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Mon, 3 Apr 2017 15:46:31 -0700 Subject: [PATCH] ext4_utils: define keyctl_unlink() This will allow vold to unlink keys rather than revoking them. This also removes the keyctl_revoke() definition for now, to discourage any further (mis)use in the context of ext4 encryption. Change-Id: Ic94329040f77ffbe2415287fe1202fa61e8a006b --- ext4_utils/include/ext4_utils/key_control.h | 2 +- ext4_utils/key_control.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ext4_utils/include/ext4_utils/key_control.h b/ext4_utils/include/ext4_utils/key_control.h index fe6a6b5f..9b184137 100644 --- a/ext4_utils/include/ext4_utils/key_control.h +++ b/ext4_utils/include/ext4_utils/key_control.h @@ -24,7 +24,7 @@ key_serial_t add_key(const char *type, size_t plen, key_serial_t ringid); -long keyctl_revoke(key_serial_t id); +long keyctl_unlink(key_serial_t key, key_serial_t keyring); long keyctl_setperm(key_serial_t id, int permissions); diff --git a/ext4_utils/key_control.cpp b/ext4_utils/key_control.cpp index de6bde2a..e295cbe6 100644 --- a/ext4_utils/key_control.cpp +++ b/ext4_utils/key_control.cpp @@ -28,9 +28,9 @@ key_serial_t add_key(const char *type, return syscall(__NR_add_key, type, description, payload, plen, ringid); } -long keyctl_revoke(key_serial_t id) +long keyctl_unlink(key_serial_t key, key_serial_t keyring) { - return keyctl(KEYCTL_REVOKE, id); + return keyctl(KEYCTL_UNLINK, key, keyring); } long keyctl_setperm(key_serial_t id, int permissions) -- 2.11.0