diff options
author | joshua <> | 2024-03-26 08:54:48 +0000 |
---|---|---|
committer | joshua <> | 2024-03-26 08:54:48 +0000 |
commit | fd23854bc7a3f24b804341870d0979d7a3643d3e (patch) | |
tree | 556c8b71628c259ac6c0e3e66c7165a9860ba4a7 /src/lib/libtls/tls_server.c | |
parent | b708bfbe4ecac1e6024ff2b0f7f7aeab1b8c0068 (diff) | |
download | openbsd-fd23854bc7a3f24b804341870d0979d7a3643d3e.tar.gz openbsd-fd23854bc7a3f24b804341870d0979d7a3643d3e.tar.bz2 openbsd-fd23854bc7a3f24b804341870d0979d7a3643d3e.zip |
Add TLS_ERROR_INVALID_CONTEXT error code to libtls
ok jsing@ beck@
Diffstat (limited to 'src/lib/libtls/tls_server.c')
-rw-r--r-- | src/lib/libtls/tls_server.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/libtls/tls_server.c b/src/lib/libtls/tls_server.c index a42985744b..a94b4221ed 100644 --- a/src/lib/libtls/tls_server.c +++ b/src/lib/libtls/tls_server.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tls_server.c,v 1.50 2024/03/26 06:24:52 joshua Exp $ */ | 1 | /* $OpenBSD: tls_server.c,v 1.51 2024/03/26 08:54:48 joshua Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -372,7 +372,8 @@ tls_accept_common(struct tls *ctx) | |||
372 | struct tls *conn_ctx = NULL; | 372 | struct tls *conn_ctx = NULL; |
373 | 373 | ||
374 | if ((ctx->flags & TLS_SERVER) == 0) { | 374 | if ((ctx->flags & TLS_SERVER) == 0) { |
375 | tls_set_errorx(ctx, TLS_ERROR_UNKNOWN, "not a server context"); | 375 | tls_set_errorx(ctx, TLS_ERROR_INVALID_CONTEXT, |
376 | "not a server context"); | ||
376 | goto err; | 377 | goto err; |
377 | } | 378 | } |
378 | 379 | ||
@@ -461,7 +462,7 @@ tls_handshake_server(struct tls *ctx) | |||
461 | int rv = -1; | 462 | int rv = -1; |
462 | 463 | ||
463 | if ((ctx->flags & TLS_SERVER_CONN) == 0) { | 464 | if ((ctx->flags & TLS_SERVER_CONN) == 0) { |
464 | tls_set_errorx(ctx, TLS_ERROR_UNKNOWN, | 465 | tls_set_errorx(ctx, TLS_ERROR_INVALID_CONTEXT, |
465 | "not a server connection context"); | 466 | "not a server connection context"); |
466 | goto err; | 467 | goto err; |
467 | } | 468 | } |