diff options
author | jsing <> | 2017-01-12 16:01:47 +0000 |
---|---|---|
committer | jsing <> | 2017-01-12 16:01:47 +0000 |
commit | 88e8299b9cc256ecec6c31f20129ebfdccb6528e (patch) | |
tree | 078d39ffa4184f17917d487c67d37d59c54ad070 /src | |
parent | c165429c2dec44cd63ef44ce30351921212ed255 (diff) | |
download | openbsd-88e8299b9cc256ecec6c31f20129ebfdccb6528e.tar.gz openbsd-88e8299b9cc256ecec6c31f20129ebfdccb6528e.tar.bz2 openbsd-88e8299b9cc256ecec6c31f20129ebfdccb6528e.zip |
If tls_get_new_cb_bio() fails, an error will already be set.
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libtls/tls_bio_cb.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/lib/libtls/tls_bio_cb.c b/src/lib/libtls/tls_bio_cb.c index 813d98d990..f53039fa00 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.15 2017/01/12 15:58:56 jsing Exp $ */ | 1 | /* $OpenBSD: tls_bio_cb.c,v 1.16 2017/01/12 16:01:47 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2016 Tobias Pape <tobias@netshed.de> | 3 | * Copyright (c) 2016 Tobias Pape <tobias@netshed.de> |
4 | * | 4 | * |
@@ -180,7 +180,6 @@ tls_get_new_cb_bio(struct tls *ctx) | |||
180 | tls_set_errorx(ctx, "no callbacks registered"); | 180 | tls_set_errorx(ctx, "no callbacks registered"); |
181 | return (NULL); | 181 | return (NULL); |
182 | } | 182 | } |
183 | |||
184 | if ((bio = BIO_new(bio_s_cb())) == NULL) { | 183 | if ((bio = BIO_new(bio_s_cb())) == NULL) { |
185 | tls_set_errorx(ctx, "failed to create callback i/o"); | 184 | tls_set_errorx(ctx, "failed to create callback i/o"); |
186 | return (NULL); | 185 | return (NULL); |
@@ -205,10 +204,8 @@ tls_set_cbs(struct tls *ctx, tls_read_cb read_cb, tls_write_cb write_cb, | |||
205 | ctx->write_cb = write_cb; | 204 | ctx->write_cb = write_cb; |
206 | ctx->cb_arg = cb_arg; | 205 | ctx->cb_arg = cb_arg; |
207 | 206 | ||
208 | if ((bio = tls_get_new_cb_bio(ctx)) == NULL) { | 207 | if ((bio = tls_get_new_cb_bio(ctx)) == NULL) |
209 | tls_set_errorx(ctx, "failed to create callback i/o"); | ||
210 | goto err; | 208 | goto err; |
211 | } | ||
212 | 209 | ||
213 | SSL_set_bio(ctx->ssl_conn, bio, bio); | 210 | SSL_set_bio(ctx->ssl_conn, bio, bio); |
214 | 211 | ||