int
ressl_set_error(struct ressl *ctx, char *fmt, ...)
{
- va_list ap;
- int rv;
+ va_list ap;
+ int rv;
ctx->err = errno;
free(ctx->errmsg);
ctx->errmsg = NULL;
- va_start(ap, fmt);
- rv = vasprintf(&ctx->errmsg, fmt, ap);
- va_end(ap);
+ va_start(ap, fmt);
+ rv = vasprintf(&ctx->errmsg, fmt, ap);
+ va_end(ap);
return (rv);
}
* Default configuration.
*/
struct ressl_config ressl_config_default = {
- .ca_file = _PATH_SSL_CA_FILE,
- .ca_path = NULL,
- .ciphers = NULL,
- .verify = 1,
- .verify_depth = 6,
+ .ca_file = _PATH_SSL_CA_FILE,
+ .ca_path = NULL,
+ .ciphers = NULL,
+ .verify = 1,
+ .verify_depth = 6,
};
struct ressl_config *
#define _PATH_SSL_CA_FILE "/etc/ssl/cert.pem"
struct ressl_config {
- const char *ca_file;
- const char *ca_path;
- const char *ciphers;
- const char *server_name;
- int verify;
- int verify_depth;
+ const char *ca_file;
+ const char *ca_path;
+ const char *ciphers;
+ const char *server_name;
+ int verify;
+ int verify_depth;
};
#define RESSL_CLIENT (1 << 0)
#define RESSL_SERVER (1 << 1)
struct ressl {
- struct ressl_config *config;
+ struct ressl_config *config;
uint64_t flags;
- int err;
- char *errmsg;
+ int err;
+ char *errmsg;
- int socket;
+ int socket;
- SSL *ssl_conn;
- SSL_CTX *ssl_ctx;
+ SSL *ssl_conn;
+ SSL_CTX *ssl_ctx;
};
struct ressl *ressl_new(void);