diff options
author | jsing <> | 2014-08-04 16:07:25 +0000 |
---|---|---|
committer | jsing <> | 2014-08-04 16:07:25 +0000 |
commit | f98c1e26ee0861d9feef350c2d0c1147a9d20a2e (patch) | |
tree | 16b2ef8ad6e471cc5a8e96b5b93abbe52f846eb0 /src/lib | |
parent | 78f1b94786e7a88c2465b014db9000aae8825054 (diff) | |
download | openbsd-f98c1e26ee0861d9feef350c2d0c1147a9d20a2e.tar.gz openbsd-f98c1e26ee0861d9feef350c2d0c1147a9d20a2e.tar.bz2 openbsd-f98c1e26ee0861d9feef350c2d0c1147a9d20a2e.zip |
Provide a function that returns a server connection context.
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libressl/ressl_internal.h | 2 | ||||
-rw-r--r-- | src/lib/libressl/ressl_server.c | 13 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/libressl/ressl_internal.h b/src/lib/libressl/ressl_internal.h index 0b6a58bf2d..75ca11dd02 100644 --- a/src/lib/libressl/ressl_internal.h +++ b/src/lib/libressl/ressl_internal.h | |||
@@ -36,6 +36,7 @@ struct ressl_config { | |||
36 | 36 | ||
37 | #define RESSL_CLIENT (1 << 0) | 37 | #define RESSL_CLIENT (1 << 0) |
38 | #define RESSL_SERVER (1 << 1) | 38 | #define RESSL_SERVER (1 << 1) |
39 | #define RESSL_SERVER_CONN (1 << 2) | ||
39 | 40 | ||
40 | struct ressl { | 41 | struct ressl { |
41 | struct ressl_config *config; | 42 | struct ressl_config *config; |
@@ -51,6 +52,7 @@ struct ressl { | |||
51 | }; | 52 | }; |
52 | 53 | ||
53 | struct ressl *ressl_new(void); | 54 | struct ressl *ressl_new(void); |
55 | struct ressl *ressl_server_conn(struct ressl *ctx); | ||
54 | 56 | ||
55 | int ressl_check_hostname(X509 *cert, const char *host); | 57 | int ressl_check_hostname(X509 *cert, const char *host); |
56 | int ressl_configure_keypair(struct ressl *ctx); | 58 | int ressl_configure_keypair(struct ressl *ctx); |
diff --git a/src/lib/libressl/ressl_server.c b/src/lib/libressl/ressl_server.c index 243b4bfb09..4aadda2f6b 100644 --- a/src/lib/libressl/ressl_server.c +++ b/src/lib/libressl/ressl_server.c | |||
@@ -29,6 +29,19 @@ ressl_server(void) | |||
29 | return (ctx); | 29 | return (ctx); |
30 | } | 30 | } |
31 | 31 | ||
32 | struct ressl * | ||
33 | ressl_server_conn(struct ressl *ctx) | ||
34 | { | ||
35 | struct ressl *conn_ctx; | ||
36 | |||
37 | if ((conn_ctx = ressl_new()) == NULL) | ||
38 | return (NULL); | ||
39 | |||
40 | conn_ctx->flags |= RESSL_SERVER_CONN; | ||
41 | |||
42 | return (conn_ctx); | ||
43 | } | ||
44 | |||
32 | int | 45 | int |
33 | ressl_listen(struct ressl *ctx, const char *host, const char *port, int af) | 46 | ressl_listen(struct ressl *ctx, const char *host, const char *port, int af) |
34 | { | 47 | { |