]>
git.cameronkatri.com Git - trustcache.git/blob - trustcache.h
8 # include <libkern/OSByteOrder.h>
9 # define htole32(x) OSSwapHostToLittleInt32(x)
10 # define le32toh(x) OSSwapLittleToHostInt32(x)
11 #elif __has_include(<endian.h>)
14 # include <sys/endian.h>
17 #include "machoparse/cs_blobs.h"
18 #include "uuid/uuid.h"
20 struct trust_cache_entry1
{
21 uint8_t cdhash
[CS_CDHASH_LEN
];
26 typedef uint8_t trust_cache_hash0
[CS_CDHASH_LEN
];
33 struct trust_cache_entry1
*entries
;
34 trust_cache_hash0
*hashes
;
36 } __attribute__((__packed__
));
39 #define CS_TRUST_CACHE_AMFID 0x1
40 #define CS_TRUST_CACHE_ANE 0x2
42 struct trust_cache
opentrustcache(const char *path
);
43 struct trust_cache
cache_from_tree(const char *path
, uint32_t version
);
45 int tcinfo(int argc
, char **argv
);
46 int tccreate(int argc
, char **argv
);
47 int tcappend(int argc
, char **argv
);
48 int tcremove(int argc
, char **argv
);
50 int ent_cmp(const void * vp1
, const void * vp2
);
51 int hash_cmp(const void * vp1
, const void * vp2
);
53 void print_header(struct trust_cache cache
);
54 void print_hash(uint8_t cdhash
[CS_CDHASH_LEN
], bool newline
);
55 void print_entry(struct trust_cache_entry1 entry
);
56 void print_entries(struct trust_cache cache
);