us to properly report errors that occur during configuration processing.
Discussed with tedu@
}
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
void ressl_config_insecure_no_verify(struct ressl_config *config);
void ressl_config_verify(struct ressl_config *config);
-struct ressl *ressl_new(struct ressl_config *config);
+struct ressl *ressl_new(void);
+int ressl_configure(struct ressl *ctx, struct ressl_config *config);
void ressl_reset(struct ressl *ctx);
void ressl_free(struct ressl *ctx);