diff options
| -rw-r--r-- | src/lib/libressl/ressl.c | 16 | ||||
| -rw-r--r-- | src/lib/libressl/ressl.h | 3 |
2 files changed, 14 insertions, 5 deletions
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, ...) | |||
| 65 | } | 65 | } |
| 66 | 66 | ||
| 67 | struct ressl * | 67 | struct ressl * |
| 68 | ressl_new(struct ressl_config *config) | 68 | ressl_new(void) |
| 69 | { | 69 | { |
| 70 | struct ressl *ctx; | 70 | struct ressl *ctx; |
| 71 | 71 | ||
| 72 | if ((ctx = calloc(1, sizeof(*ctx))) == NULL) | 72 | if ((ctx = calloc(1, sizeof(*ctx))) == NULL) |
| 73 | return (NULL); | 73 | return (NULL); |
| 74 | 74 | ||
| 75 | ctx->config = &ressl_config_default; | ||
| 76 | |||
| 77 | ressl_reset(ctx); | ||
| 78 | |||
| 79 | return (ctx); | ||
| 80 | } | ||
| 81 | |||
| 82 | int | ||
| 83 | ressl_configure(struct ressl *ctx, struct ressl_config *config) | ||
| 84 | { | ||
| 75 | if (config == NULL) | 85 | if (config == NULL) |
| 76 | config = &ressl_config_default; | 86 | config = &ressl_config_default; |
| 77 | 87 | ||
| 78 | ctx->config = config; | 88 | ctx->config = config; |
| 79 | 89 | ||
| 80 | ressl_reset(ctx); | 90 | return (0); |
| 81 | |||
| 82 | return (ctx); | ||
| 83 | } | 91 | } |
| 84 | 92 | ||
| 85 | void | 93 | void |
diff --git a/src/lib/libressl/ressl.h b/src/lib/libressl/ressl.h index a1d220028f..766335aa0c 100644 --- a/src/lib/libressl/ressl.h +++ b/src/lib/libressl/ressl.h | |||
| @@ -36,7 +36,8 @@ void ressl_config_set_verify_depth(struct ressl_config *config, | |||
| 36 | void ressl_config_insecure_no_verify(struct ressl_config *config); | 36 | void ressl_config_insecure_no_verify(struct ressl_config *config); |
| 37 | void ressl_config_verify(struct ressl_config *config); | 37 | void ressl_config_verify(struct ressl_config *config); |
| 38 | 38 | ||
| 39 | struct ressl *ressl_new(struct ressl_config *config); | 39 | struct ressl *ressl_new(void); |
| 40 | int ressl_configure(struct ressl *ctx, struct ressl_config *config); | ||
| 40 | void ressl_reset(struct ressl *ctx); | 41 | void ressl_reset(struct ressl *ctx); |
| 41 | void ressl_free(struct ressl *ctx); | 42 | void ressl_free(struct ressl *ctx); |
| 42 | 43 | ||
