Lines Matching refs:bp
67 static int bn_print(BIO *bp, const char *number, const BIGNUM *num,
73 if (!BIO_indent(bp, off, 128)) {
77 if (BIO_printf(bp, "%s 0\n", number) <= 0) {
85 if (BIO_printf(bp, "%s %s%lu (%s0x%lx)\n", number, neg,
92 if (BIO_printf(bp, "%s%s", number,
107 if (BIO_puts(bp, "\n") <= 0 ||
108 !BIO_indent(bp, off + 4, 128)) {
112 if (BIO_printf(bp, "%02x%s", buf[i], ((i + 1) == n) ? "" : ":") <= 0) {
116 if (BIO_write(bp, "\n", 1) <= 0) {
204 static int rsa_pub_print(BIO *bp, const EVP_PKEY *pkey, int indent,
206 return do_rsa_print(bp, pkey->pkey.rsa, indent, 0);
209 static int rsa_priv_print(BIO *bp, const EVP_PKEY *pkey, int indent,
211 return do_rsa_print(bp, pkey->pkey.rsa, indent, 1);
217 static int do_dsa_print(BIO *bp, const DSA *x, int off, int ptype) {
255 if (!BIO_indent(bp, off, 128) ||
256 BIO_printf(bp, "%s: (%d bit)\n", ktype, BN_num_bits(x->p)) <= 0) {
261 if (!bn_print(bp, "priv:", priv_key, m, off) ||
262 !bn_print(bp, "pub: ", pub_key, m, off) ||
263 !bn_print(bp, "P: ", x->p, m, off) ||
264 !bn_print(bp, "Q: ", x->q, m, off) ||
265 !bn_print(bp, "G: ", x->g, m, off)) {
275 static int dsa_param_print(BIO *bp, const EVP_PKEY *pkey, int indent,
277 return do_dsa_print(bp, pkey->pkey.dsa, indent, 0);
280 static int dsa_pub_print(BIO *bp, const EVP_PKEY *pkey, int indent,
282 return do_dsa_print(bp, pkey->pkey.dsa, indent, 1);
285 static int dsa_priv_print(BIO *bp, const EVP_PKEY *pkey, int indent,
287 return do_dsa_print(bp, pkey->pkey.dsa, indent, 2);
293 static int do_EC_KEY_print(BIO *bp, const EC_KEY *x, int off, int ktype) {
366 if (!BIO_indent(bp, off, 128)) {
371 BIO_printf(bp, "%s: (%d bit)\n", ecstr, BN_num_bits(order)) <= 0) {
376 !bn_print(bp, "priv:", priv_key, buffer, off)) {
380 BIO_hexdump(bp, pub_key_bytes, pub_key_bytes_len, off);
384 if (!ECPKParameters_print(bp, group, off))
399 static int eckey_param_print(BIO *bp, const EVP_PKEY *pkey, int indent,
401 return do_EC_KEY_print(bp, pkey->pkey.ec, indent, 0);
404 static int eckey_pub_print(BIO *bp, const EVP_PKEY *pkey, int indent,
406 return do_EC_KEY_print(bp, pkey->pkey.ec, indent, 1);
410 static int eckey_priv_print(BIO *bp, const EVP_PKEY *pkey, int indent,
412 return do_EC_KEY_print(bp, pkey->pkey.ec, indent, 2);