diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2016-11-24 14:54:46 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2016-11-25 10:37:07 +0100 |
commit | b05f7a0e30cf71f13efce8b57675bfbc4daec448 (patch) | |
tree | a8d0eadcc4a98a69c5f115c0d0622f642209f02e /lib/errors.h | |
parent | 5ed5b2e5685fb06b6e73f3c468962ea7758029b0 (diff) | |
download | gnutls-b05f7a0e30cf71f13efce8b57675bfbc4daec448.tar.gz |
errors.h: added _gnutls_reason_log
Diffstat (limited to 'lib/errors.h')
-rw-r--r-- | lib/errors.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/errors.h b/lib/errors.h index 78b89123e4..7412a291f5 100644 --- a/lib/errors.h +++ b/lib/errors.h @@ -71,6 +71,18 @@ void _gnutls_mpi_log(const char *prefix, bigint_t a); } \ } while(0) +#define _gnutls_reason_log(str, status) \ + do { \ + if (unlikely(_gnutls_log_level >= 3)) { \ + gnutls_datum_t _cl_out; int _cl_ret; \ + _cl_ret = gnutls_certificate_verification_status_print(status, GNUTLS_CRT_X509, &_cl_out, 0); \ + if (_cl_ret >= 0) { \ + _gnutls_log( 3, "%s: %s\n", str, _cl_out.data); \ + gnutls_free(_cl_out.data); \ + } \ + } \ + } while(0) + #ifdef C99_MACROS #define LEVEL(l, ...) do { if (unlikely(_gnutls_log_level >= l)) \ _gnutls_log( l, __VA_ARGS__); } while(0) |