]> git.cameronkatri.com Git - trustcache.git/blob - trustcache.1
Add support for new version 2 trustcaches
[trustcache.git] / trustcache.1
1 .\"-
2 .\" Copyright (c) 2022 Cameron Katri. All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\"
13 .\" THIS SOFTWARE IS PROVIDED BY CAMERON KATRI AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED. IN NO EVENT SHALL CAMERON KATRI OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 .\" SUCH DAMAGE.
24 .\"
25 .Dd June 16, 2022
26 .Dt TRUSTCACHE 1
27 .Os
28 .Sh NAME
29 .Nm trustcache
30 .Nd Create and interact with trustcaches
31 .Sh SYNOPSIS
32 .Nm
33 .Cm append
34 .Op Fl f Ar flags
35 .Op Fl u Ar uuid | 0
36 .Ar infile
37 .Ar
38 .Nm
39 .Cm create
40 .Op Fl u Ar uuid
41 .Op Fl v Ar version
42 .Ar outfile
43 .Ar
44 .Nm
45 .Cm info
46 .Op Fl c
47 .Op Fl h
48 .Op Fl e Ar entrynum
49 .Ar file
50 .Nm
51 .Cm remove
52 .Op Fl k
53 .Ar file
54 .Ar hash ...
55 .Sh DESCRIPTION
56 The
57 .Nm
58 utility is used to get info about and modify Apple trustcaches.
59 .Pp
60 The following commands are supported by
61 .Nm :
62 .Bl -tag -width create
63 .It Xo
64 .Cm append
65 .Op Fl f Ar flags
66 .Op Fl u Ar uuid | 0
67 .Ar infile
68 .Ar
69 .Xc
70 Modify the trustcache at
71 .Ar infile
72 to include each signed Mach-O at the specified paths.
73 If
74 .Ar file
75 is both 40 characters and hexadecimal, that hash will be added to the cache.
76 .Ar uuid
77 is used to specify a custom uuid to be used.
78 If it is
79 .Ar 0 ,
80 the uuid will be left the same, otherwise, it will be regenerated.
81 If
82 .Fl f
83 is specified, any new entries with have the flags specified at
84 .Ar flags .
85 .It Xo
86 .Cm create
87 .Op Fl u Ar uuid
88 .Op Fl v Ar version
89 .Ar outfile
90 .Ar
91 .Xc
92 Create a trustcache at
93 .Ar outfile .
94 Each Mach-O found in the specified inputs will be scanned for
95 a code signature and hashed.
96 Any malformed or unsigned Mach-O will be ignored.
97 Each slice of a FAT binary will have its hash included.
98 Versions 0, 1, and 2 are supported, if not specified, 1 is assumed.
99 If
100 .Ar uuid
101 is specified, that will be used instead of a randomly generated one.
102 .It Xo
103 .Cm info
104 .Op Fl c
105 .Op Fl h
106 .Op Fl e Ar entrynum
107 .Ar file
108 .Xc
109 Print information about
110 .Ar file .
111 The output for each hash will be in one of these formats:
112 .Pp
113 .Dl <cdhash> <flags> [<hash_type>]
114 .Dl <cdhash> <flags> [<hash_type>] [<category>]
115 .Pp
116 If the
117 .Fl c
118 is given, only the hashes will be printed.
119 If
120 .Fl h
121 is given, only the header will be printed.
122 If
123 .Ar entrynum
124 is specified, only that entry will be printed.
125 .It Xo
126 .Cm remove
127 .Op Fl k
128 .Ar file
129 .Ar hash ...
130 .Xc
131 Remove each specified hash from
132 .Ar file .
133 If
134 .Fl k
135 is specified, the uuid will not be regenerated.
136 The number of removed entries will be printed.
137 .El
138 .Sh EXIT STATUS
139 .Ex -std
140 .Sh SEE ALSO
141 .Xr cryptex-dump-trust-cache 1 ,
142 .Xr cryptex-generate-trust-cache 1
143 .Sh HISTORY
144 The
145 .Nm
146 utility was written by
147 .An Cameron Katri Aq Mt me@cameronkatri.com .