From e7d3d1ae0d0293751d1e3b559e490baecc2b93f4 Mon Sep 17 00:00:00 2001 From: jsing Date: Mon, 4 Aug 2014 16:07:25 +0000 Subject: [PATCH] Provide a function that returns a server connection context. --- lib/libressl/ressl_internal.h | 2 ++ lib/libressl/ressl_server.c | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/lib/libressl/ressl_internal.h b/lib/libressl/ressl_internal.h index 0b6a58bf2d8..75ca11dd02b 100644 --- a/lib/libressl/ressl_internal.h +++ b/lib/libressl/ressl_internal.h @@ -36,6 +36,7 @@ struct ressl_config { #define RESSL_CLIENT (1 << 0) #define RESSL_SERVER (1 << 1) +#define RESSL_SERVER_CONN (1 << 2) struct ressl { struct ressl_config *config; @@ -51,6 +52,7 @@ struct ressl { }; struct ressl *ressl_new(void); +struct ressl *ressl_server_conn(struct ressl *ctx); int ressl_check_hostname(X509 *cert, const char *host); int ressl_configure_keypair(struct ressl *ctx); diff --git a/lib/libressl/ressl_server.c b/lib/libressl/ressl_server.c index 243b4bfb09a..4aadda2f6b0 100644 --- a/lib/libressl/ressl_server.c +++ b/lib/libressl/ressl_server.c @@ -29,6 +29,19 @@ ressl_server(void) return (ctx); } +struct ressl * +ressl_server_conn(struct ressl *ctx) +{ + struct ressl *conn_ctx; + + if ((conn_ctx = ressl_new()) == NULL) + return (NULL); + + conn_ctx->flags |= RESSL_SERVER_CONN; + + return (conn_ctx); +} + int ressl_listen(struct ressl *ctx, const char *host, const char *port, int af) { -- 2.20.1