tal
origin = tal;
mtforigin = tal;
} else if (mtforigin == tal) {
repo_stat_inc(struct repo *repo, int tal, enum rtype type, enum stype subtype)
struct tal *tal;
tal = tal_parse(tal_path, buf, len);
if (tal == NULL)
p = ta_validate(cert_path, p, tal->spki, tal->spkisz);
tal_free(tal);
struct tal *tal;
tal = tal_parse(argv[i], buf, len);
if (tal == NULL)
tal_print(tal);
tal_free(tal);
const char *tal = tals[talid];
if (rtype_from_file_extension(tal) != RTYPE_TAL)
len = strlen(tal) - 4;
if (asprintf(&constraints, "%.*s.constraints", (int)len, tal) == -1)
err(1, "failed to load constraints for %s", tal);
void tal_buffer(struct ibuf *, const struct tal *);
void tal_free(struct tal *);
struct tal *tal_parse(const char *, char *, size_t);
struct tal *tal_read(struct ibuf *);
struct repo *ta_lookup(int, struct tal *);
void tal_print(const struct tal *);
parse_load_ta(struct tal *tal)
filename = strrchr(tal->uri[0], '/');
if (asprintf(&file, "ta/%s%s", tal->descr, filename) == -1)
cert = cert_parse_ta(file, f, flen, tal->spki, tal->spkisz);
cert->talid = tal->id;
for (i = 0; i < tal->num_uris; i++) {
if (strncasecmp(tal->uri[i], RSYNC_PROTO, RSYNC_PROTO_LEN) != 0)
uripath_add(tal->uri[i], cert);
static struct tal *
struct tal *tal;
tal = talobj[i];
spki = tal->spki;
tal_pkey = d2i_PUBKEY(NULL, &spki, tal->spkisz);
return tal;
struct tal *tal = NULL;
struct tal *talobj[TALSZ_MAX];
tal = tal_parse(file, buf, len);
if (tal == NULL)
tal_print(tal);
if ((tal = find_tal(cert)) != NULL) {
cert = ta_validate(file, cert, tal->spki, tal->spkisz);
json_do_string("tal", tal->descr);
tal->descr);
tal = NULL;
tal_free(tal);
struct tal *tal;
if ((tal = tal_parse(entp->file, entp->data,
tal->id = entp->talid;
talobj[tal->id] = tal;
parse_load_ta(tal);
queue_add_from_tal(struct tal *tal)
assert(tal->num_uris > 0);
if ((taldescs[tal->id] = strdup(tal->descr)) == NULL)
nfile = strrchr(tal->uri[0], '/');
repo = ta_lookup(tal->id, tal);
data = tal->spki;
tal->spki = NULL;
tal->spkisz, tal->id, tal->id, NULL);
struct tal *tal;
tal = tal_read(b);
queue_add_from_tal(tal);
tal_free(tal);
struct tal *tal;
if ((tal = tal_parse(entp->file, entp->data,
tal->id = entp->talid;
tal_buffer(b, tal);
tal_free(tal);
tal_print(const struct tal *p)
ta_lookup(int id, struct tal *tal)
if (tal->num_uris == 0)
errx(1, "TAL %s has no URI", tal->descr);
if (strcmp(rp->repouri, tal->uri[0]) == 0)
rp->basedir = repo_dir(tal->descr, "ta", 0);
if ((rp->repouri = strdup(tal->uri[0])) == NULL)
rp->ta = ta_get(tal);
ta_get(struct tal *tal)
if ((tr->descr = strdup(tal->descr)) == NULL)
tr->basedir = repo_dir(tal->descr, ".ta", 0);
tr->num_uris = tal->num_uris;
tr->uri = tal->uri;
tal->num_uris = 0;
tal->uri = NULL;
if (tal->uri == NULL)
tal->uri[tal->num_uris] = strdup(line);
if (tal->uri[tal->num_uris] == NULL)
tal->num_uris++;
if (tal->num_uris == 0) {
qsort(tal->uri, tal->num_uris, sizeof(tal->uri[0]), tal_cmp);
tal->spki = der;
tal->spkisz = dersz;
if (der != tal->spki + tal->spkisz) {
tal->spki + tal->spkisz - der);
tal_free(tal);
tal = NULL;
return tal;
struct tal *
struct tal *p;
tal_free(struct tal *p)
tal_buffer(struct ibuf *b, const struct tal *p)
struct tal *
struct tal *p;
if ((p = calloc(1, sizeof(struct tal))) == NULL)
static struct tal *
struct tal *tal = NULL;
if ((tal = calloc(1, sizeof(struct tal))) == NULL)
tal->uri = reallocarray(tal->uri,
tal->num_uris + 1, sizeof(char *));