提交 0d4d5ab8 编写于 作者: R Rob Percival 提交者: Rich Salz

check reviewer --reviewer=emilia

Use SSL_get_SSL_CTX instead of passing SSL_CTX to s_client.c:print_stuff
Reviewed-by: NEmilia Käsper <emilia@openssl.org>
Reviewed-by: NRich Salz <rsalz@openssl.org>
上级 49e5db0b
...@@ -204,7 +204,7 @@ static int c_quiet = 0; ...@@ -204,7 +204,7 @@ static int c_quiet = 0;
static int c_ign_eof = 0; static int c_ign_eof = 0;
static int c_brief = 0; static int c_brief = 0;
static void print_stuff(BIO *berr, const SSL_CTX *ctx, SSL *con, int full); static void print_stuff(BIO *berr, SSL *con, int full);
static int ocsp_resp_cb(SSL *s, void *arg); static int ocsp_resp_cb(SSL *s, void *arg);
static int saved_errno; static int saved_errno;
...@@ -2184,7 +2184,7 @@ int s_client_main(int argc, char **argv) ...@@ -2184,7 +2184,7 @@ int s_client_main(int argc, char **argv)
print_ssl_summary(con); print_ssl_summary(con);
} }
print_stuff(bio_c_out, ctx, con, full_log); print_stuff(bio_c_out, con, full_log);
if (full_log > 0) if (full_log > 0)
full_log--; full_log--;
...@@ -2516,13 +2516,13 @@ int s_client_main(int argc, char **argv) ...@@ -2516,13 +2516,13 @@ int s_client_main(int argc, char **argv)
ret = 0; ret = 0;
shut: shut:
if (in_init) if (in_init)
print_stuff(bio_c_out, ctx, con, full_log); print_stuff(bio_c_out, con, full_log);
do_ssl_shutdown(con); do_ssl_shutdown(con);
BIO_closesocket(SSL_get_fd(con)); BIO_closesocket(SSL_get_fd(con));
end: end:
if (con != NULL) { if (con != NULL) {
if (prexit != 0) if (prexit != 0)
print_stuff(bio_c_out, ctx, con, 1); print_stuff(bio_c_out, con, 1);
SSL_free(con); SSL_free(con);
} }
#if !defined(OPENSSL_NO_NEXTPROTONEG) #if !defined(OPENSSL_NO_NEXTPROTONEG)
...@@ -2554,7 +2554,7 @@ int s_client_main(int argc, char **argv) ...@@ -2554,7 +2554,7 @@ int s_client_main(int argc, char **argv)
return (ret); return (ret);
} }
static void print_stuff(BIO *bio, const SSL_CTX *ctx, SSL *s, int full) static void print_stuff(BIO *bio, SSL *s, int full)
{ {
X509 *peer = NULL; X509 *peer = NULL;
char buf[BUFSIZ]; char buf[BUFSIZ];
...@@ -2570,6 +2570,7 @@ static void print_stuff(BIO *bio, const SSL_CTX *ctx, SSL *s, int full) ...@@ -2570,6 +2570,7 @@ static void print_stuff(BIO *bio, const SSL_CTX *ctx, SSL *s, int full)
#ifndef OPENSSL_NO_CT #ifndef OPENSSL_NO_CT
const STACK_OF(SCT) *scts; const STACK_OF(SCT) *scts;
#endif #endif
const SSL_CTX *ctx = SSL_get_SSL_CTX(s);
if (full) { if (full) {
int got_a_chain = 0; int got_a_chain = 0;
...@@ -2633,8 +2634,10 @@ static void print_stuff(BIO *bio, const SSL_CTX *ctx, SSL *s, int full) ...@@ -2633,8 +2634,10 @@ static void print_stuff(BIO *bio, const SSL_CTX *ctx, SSL *s, int full)
} }
if (scts != NULL && sk_SCT_num(scts) > 0) { if (scts != NULL && sk_SCT_num(scts) > 0) {
const CTLOG_STORE *log_store = SSL_CTX_get0_ctlog_store(ctx);
BIO_printf(bio, "---\n"); BIO_printf(bio, "---\n");
SCT_LIST_print(scts, bio, 0, "\n---\n", SSL_CTX_get0_ctlog_store(ctx)); SCT_LIST_print(scts, bio, 0, "\n---\n", log_store);
BIO_printf(bio, "\n"); BIO_printf(bio, "\n");
} }
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册