summaryrefslogtreecommitdiff
path: root/src/lib/libtls/tls_bio_cb.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/libtls/tls_bio_cb.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/libtls/tls_bio_cb.c b/src/lib/libtls/tls_bio_cb.c
index 8a1edfd5e4..56b9e12a71 100644
--- a/src/lib/libtls/tls_bio_cb.c
+++ b/src/lib/libtls/tls_bio_cb.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tls_bio_cb.c,v 1.21 2023/05/14 07:26:25 op Exp $ */ 1/* $OpenBSD: tls_bio_cb.c,v 1.22 2024/03/26 06:24:52 joshua Exp $ */
2/* 2/*
3 * Copyright (c) 2016 Tobias Pape <tobias@netshed.de> 3 * Copyright (c) 2016 Tobias Pape <tobias@netshed.de>
4 * 4 *
@@ -143,7 +143,7 @@ tls_set_cbs(struct tls *ctx, tls_read_cb read_cb, tls_write_cb write_cb,
143 int rv = -1; 143 int rv = -1;
144 144
145 if (read_cb == NULL || write_cb == NULL) { 145 if (read_cb == NULL || write_cb == NULL) {
146 tls_set_errorx(ctx, "no callbacks provided"); 146 tls_set_errorx(ctx, TLS_ERROR_UNKNOWN, "no callbacks provided");
147 goto err; 147 goto err;
148 } 148 }
149 149
@@ -152,11 +152,13 @@ tls_set_cbs(struct tls *ctx, tls_read_cb read_cb, tls_write_cb write_cb,
152 ctx->cb_arg = cb_arg; 152 ctx->cb_arg = cb_arg;
153 153
154 if ((bio_cb = bio_s_cb()) == NULL) { 154 if ((bio_cb = bio_s_cb()) == NULL) {
155 tls_set_errorx(ctx, "failed to create callback method"); 155 tls_set_errorx(ctx, TLS_ERROR_UNKNOWN,
156 "failed to create callback method");
156 goto err; 157 goto err;
157 } 158 }
158 if ((bio = BIO_new(bio_cb)) == NULL) { 159 if ((bio = BIO_new(bio_cb)) == NULL) {
159 tls_set_errorx(ctx, "failed to create callback i/o"); 160 tls_set_errorx(ctx, TLS_ERROR_UNKNOWN,
161 "failed to create callback i/o");
160 goto err; 162 goto err;
161 } 163 }
162 BIO_set_data(bio, ctx); 164 BIO_set_data(bio, ctx);