changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > core / lisp/ffi/keyutils/keyctl.lisp

changeset 698: 96958d3eb5b0
parent: bc0ea6a5c252
author: Richard Westhaver <ellis@rwest.io>
date: Fri, 04 Oct 2024 22:04:59 -0400
permissions: -rw-r--r--
description: fixes
1 ;;; keyctl.lisp --- Keyctl API Functions
2 
3 ;;
4 
5 ;;; Code:
6 (in-package :keyutils)
7 
8 (macrolet ((def (name &rest args)
9  `(progn
10  (define-alien-routine ,name key-serial-t ,@args)
11  ,@(if (atom name)
12  `((export ',name))
13  `((export ',(cadr name))))))
14  (defint (name &rest args)
15  `(progn
16  (define-alien-routine ,name int ,@args)
17  (export ',name)))
18  (deflong (name &rest args)
19  `(progn
20  (define-alien-routine ,name long ,@args)
21  (export ',name))))
22  (def add-key (type c-string) (description c-string) (payload (* t)) (plen size-t) (ringid key-serial-t))
23  (def request-key (type c-string) (description c-string) (callout-info c-string) (destringid key-serial-t))
24  ;; variadic? ... prob not supported by sb-alien
25  (deflong keyctl (cmd int))
26  (def ("keyctl_get_keyring_ID" keyctl-get-keyring-id) (id key-serial-t) (create int))
27  (def keyctl-join-session-keyring (name c-string))
28  (deflong keyctl-update (id key-serial-t) (payload (* t)) (plen size-t))
29  (deflong keyctl-revoke (id key-serial-t))
30  (deflong keyctl-chown (id key-serial-t) (uid sb-unix:uid-t) (gid sb-unix:gid-t))
31  (deflong keyctl-setperm (id key-serial-t) (perm key-perm-t))
32  (deflong keyctl-describe (id key-serial-t) (buffer c-string) (buflen size-t))
33  (deflong keyctl-clear (ringid key-serial-t))
34  (deflong keyctl-link (id key-serial-t) (ringid key-serial-t))
35  (deflong keyctl-unlink (id key-serial-t) (ringid key-serial-t))
36  (deflong keyctl-search (ringid key-serial-t) (type c-string) (description c-string) (destringid key-serial-t))
37  (deflong keyctl-read (id key-serial-t) (buffer c-string) (buflen size-t))
38  (deflong keyctl-instantiate (id key-serial-t) (payload (* t)) (plen size-t) (ringid key-serial-t))
39  (deflong keyctl-negate (id key-serial-t) (timeout unsigned) (ringid key-serial-t))
40  (deflong keyctl-set-reqkey-keyring (reqkey-defl int))
41  (deflong keyctl-set-timeout (key key-serial-t) (timeout unsigned))
42  (deflong keyctl-assume-authority (key key-serial-t))
43  (deflong keyctl-get-security (key key-serial-t) (buffer c-string) (buflen size-t))
44  (deflong keyctl-session-to-parent)
45  (deflong keyctl-reject (id key-serial-t) (timeout unsigned) (error unsigned) (ringid key-serial-t))
46  (deflong keyctl-instantiate-iov (id key-serial-t) (payload-iov (* iovec)) (ioc unsigned) (ringid key-serial-t))
47  (deflong keyctl-invalidate (id key-serial-t))
48  (deflong keyctl-get-persistent (uid sb-unix:uid-t) (id key-serial-t))
49  (deflong keyctl-dh-compute (priv key-serial-t) (prime key-serial-t)
50  (base key-serial-t) (buffer c-string) (buflen size-t))
51  (deflong keyctl-dh-compute-kdf (priv key-serial-t) (prime key-serial-t) (base key-serial-t) (hashname c-string)
52  (otherinfo c-string) (otherinfolen size-t) (buffer c-string) (buflen size-t))
53  (deflong keyctl-pkey-query (key-id key-serial-t) (info c-string) (result (* keyctl-pkey-query)))
54  (deflong keyctl-pkey-encrypt (key-id key-serial-t) (info c-string) (data (* t)) (data-len size-t))
55  (deflong keyctl-pkey-decrypt (key-id key-serial-t) (info c-string) (enc (* t)) (enc-len size-t))
56  (deflong keyctl-pkey-sign (key-id key-serial-t) (info c-string) (data (* t)) (data-len size-t))
57  (deflong keyctl-pkey-verify (key-id key-serial-t) (info c-string) (data (* t)) (data-len size-t)
58  (sig (* t)) (sig-len size-t))
59  (deflong keyctl-move (id key-serial-t) (from-ringid key-serial-t) (to-ringid key-serial-t) (flags unsigned-int))
60  (deflong keyctl-capabilities (buffer c-string) (len size-t))
61  (deflong keyctl-watch-key (id key-serial-t) (watch-queue-fd int) (watch-id int))
62  ;; utils
63  (defint keyctl-describe-alloc (id key-serial-t) (buffer (* c-string)))
64  (defint keyctl-read-alloc (id key-serial-t) (%buffer (* (* t))))
65  (defint keyctl-get-security-alloc (id key-serial-t) (%buffer (* (* t))))
66  (defint keyctl-dh-compute-alloc (priv key-serial-t) (prime key-serial-t)
67  (base key-serial-t) (%buffer (* (* t))))
68  ;; (defint recursive-key-scan)
69  ;; (defint recursive-session-key-scan)
70  (def find-key-by-type-and-desc (type c-string) (desc c-string) (destringid key-serial-t)))