]> git.cameronkatri.com Git - trustcache.git/blob - tc.1
Add tc remove and append -f flags
[trustcache.git] / tc.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 May 19, 2022
26 .Dt TC 1
27 .Os
28 .Sh NAME
29 .Nm tc
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 in the specified path.
73 .Ar uuid
74 is used to specify a custom uuid to be used.
75 If it is
76 .Ar 0 ,
77 the uuid will be left the same, otherwise, it will be regenerated.
78 If
79 .Fl f
80 is specified, any new entries with have the flags specified at
81 .Ar flags .
82 .It Xo
83 .Cm create
84 .Op Fl u Ar uuid
85 .Op Fl v Ar version
86 .Ar outfile
87 .Ar
88 .Xc
89 Create a trustcache at
90 .Ar outfile .
91 Each Mach-O found in the specified inputs will be scanned for
92 a code signature and hashed.
93 Any malformed or unsigned Mach-O will be ignored.
94 Each slice of a FAT binary will have its hash included.
95 Versions 0 and 1 are supported, if not specified, 1 is assumed.
96 If
97 .Ar uuid
98 is specified, that will be used instead of a randomly generated one.
99 .It Xo
100 .Cm info
101 .Op Fl c
102 .Op Fl h
103 .Op Fl e Ar entrynum
104 .Ar file
105 .Xc
106 Print information about
107 .Ar file .
108 The output for each hash will be in the format:
109 .Pp
110 .Dl <cdhash> <flags> [<hash_type>]
111 .Pp
112 If the
113 .Fl c
114 is given, only the hashes will be printed.
115 If
116 .Fl h
117 is given, only the header will be printed.
118 If
119 .Ar entrynum
120 is specified, only that entry will be printed.
121 .It Xo
122 .Cm remove
123 .Op Fl k
124 .Ar file
125 .Ar hash ...
126 .Xc
127 Remove each specified hash from
128 .Ar file .
129 If
130 .Fl k
131 is specified, the uuid will not be regenerated.
132 The number of removed entries will be printed.
133 .El
134 .Sh EXIT STATUS
135 .Ex -std
136 .Sh SEE ALSO
137 .Xr cryptex-dump-trust-cache 1 ,
138 .Xr cryptex-generate-trust-cache 1
139 .Sh HISTORY
140 The
141 .Nm
142 utility was written by
143 .An Cameron Katri Aq Mt me@cameronkatri.com .