diff options
author | Eric Biggers <ebiggers@google.com> | 2017-04-03 15:46:31 -0700 |
---|---|---|
committer | Paul Crowley <paulcrowley@google.com> | 2017-04-04 22:25:04 +0000 |
commit | 512904129a074a056150e707dec638ca8e47f4e2 (patch) | |
tree | c81a025eecda8a84955b1329d948c38826f784a9 | |
parent | 1cf3416564814839b12aa354495b85fc631b3bf5 (diff) | |
download | extras-512904129a074a056150e707dec638ca8e47f4e2.tar.gz |
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.
Bug: 35988361
Change-Id: Ic94329040f77ffbe2415287fe1202fa61e8a006b
(cherry picked from commit 3f062383deb3e5ba7b16d4728f5dbc44f40bc178)
-rw-r--r-- | ext4_utils/include/ext4_utils/key_control.h | 2 | ||||
-rw-r--r-- | 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) |