diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2014-11-13 14:12:15 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2014-11-13 14:12:18 +0100 |
commit | d75304f487cb4faf9443fb074ca6771f3bf65c10 (patch) | |
tree | 6eb7ffe1f088428c114b4078d10f92902e14205b /src/cli.c | |
parent | 88289f4402d1f3b2063c007fb7029996bd97b987 (diff) | |
download | gnutls-d75304f487cb4faf9443fb074ca6771f3bf65c10.tar.gz |
gnutls-cli: added option to save the OCSP response
Diffstat (limited to 'src/cli.c')
-rw-r--r-- | src/cli.c | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -1040,6 +1040,24 @@ int do_inline_command_processing(char *buffer_ptr, size_t curr_bytes, } } +static void +print_other_info(gnutls_session_t session) +{ + int ret; + gnutls_datum_t data; + + if (HAVE_OPT(SAVE_OCSP)) { + FILE *fp = fopen(OPT_ARG(SAVE_OCSP), "w"); + + if (fp != NULL) { + ret = gnutls_ocsp_status_request_get(session, &data); + if (ret >= 0) + fwrite(data.data, 1, data.size, fp); + fclose(fp); + } + } +} + int main(int argc, char **argv) { int ret; @@ -1094,6 +1112,8 @@ int main(int argc, char **argv) if (try_resume(&hd)) return 1; + print_other_info(hd.session); + after_handshake: /* Warning! Do not touch this text string, it is used by external |