commit e4b65d488e4eac2cb90eea08799c8ba3336bd95c
parent 1c7db5cea6ea658d3f158b2d50ca1704c5fdeb12
Author: Drew DeVault <sir@cmpwn.com>
Date: Tue, 29 Mar 2022 20:59:41 +0200
crypto::keystore: implement destroy for +linux
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/crypto/keystore/impl+linux.ha b/crypto/keystore/impl+linux.ha
@@ -15,6 +15,11 @@ export fn newkey(buf: []u8, name: str) (key | errors::error) = {
};
};
+// Destroys a secure key.
+export fn destroy(key: key) void = {
+ keyctl::revoke(key)!;
+};
+
// Reads secret data from a secure key. When the caller is done using the secret
// buffer, they should use [[bytes::zero]] to securely wipe the buffer memory.
export fn read(key: key, buf: []u8) size = {