iostream-openssl.h revision 9f7ba3807f77209a65e0faa56cac8545b06cd116
#ifndef IOSTREAM_OPENSSL_H
#define IOSTREAM_OPENSSL_H
#include "iostream-ssl-private.h"
#ifndef HAVE_ASN1_STRING_GET0_DATA
#endif
struct ssl_iostream_context {
const struct ssl_iostream_settings *set;
int username_nid;
bool client_ctx:1;
};
struct ssl_iostream {
int refcount;
struct ssl_iostream_context *ctx;
struct istream *plain_input;
struct ostream *plain_output;
struct ostream *ssl_output;
char *host;
char *last_error;
char *log_prefix;
char *plain_stream_errstr;
int plain_stream_errno;
/* copied settings */
int username_nid;
void *handshake_context;
bool handshaked:1;
bool handshake_failed:1;
bool cert_received:1;
bool cert_broken:1;
bool want_read:1;
bool input_handler:1;
bool ostream_flush_waiting_input:1;
bool closed:1;
};
extern int dovecot_ssl_extdata_index;
struct ssl_iostream_context **ctx_r,
const char **error_r);
struct ssl_iostream_context **ctx_r,
const char **error_r);
void openssl_iostream_global_deinit(void);
int openssl_get_protocol_options(const char *protocols);
#define OPENSSL_ALL_PROTOCOL_OPTIONS \
/* Sync plain_input/plain_output streams with BIOs. Returns TRUE if at least
/* Call when there's more data available in plain_input/plain_output.
(still handshaking), -1 if error occurred. */
0 if the operation should retried later once more data has been
const char *func_name);
const char *func_name);
const char *openssl_iostream_error(void);
const char *openssl_iostream_key_load_error(void);
const char *
void openssl_iostream_clear_errors(void);
void ssl_iostream_openssl_init(void);
void ssl_iostream_openssl_deinit(void);
#endif