Lines Matching refs:out
52 static int print_labeled_bignum(BIO *out, const char *label, const BIGNUM *bn) in DEFINE_SPECIAL_STACK_OF_CONST()
70 return BIO_printf(out, "%s%s0\n", label, post_label_spc); in DEFINE_SPECIAL_STACK_OF_CONST()
78 return BIO_printf(out, "%s%s%s" BN_FMTu " (%s0x" BN_FMTx ")\n", in DEFINE_SPECIAL_STACK_OF_CONST()
91 if (BIO_printf(out, "%s%s\n", label, neg) <= 0) in DEFINE_SPECIAL_STACK_OF_CONST()
97 if (BIO_printf(out, "%s", spaces) <= 0) in DEFINE_SPECIAL_STACK_OF_CONST()
102 if (BIO_printf(out, "%02x", 0) <= 0) in DEFINE_SPECIAL_STACK_OF_CONST()
110 if (BIO_printf(out, ":\n%s", spaces) <= 0) in DEFINE_SPECIAL_STACK_OF_CONST()
114 if (BIO_printf(out, "%s%c%c", use_sep ? ":" : "", in DEFINE_SPECIAL_STACK_OF_CONST()
122 if (BIO_printf(out, "\n") <= 0) in DEFINE_SPECIAL_STACK_OF_CONST()
134 static int print_labeled_buf(BIO *out, const char *label, in print_labeled_buf() argument
139 if (BIO_printf(out, "%s\n", label) <= 0) in print_labeled_buf()
144 if (i > 0 && BIO_printf(out, "\n") <= 0) in print_labeled_buf()
146 if (BIO_printf(out, " ") <= 0) in print_labeled_buf()
150 if (BIO_printf(out, "%02x%s", buf[i], in print_labeled_buf()
154 if (BIO_printf(out, "\n") <= 0) in print_labeled_buf()
162 static int ffc_params_to_text(BIO *out, const FFC_PARAMS *ffc) in ffc_params_to_text() argument
171 if (BIO_printf(out, "GROUP: %s\n", name) <= 0) in ffc_params_to_text()
180 if (!print_labeled_bignum(out, "P: ", ffc->p)) in ffc_params_to_text()
183 if (!print_labeled_bignum(out, "Q: ", ffc->q)) in ffc_params_to_text()
186 if (!print_labeled_bignum(out, "G: ", ffc->g)) in ffc_params_to_text()
189 if (!print_labeled_bignum(out, "J: ", ffc->j)) in ffc_params_to_text()
193 if (!print_labeled_buf(out, "SEED:", ffc->seed, ffc->seedlen)) in ffc_params_to_text()
197 if (BIO_printf(out, "gindex: %d\n", ffc->gindex) <= 0) in ffc_params_to_text()
201 if (BIO_printf(out, "pcounter: %d\n", ffc->pcounter) <= 0) in ffc_params_to_text()
205 if (BIO_printf(out, "h: %d\n", ffc->h) <= 0) in ffc_params_to_text()
217 static int dh_to_text(BIO *out, const void *key, int selection) in dh_to_text() argument
226 if (out == NULL || dh == NULL) { in dh_to_text()
266 if (BIO_printf(out, "%s: (%d bit)\n", type_label, BN_num_bits(p)) <= 0) in dh_to_text()
269 && !print_labeled_bignum(out, "private-key:", priv_key)) in dh_to_text()
272 && !print_labeled_bignum(out, "public-key:", pub_key)) in dh_to_text()
275 && !ffc_params_to_text(out, params)) in dh_to_text()
279 && BIO_printf(out, "recommended-private-length: %ld bits\n", in dh_to_text()
293 static int dsa_to_text(BIO *out, const void *key, int selection) in dsa_to_text() argument
301 if (out == NULL || dsa == NULL) { in dsa_to_text()
341 if (BIO_printf(out, "%s: (%d bit)\n", type_label, BN_num_bits(p)) <= 0) in dsa_to_text()
344 && !print_labeled_bignum(out, "priv:", priv_key)) in dsa_to_text()
347 && !print_labeled_bignum(out, "pub: ", pub_key)) in dsa_to_text()
350 && !ffc_params_to_text(out, params)) in dsa_to_text()
362 static int ec_param_explicit_curve_to_text(BIO *out, const EC_GROUP *group, in ec_param_explicit_curve_to_text() argument
380 || BIO_printf(out, "Basis Type: %s\n", OBJ_nid2sn(basis_type)) <= 0) in ec_param_explicit_curve_to_text()
384 return print_labeled_bignum(out, plabel, p) in ec_param_explicit_curve_to_text()
385 && print_labeled_bignum(out, "A: ", a) in ec_param_explicit_curve_to_text()
386 && print_labeled_bignum(out, "B: ", b); in ec_param_explicit_curve_to_text()
389 static int ec_param_explicit_gen_to_text(BIO *out, const EC_GROUP *group, in ec_param_explicit_gen_to_text() argument
423 ret = print_labeled_buf(out, glabel, buf, buflen); in ec_param_explicit_gen_to_text()
429 static int ec_param_explicit_to_text(BIO *out, const EC_GROUP *group, in ec_param_explicit_to_text() argument
454 if (BIO_printf(out, "Field Type: %s\n", OBJ_nid2sn(tmp_nid)) <= 0 in ec_param_explicit_to_text()
455 || !ec_param_explicit_curve_to_text(out, group, ctx) in ec_param_explicit_to_text()
456 || !ec_param_explicit_gen_to_text(out, group, ctx) in ec_param_explicit_to_text()
457 || !print_labeled_bignum(out, "Order: ", order) in ec_param_explicit_to_text()
459 && !print_labeled_bignum(out, "Cofactor: ", cofactor)) in ec_param_explicit_to_text()
461 && !print_labeled_buf(out, "Seed:", seed, seed_len))) in ec_param_explicit_to_text()
470 static int ec_param_to_text(BIO *out, const EC_GROUP *group, in ec_param_to_text() argument
481 if (BIO_printf(out, "%s: %s\n", "ASN1 OID", OBJ_nid2sn(curve_nid)) <= 0) in ec_param_to_text()
486 || BIO_printf(out, "%s: %s\n", "NIST CURVE", curve_name) > 0); in ec_param_to_text()
488 return ec_param_explicit_to_text(out, group, libctx); in ec_param_to_text()
492 static int ec_to_text(BIO *out, const void *key, int selection) in ec_to_text() argument
501 if (out == NULL || ec == NULL) { in ec_to_text()
544 && BIO_printf(out, "%s: (%d bit)\n", type_label, in ec_to_text()
548 && !print_labeled_buf(out, "priv:", priv, priv_len)) in ec_to_text()
551 && !print_labeled_buf(out, "pub:", pub, pub_len)) in ec_to_text()
554 ret = ec_param_to_text(out, group, ossl_ec_key_get_libctx(ec)); in ec_to_text()
571 static int ecx_to_text(BIO *out, const void *key, int selection) in ecx_to_text() argument
576 if (out == NULL || ecx == NULL) { in ecx_to_text()
602 if (BIO_printf(out, "%s Private-Key:\n", type_label) <= 0) in ecx_to_text()
604 if (!print_labeled_buf(out, "priv:", ecx->privkey, ecx->keylen)) in ecx_to_text()
613 if (BIO_printf(out, "%s Public-Key:\n", type_label) <= 0) in ecx_to_text()
617 if (!print_labeled_buf(out, "pub:", ecx->pubkey, ecx->keylen)) in ecx_to_text()
631 static int rsa_to_text(BIO *out, const void *key, int selection) in rsa_to_text() argument
645 if (out == NULL || rsa == NULL) { in rsa_to_text()
674 if (BIO_printf(out, "%s: (%d bit, %d primes)\n", in rsa_to_text()
678 if (BIO_printf(out, "%s: (%d bit)\n", in rsa_to_text()
683 if (!print_labeled_bignum(out, modulus_label, rsa_n)) in rsa_to_text()
685 if (!print_labeled_bignum(out, exponent_label, rsa_e)) in rsa_to_text()
690 if (!print_labeled_bignum(out, "privateExponent:", rsa_d)) in rsa_to_text()
692 if (!print_labeled_bignum(out, "prime1:", in rsa_to_text()
695 if (!print_labeled_bignum(out, "prime2:", in rsa_to_text()
698 if (!print_labeled_bignum(out, "exponent1:", in rsa_to_text()
701 if (!print_labeled_bignum(out, "exponent2:", in rsa_to_text()
704 if (!print_labeled_bignum(out, "coefficient:", in rsa_to_text()
708 if (BIO_printf(out, "prime%d:", i + 1) <= 0) in rsa_to_text()
710 if (!print_labeled_bignum(out, NULL, in rsa_to_text()
713 if (BIO_printf(out, "exponent%d:", i + 1) <= 0) in rsa_to_text()
715 if (!print_labeled_bignum(out, NULL, in rsa_to_text()
718 if (BIO_printf(out, "coefficient%d:", i + 1) <= 0) in rsa_to_text()
720 if (!print_labeled_bignum(out, NULL, in rsa_to_text()
730 if (BIO_printf(out, "(INVALID PSS PARAMETERS)\n") <= 0) in rsa_to_text()
736 if (BIO_printf(out, "No PSS parameter restrictions\n") <= 0) in rsa_to_text()
748 if (BIO_printf(out, "PSS parameter restrictions:\n") <= 0) in rsa_to_text()
750 if (BIO_printf(out, " Hash Algorithm: %s%s\n", in rsa_to_text()
755 if (BIO_printf(out, " Mask Algorithm: %s with %s%s\n", in rsa_to_text()
762 if (BIO_printf(out, " Minimum Salt Length: %d%s\n", in rsa_to_text()
766 if (BIO_printf(out, " Trailer Field: 0x%x%s\n", in rsa_to_text()
799 int (*key2text)(BIO *out, const void *key, in key2text_encode() argument
803 BIO *out = ossl_bio_new_from_core_bio(vctx, cout); in key2text_encode() local
806 if (out == NULL) in key2text_encode()
809 ret = key2text(out, key, selection); in key2text_encode()
810 BIO_free(out); in key2text_encode()