Lines Matching refs:p

76 	struct param *p;  in unpack()  local
79 if ((p = calloc(1, sizeof(*p))) == NULL || in unpack()
88 if (unpack_byte(v[0], &p->rk) < 0 || in unpack()
89 unpack_byte(v[1], &p->type) < 0 || in unpack()
90 unpack_byte(v[2], &p->opt) < 0 || in unpack()
91 unpack_byte(v[3], &p->uv) < 0 || in unpack()
92 unpack_byte(v[4], &p->excl_count) < 0 || in unpack()
93 unpack_int(v[5], &p->ext) < 0 || in unpack()
94 unpack_int(v[6], &p->seed) < 0 || in unpack()
95 unpack_string(v[7], p->pin) < 0 || in unpack()
96 unpack_string(v[8], p->rp_id) < 0 || in unpack()
97 unpack_string(v[9], p->rp_name) < 0 || in unpack()
98 unpack_string(v[10], p->user_icon) < 0 || in unpack()
99 unpack_string(v[11], p->user_name) < 0 || in unpack()
100 unpack_string(v[12], p->user_nick) < 0 || in unpack()
101 unpack_blob(v[13], &p->cdh) < 0 || in unpack()
102 unpack_blob(v[14], &p->user_id) < 0 || in unpack()
103 unpack_blob(v[15], &p->wire_data) < 0 || in unpack()
104 unpack_blob(v[16], &p->excl_cred) < 0) in unpack()
110 free(p); in unpack()
111 p = NULL; in unpack()
117 return p; in unpack()
121 pack(uint8_t *ptr, size_t len, const struct param *p) in pack() argument
130 (argv[0] = pack_byte(p->rk)) == NULL || in pack()
131 (argv[1] = pack_byte(p->type)) == NULL || in pack()
132 (argv[2] = pack_byte(p->opt)) == NULL || in pack()
133 (argv[3] = pack_byte(p->uv)) == NULL || in pack()
134 (argv[4] = pack_byte(p->excl_count)) == NULL || in pack()
135 (argv[5] = pack_int(p->ext)) == NULL || in pack()
136 (argv[6] = pack_int(p->seed)) == NULL || in pack()
137 (argv[7] = pack_string(p->pin)) == NULL || in pack()
138 (argv[8] = pack_string(p->rp_id)) == NULL || in pack()
139 (argv[9] = pack_string(p->rp_name)) == NULL || in pack()
140 (argv[10] = pack_string(p->user_icon)) == NULL || in pack()
141 (argv[11] = pack_string(p->user_name)) == NULL || in pack()
142 (argv[12] = pack_string(p->user_nick)) == NULL || in pack()
143 (argv[13] = pack_blob(&p->cdh)) == NULL || in pack()
144 (argv[14] = pack_blob(&p->user_id)) == NULL || in pack()
145 (argv[15] = pack_blob(&p->wire_data)) == NULL || in pack()
146 (argv[16] = pack_blob(&p->excl_cred)) == NULL) in pack()
350 test_cred(const struct param *p) in test_cred() argument
358 switch (p->type & 3) { in test_cred()
373 set_wire_data(p->wire_data.body, p->wire_data.len); in test_cred()
375 make_cred(cred, p->opt, cose_alg, &p->cdh, p->rp_id, p->rp_name, in test_cred()
376 &p->user_id, p->user_name, p->user_nick, p->user_icon, p->ext, in test_cred()
377 p->rk, p->uv, p->pin, p->excl_count, &p->excl_cred); in test_cred()
384 fido_cred_authdata_raw_len(cred), p->ext, p->rk, p->uv, in test_cred()
395 test_touch(const struct param *p) in test_touch() argument
401 set_wire_data(p->wire_data.body, p->wire_data.len); in test_touch()
403 if ((dev = open_dev(p->opt & 2)) == NULL) in test_touch()
405 if (p->opt & 1) in test_touch()
420 test_misc(const struct param *p) in test_misc() argument
428 fido_cred_set_id(cred, p->user_id.body, p->user_id.len); in test_misc()
434 test(const struct param *p) in test() argument
436 prng_init((unsigned int)p->seed); in test()
441 test_cred(p); in test()
442 test_touch(p); in test()
443 test_misc(p); in test()
447 mutate(struct param *p, unsigned int seed, unsigned int flags) NO_MSAN in mutate() argument
450 p->seed = (int)seed; in mutate()
453 mutate_byte(&p->rk); in mutate()
454 mutate_byte(&p->type); in mutate()
455 mutate_byte(&p->opt); in mutate()
456 mutate_byte(&p->uv); in mutate()
457 mutate_byte(&p->excl_count); in mutate()
458 mutate_int(&p->ext); in mutate()
459 mutate_blob(&p->cdh); in mutate()
460 mutate_blob(&p->user_id); in mutate()
461 mutate_blob(&p->excl_cred); in mutate()
462 mutate_string(p->pin); in mutate()
463 mutate_string(p->user_icon); in mutate()
464 mutate_string(p->user_name); in mutate()
465 mutate_string(p->user_nick); in mutate()
466 mutate_string(p->rp_id); in mutate()
467 mutate_string(p->rp_name); in mutate()
471 if (p->opt & 1) { in mutate()
472 p->wire_data.len = sizeof(dummy_wire_data_u2f); in mutate()
473 memcpy(&p->wire_data.body, &dummy_wire_data_u2f, in mutate()
474 p->wire_data.len); in mutate()
476 p->wire_data.len = sizeof(dummy_wire_data_fido); in mutate()
477 memcpy(&p->wire_data.body, &dummy_wire_data_fido, in mutate()
478 p->wire_data.len); in mutate()
480 mutate_blob(&p->wire_data); in mutate()