5
/* write DSN structure to stream
7
/* #include <tls_proxy.h>
9
/* int tls_proxy_context_print(print_fn, stream, flags, ptr)
10
/* ATTR_PRINT_MASTER_FN print_fn;
15
/* tls_proxy_context_print() writes a TLS_SESS_STATE structure
16
/* to the named stream using the specified attribute print
17
/* routine. TLS_SESS_STATE() is meant to be passed as a call-back
18
/* to attr_print(), thusly:
20
/* ... ATTR_TYPE_FUNC, tls_proxy_context_print, (void *) tls_context, ...
22
/* Fatal: out of memory.
26
/* The Secure Mailer license must be distributed with this software.
29
/* IBM T.J. Watson Research
31
/* Yorktown Heights, NY 10598, USA
46
#include <mail_proto.h>
51
#include <tls_proxy.h>
53
/* tls_proxy_context_print - send TLS session state over stream */
55
int tls_proxy_context_print(ATTR_PRINT_MASTER_FN print_fn, VSTREAM *fp,
58
TLS_SESS_STATE *tp = (TLS_SESS_STATE *) ptr;
61
#define STRING_OR_EMPTY(s) ((s) ? (s) : "")
63
ret = print_fn(fp, flags | ATTR_FLAG_MORE,
64
ATTR_TYPE_STR, MAIL_ATTR_PEER_CN,
65
STRING_OR_EMPTY(tp->peer_CN),
66
ATTR_TYPE_STR, MAIL_ATTR_ISSUER_CN,
67
STRING_OR_EMPTY(tp->issuer_CN),
68
ATTR_TYPE_STR, MAIL_ATTR_PEER_FPT,
69
STRING_OR_EMPTY(tp->peer_fingerprint),
70
ATTR_TYPE_INT, MAIL_ATTR_PEER_STATUS,
72
ATTR_TYPE_STR, MAIL_ATTR_CIPHER_PROTOCOL,
73
STRING_OR_EMPTY(tp->protocol),
74
ATTR_TYPE_STR, MAIL_ATTR_CIPHER_NAME,
75
STRING_OR_EMPTY(tp->cipher_name),
76
ATTR_TYPE_INT, MAIL_ATTR_CIPHER_USEBITS,
78
ATTR_TYPE_INT, MAIL_ATTR_CIPHER_ALGBITS,