File: selabel_digest.3

package info (click to toggle)
android-platform-external-libselinux 10.0.0%2Br36-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 34,176 kB
  • sloc: ansic: 147,112; python: 25,790; makefile: 1,930; yacc: 1,389; sh: 1,206; lex: 452; xml: 180
file content (61 lines) | stat: -rw-r--r-- 1,327 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
.TH "selabel_digest" "3" "16 Sept 2015" "" "SELinux API documentation"
.SH "NAME"
selabel_digest \- Return digest of specfiles and list of files used
.
.SH "SYNOPSIS"
.B #include <selinux/selinux.h>
.br
.B #include <selinux/label.h>
.sp
.BI "int selabel_digest(struct selabel_handle *" hnd ,
.in +\w'int selabel_digest('u
.BI "unsigned char **" digest ,
.BI "size_t *" digest_len ,
.br
.BI "char ***" specfiles,
.BI "size_t *" num_specfiles ");"
.in
.
.SH "DESCRIPTION"
.BR selabel_digest ()
performs an operation on the handle
.IR hnd ,
returning the results of the SHA1 digest pointed to by
.IR digest ,
whose length will be
.IR digest_len .
The list of specfiles used in the SHA1 digest calculation is returned in
.I specfiles
with the number of entries in
.IR num_specfiles .
.sp
To enable
.BR selabel_digest ()
to return this information the
.B SELABEL_OPT_DIGEST
option must be enable in
.BR selabel_open (3).
.sp
The result of
.BR selabel_digest ()
must not be used after
.BR selabel_close (3).
.
.SH "RETURN VALUE"
On success, zero is returned.  On error, \-1 is returned and
.I errno
is set appropriately.
.
.SH "ERRORS"
.TP
.B EINVAL
No digest available (returned if
.B SELABEL_OPT_DIGEST
option not enabled).
.TP
.B ENOMEM
An attempt to allocate memory failed.
.
.SH "SEE ALSO"
.BR selabel_open (3),
.BR selinux (8)