Add support for printing out and retrieving EC point formats extension.
This commit is contained in:
@@ -161,6 +161,7 @@ int set_cert_key_and_authz(SSL_CTX *ctx, X509 *cert, EVP_PKEY *key,
|
||||
unsigned char *authz, size_t authz_length);
|
||||
# endif
|
||||
int ssl_print_sigalgs(BIO *out, SSL *s);
|
||||
int ssl_print_point_formats(BIO *out, SSL *s);
|
||||
int ssl_print_curves(BIO *out, SSL *s, int noshared);
|
||||
#endif
|
||||
int ssl_print_tmp_key(BIO *out, SSL *s);
|
||||
|
||||
41
apps/s_cb.c
41
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);
|
||||
}
|
||||
|
||||
@@ -2558,6 +2558,7 @@ static int init_ssl_connection(SSL *con)
|
||||
BIO_printf(bio_s_out,"Shared ciphers:%s\n",buf);
|
||||
str=SSL_CIPHER_get_name(SSL_get_current_cipher(con));
|
||||
ssl_print_sigalgs(bio_s_out, con);
|
||||
ssl_print_point_formats(bio_s_out, con);
|
||||
ssl_print_curves(bio_s_out, con, 0);
|
||||
BIO_printf(bio_s_out,"CIPHER is %s\n",(str != NULL)?str:"(NONE)");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user