From 52d7e6dec2e1e75fcac1a3f02ca708176e0c1ee9 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Sun, 13 Jul 2014 23:06:18 +0000 Subject: Split the context allocation out from the configuration. This will allow us to properly report errors that occur during configuration processing. Discussed with tedu@ --- src/lib/libressl/ressl.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/lib/libressl/ressl.c') diff --git a/src/lib/libressl/ressl.c b/src/lib/libressl/ressl.c index dc82f321b1..08ec061bf5 100644 --- a/src/lib/libressl/ressl.c +++ b/src/lib/libressl/ressl.c @@ -65,21 +65,29 @@ ressl_set_error(struct ressl *ctx, char *fmt, ...) } struct ressl * -ressl_new(struct ressl_config *config) +ressl_new(void) { struct ressl *ctx; if ((ctx = calloc(1, sizeof(*ctx))) == NULL) return (NULL); + ctx->config = &ressl_config_default; + + ressl_reset(ctx); + + return (ctx); +} + +int +ressl_configure(struct ressl *ctx, struct ressl_config *config) +{ if (config == NULL) config = &ressl_config_default; ctx->config = config; - ressl_reset(ctx); - - return (ctx); + return (0); } void -- cgit v1.2.3-55-g6feb