ccr_mft
if (ccr_mft_cmp(ccr_mft, prev) <= 0) {
ccr_mft->aki, sizeof(ccr_mft->aki))) {
ccr_mft->size = size;
ccr_mft->seqnum = x509_convert_seqnum(fn, "manifest number",
if (ccr_mft->seqnum == NULL)
"thisUpdate", mi->thisUpdate, &ccr_mft->thisupdate))
&ccr_mft->sia))
SLIST_INSERT_HEAD(&ccr_mft->subordinates, sub, entry);
if (RB_INSERT(ccr_mft_tree, &ccr->mfts, ccr_mft) != NULL) {
prev = ccr_mft;
ccr_mft = NULL;
ccr_mft_free(ccr_mft);
append_cached_manifest(STACK_OF(ManifestInstance) *mis, struct ccr_mft *cm)
struct ccr_mft *cm;
struct ccr_mft *m, needle = { 0 };
ccr_mft_cmp(const struct ccr_mft *a, const struct ccr_mft *b)
RB_GENERATE(ccr_mft_tree, ccr_mft, entry, ccr_mft_cmp);
static struct ccr_mft *
struct ccr_mft *ccr_mft = NULL;
if ((ccr_mft = calloc(1, sizeof(*ccr_mft))) == NULL)
SLIST_INIT(&ccr_mft->subordinates);
return ccr_mft;
struct ccr_mft *ccr_mft;
ccr_mft = ccr_mft_new();
if (hex_decode(mft->aki, ccr_mft->aki, sizeof(ccr_mft->aki)) != 0)
if ((ccr_mft->sia = strdup(mft->sia)) == NULL)
if ((ccr_mft->seqnum = strdup(mft->seqnum)) == NULL)
memcpy(ccr_mft->hash, mft->mfthash, sizeof(ccr_mft->hash));
ccr_mft->size = mft->mftsize;
ccr_mft->thisupdate = mft->thisupdate;
if (RB_INSERT(ccr_mft_tree, tree, ccr_mft) != NULL)
ccr_mft_free(struct ccr_mft *ccr_mft)
if (ccr_mft == NULL)
while (!SLIST_EMPTY(&ccr_mft->subordinates)) {
sub_ski = SLIST_FIRST(&ccr_mft->subordinates);
SLIST_REMOVE_HEAD(&ccr_mft->subordinates, entry);
free(ccr_mft->seqnum);
free(ccr_mft->sia);
free(ccr_mft);
struct ccr_mft *ccr_mft, *tmp_ccr_mft;
RB_FOREACH_SAFE(ccr_mft, ccr_mft_tree, mfts, tmp_ccr_mft) {
RB_REMOVE(ccr_mft_tree, mfts, ccr_mft);
ccr_mft_free(ccr_mft);
struct ccr_mft *ccr_mft = NULL, *prev;
ccr_mft = ccr_mft_new();
ccr_mft->hash, sizeof(ccr_mft->hash))) {
RB_ENTRY(ccr_mft) entry;
RB_HEAD(ccr_mft_tree, ccr_mft);
RB_PROTOTYPE(ccr_mft_tree, ccr_mft, entry, ccr_mft_cmp);
struct ccr_mft *ccr_mft;
RB_FOREACH(ccr_mft, ccr_mft_tree, &ccr->mfts) {
if (base64_encode(ccr_mft->hash, SHA256_DIGEST_LENGTH, &hash)
aki = hex_encode(ccr_mft->aki, SHA_DIGEST_LENGTH);
json_do_uint("size", ccr_mft->size);
json_do_string("seqnum", ccr_mft->seqnum);
json_do_int("thisupdate", ccr_mft->thisupdate);
json_do_string("sia", ccr_mft->sia);
SLIST_FOREACH(sub, &ccr_mft->subordinates, entry) {
ccr_mft->size, aki, ccr_mft->seqnum,
(long long)ccr_mft->thisupdate, ccr_mft->sia);
SLIST_FOREACH(sub, &ccr_mft->subordinates, entry) {