Lines Matching +full:pk +full:- +full:pk
35 rsa_bit_length(const br_rsa_public_key *pk) in rsa_bit_length() argument
40 for (u = 0; u < pk->nlen; u ++) { in rsa_bit_length()
41 if (pk->n[u] != 0) { in rsa_bit_length()
45 if (u == pk->nlen) { in rsa_bit_length()
48 bl = (unsigned)(pk->nlen - u - 1) << 3; in rsa_bit_length()
49 x = pk->n[u]; in rsa_bit_length()
58 print_rsa(const br_rsa_public_key *pk, int print_text, int print_C) in print_rsa() argument
64 for (u = 0; u < pk->nlen; u ++) { in print_rsa()
65 printf("%02X", pk->n[u]); in print_rsa()
69 for (u = 0; u < pk->elen; u ++) { in print_rsa()
70 printf("%02X", pk->e[u]); in print_rsa()
78 for (u = 0; u < pk->nlen; u ++) { in print_rsa()
87 printf("0x%02X", pk->n[u]); in print_rsa()
91 for (u = 0; u < pk->elen; u ++) { in print_rsa()
100 printf("0x%02X", pk->e[u]); in print_rsa()
111 print_ec(const br_ec_public_key *pk, int print_text, int print_C) in print_ec() argument
117 for (u = 0; u < pk->qlen; u ++) { in print_ec()
118 printf("%02X", pk->q[u]); in print_ec()
126 for (u = 0; u < pk->qlen; u ++) { in print_ec()
135 printf("0x%02X", pk->q[u]); in print_ec()
139 printf("\t%d,\n", pk->curve); in print_ec()
153 " -q suppress verbose messages\n"); in usage_verify()
155 " -sni name check presence of a specific server name\n"); in usage_verify()
157 " -CA file add certificates in 'file' to trust anchors\n"); in usage_verify()
159 " -text print public key details (human-readable)\n"); in usage_verify()
161 " -C print public key details (C code)\n"); in usage_verify()
169 xfree(xc->data); in free_cert_contents()
186 br_x509_pkey *pk; in do_verify() local
195 pk = NULL; in do_verify()
200 if (arg[0] != '-') { in do_verify()
213 if (eqstr(arg, "-v") || eqstr(arg, "-verbose")) { in do_verify()
215 } else if (eqstr(arg, "-q") || eqstr(arg, "-quiet")) { in do_verify()
217 } else if (eqstr(arg, "-sni")) { in do_verify()
220 "ERROR: no argument for '-sni'\n"); in do_verify()
231 } else if (eqstr(arg, "-CA")) { in do_verify()
234 "ERROR: no argument for '-CA'\n"); in do_verify()
244 } else if (eqstr(arg, "-text")) { in do_verify()
246 } else if (eqstr(arg, "-C")) { in do_verify()
270 mc.vtable->start_chain(&mc.vtable, sni); in do_verify()
275 mc.vtable->start_cert(&mc.vtable, xc->data_len); in do_verify()
276 mc.vtable->append(&mc.vtable, xc->data, xc->data_len); in do_verify()
277 mc.vtable->end_cert(&mc.vtable); in do_verify()
279 err = mc.vtable->end_chain(&mc.vtable); in do_verify()
280 tpk = mc.vtable->get_pkey(&mc.vtable, &usages); in do_verify()
282 pk = xpkeydup(tpk); in do_verify()
315 retcode = -1; in do_verify()
317 if (pk != NULL) { in do_verify()
318 switch (pk->key_type) { in do_verify()
322 rsa_bit_length(&pk->key.rsa)); in do_verify()
324 print_rsa(&pk->key.rsa, print_text, print_C); in do_verify()
329 ec_curve_name(pk->key.ec.curve)); in do_verify()
331 print_ec(&pk->key.ec, print_text, print_C); in do_verify()
347 xfreepkey(pk); in do_verify()
351 retcode = -1; in do_verify()