Lines Matching refs:dch
247 free_dest_constraint_hop(struct dest_constraint_hop *dch) in free_dest_constraint_hop() argument
251 if (dch == NULL) in free_dest_constraint_hop()
253 free(dch->user); in free_dest_constraint_hop()
254 free(dch->hostname); in free_dest_constraint_hop()
255 for (i = 0; i < dch->nkeys; i++) in free_dest_constraint_hop()
256 sshkey_free(dch->keys[i]); in free_dest_constraint_hop()
257 free(dch->keys); in free_dest_constraint_hop()
258 free(dch->key_is_ca); in free_dest_constraint_hop()
275 dup_dest_constraint_hop(const struct dest_constraint_hop *dch, in dup_dest_constraint_hop() argument
281 out->user = dch->user == NULL ? NULL : xstrdup(dch->user); in dup_dest_constraint_hop()
282 out->hostname = dch->hostname == NULL ? NULL : xstrdup(dch->hostname); in dup_dest_constraint_hop()
283 out->is_ca = dch->is_ca; in dup_dest_constraint_hop()
284 out->nkeys = dch->nkeys; in dup_dest_constraint_hop()
289 for (i = 0; i < dch->nkeys; i++) { in dup_dest_constraint_hop()
290 if (dch->keys[i] != NULL && in dup_dest_constraint_hop()
291 (r = sshkey_from_private(dch->keys[i], in dup_dest_constraint_hop()
294 out->key_is_ca[i] = dch->key_is_ca[i]; in dup_dest_constraint_hop()
317 dump_dest_constraint_hop(const struct dest_constraint_hop *dch) in dump_dest_constraint_hop() argument
323 dch->user == NULL ? "(null)" : dch->user, in dump_dest_constraint_hop()
324 dch->hostname == NULL ? "(null)" : dch->hostname, in dump_dest_constraint_hop()
325 dch->is_ca, dch->nkeys); in dump_dest_constraint_hop()
326 for (i = 0; i < dch->nkeys; i++) { in dump_dest_constraint_hop()
328 if (dch->keys[i] != NULL && in dump_dest_constraint_hop()
329 (fp = sshkey_fingerprint(dch->keys[i], in dump_dest_constraint_hop()
332 debug_f("key %u/%u: %s%s%s key_is_ca %d", i, dch->nkeys, in dump_dest_constraint_hop()
333 dch->keys[i] == NULL ? "" : sshkey_ssh_name(dch->keys[i]), in dump_dest_constraint_hop()
334 dch->keys[i] == NULL ? "" : " ", in dump_dest_constraint_hop()
335 dch->keys[i] == NULL ? "none" : fp, in dump_dest_constraint_hop()
336 dch->key_is_ca[i]); in dump_dest_constraint_hop()
377 const struct dest_constraint_hop *dch) in match_key_hop() argument
380 const char *hostname = dch->hostname ? dch->hostname : "(ORIGIN)"; in match_key_hop()
391 tag, hostname, sshkey_type(key), fp, dch->nkeys); in match_key_hop()
393 for (i = 0; i < dch->nkeys; i++) { in match_key_hop()
394 if (dch->keys[i] == NULL) in match_key_hop()
397 if ((fp = sshkey_fingerprint(dch->keys[i], SSH_FP_HASH_DEFAULT, in match_key_hop()
401 dch->key_is_ca[i] ? "CA " : "", in match_key_hop()
402 sshkey_type(dch->keys[i]), fp); in match_key_hop()
406 if (dch->key_is_ca[i] || in match_key_hop()
407 !sshkey_equal(key, dch->keys[i])) in match_key_hop()
412 if (!dch->key_is_ca[i]) in match_key_hop()
416 if (!sshkey_equal(key->cert->signature_key, dch->keys[i])) in match_key_hop()
1088 parse_dest_constraint_hop(struct sshbuf *b, struct dest_constraint_hop *dch) in parse_dest_constraint_hop() argument
1096 memset(dch, '\0', sizeof(*dch)); in parse_dest_constraint_hop()
1097 if ((r = sshbuf_get_cstring(b, &dch->user, NULL)) != 0 || in parse_dest_constraint_hop()
1098 (r = sshbuf_get_cstring(b, &dch->hostname, NULL)) != 0 || in parse_dest_constraint_hop()
1108 if (*dch->hostname == '\0') { in parse_dest_constraint_hop()
1109 free(dch->hostname); in parse_dest_constraint_hop()
1110 dch->hostname = NULL; in parse_dest_constraint_hop()
1112 if (*dch->user == '\0') { in parse_dest_constraint_hop()
1113 free(dch->user); in parse_dest_constraint_hop()
1114 dch->user = NULL; in parse_dest_constraint_hop()
1117 dch->keys = xrecallocarray(dch->keys, dch->nkeys, in parse_dest_constraint_hop()
1118 dch->nkeys + 1, sizeof(*dch->keys)); in parse_dest_constraint_hop()
1119 dch->key_is_ca = xrecallocarray(dch->key_is_ca, dch->nkeys, in parse_dest_constraint_hop()
1120 dch->nkeys + 1, sizeof(*dch->key_is_ca)); in parse_dest_constraint_hop()
1128 dch->user == NULL ? "" : dch->user, in parse_dest_constraint_hop()
1129 dch->user == NULL ? "" : "@", in parse_dest_constraint_hop()
1130 dch->hostname, key_is_ca ? "CA " : "", sshkey_type(k), fp); in parse_dest_constraint_hop()
1132 dch->keys[dch->nkeys] = k; in parse_dest_constraint_hop()
1133 dch->key_is_ca[dch->nkeys] = key_is_ca != 0; in parse_dest_constraint_hop()
1134 dch->nkeys++; in parse_dest_constraint_hop()