diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2012-11-22 15:20:53 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2012-11-22 15:20:53 +0000 |
commit | 20b431e3a94e57b916d7e1325217c3a2a6a186a0 (patch) | |
tree | a123d8a3ec30025a4b97edabdb86eb065fbcc59e /apps/s_cb.c | |
parent | e83aefb3a0c645c77849f889bc166935b2cc935c (diff) | |
download | openssl-20b431e3a94e57b916d7e1325217c3a2a6a186a0.tar.gz |
Add support for printing out and retrieving EC point formats extension.
Diffstat (limited to 'apps/s_cb.c')
-rw-r--r-- | apps/s_cb.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/apps/s_cb.c b/apps/s_cb.c index 11b6ea5d99..c83687fb0b 100644 --- a/apps/s_cb.c +++ b/apps/s_cb.c @@ -424,6 +424,44 @@ int ssl_print_sigalgs(BIO *out, SSL *s) return 1; } +int ssl_print_point_formats(BIO *out, SSL *s) + { + int i, nformats; + const char *pformats; + nformats = SSL_get0_ec_point_formats(s, &pformats); + if (nformats <= 0) + return 1; + BIO_puts(out, "Supported Elliptic Curve Point Formats: "); + for (i = 0; i < nformats; i++, pformats++) + { + if (i) + BIO_puts(out, ":"); + switch(*pformats) + { + case TLSEXT_ECPOINTFORMAT_uncompressed: + BIO_puts(out, "uncompressed"); + break; + + case TLSEXT_ECPOINTFORMAT_ansiX962_compressed_prime: + BIO_puts(out, "ansiX962_compressed_prime"); + break; + + case TLSEXT_ECPOINTFORMAT_ansiX962_compressed_char2: + BIO_puts(out, "ansiX962_compressed_char2"); + break; + + default: + BIO_printf(out, "unknown(%d)", (int)*pformats); + break; + + } + } + if (nformats <= 0) + BIO_puts(out, "NONE"); + BIO_puts(out, "\n"); + return 1; + } + int ssl_print_curves(BIO *out, SSL *s, int noshared) { int i, ncurves, *curves, nid; @@ -1528,7 +1566,10 @@ void print_ssl_summary(BIO *bio, SSL *s) if (peer) X509_free(peer); if (SSL_is_server(s)) + { + ssl_print_point_formats(bio, s); ssl_print_curves(bio, s, 1); + } else ssl_print_tmp_key(bio, s); } |