diff options
author | Rob Stradling <rob@comodo.com> | 2014-02-19 13:12:46 +0000 |
---|---|---|
committer | Rob Stradling <rob@comodo.com> | 2014-02-19 13:12:46 +0000 |
commit | b263f2124607c42a1013b6b342341196b2bdec8d (patch) | |
tree | bf2187bbb4537f3842bd40559edad07d269823aa /crypto/bio/b_dump.c | |
parent | dcfe8df148d225aa15fdd0eba486a028ad4b06dc (diff) |
Move the SCT List extension parser into libssl.
Add the extension parser in the s_client, ocsp and x509 apps.
Diffstat (limited to 'crypto/bio/b_dump.c')
-rw-r--r-- | crypto/bio/b_dump.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/crypto/bio/b_dump.c b/crypto/bio/b_dump.c index c80ecc4295..b3a5f7d031 100644 --- a/crypto/bio/b_dump.c +++ b/crypto/bio/b_dump.c @@ -185,3 +185,25 @@ int BIO_dump_indent(BIO *bp, const char *s, int len, int indent) return BIO_dump_indent_cb(write_bio, bp, s, len, indent); } +int BIO_hex_string(BIO *out, int indent, int width, unsigned char *data, + int datalen) + { + int i, j = 0; + + if (datalen < 1) + return 1; + + for (i = 0; i < datalen - 1; i++) + { + if (i && !j) BIO_printf(out, "%*s", indent, ""); + + BIO_printf(out, "%02X:", data[i]); + + j = (j + 1) % width; + if (!j) BIO_printf(out, "\n"); + } + + if (i && !j) BIO_printf(out, "%*s", indent, ""); + BIO_printf(out, "%02X", data[datalen - 1]); + return 1; + } |