+ if (strlen(argv[i]) == 40 && ishexstring(argv[i])) {
+ append.num_entries = 1;
+ if (append.version == 0) {
+ append.hashes = calloc(1, sizeof(trust_cache_hash0));
+ for (size_t j = 0; j < CS_CDHASH_LEN; j++)
+ sscanf(argv[i] + 2 * j, "%02hhx", &append.hashes[0][j]);
+ } else if (append.version == 1) {
+ append.entries = calloc(1, sizeof(struct trust_cache_entry1));
+ for (size_t j = 0; j < CS_CDHASH_LEN; j++)
+ sscanf(argv[i] + 2 * j, "%02hhx", &append.entries[0].cdhash[j]);
+ } else if (append.version == 2) {
+ append.entries2 = calloc(1, sizeof(struct trust_cache_entry2));
+ for (size_t j = 0; j < CS_CDHASH_LEN; j++)
+ sscanf(argv[i] + 2 * j, "%02hhx", &append.entries2[0].cdhash[j]);
+ }
+ } else {
+ append = cache_from_tree(argv[i], cache.version);
+ }