OSDN Git Service

ext4_utils: define keyctl_unlink()
authorEric Biggers <ebiggers@google.com>
Mon, 3 Apr 2017 22:46:31 +0000 (15:46 -0700)
committerEric Biggers <ebiggers@google.com>
Mon, 3 Apr 2017 22:46:31 +0000 (15:46 -0700)
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
ext4_utils/key_control.cpp

index fe6a6b5..9b18413 100644 (file)
@@ -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);
 
index de6bde2..e295cbe 100644 (file)
@@ -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)