diff options
author | jsing <> | 2015-08-27 14:34:46 +0000 |
---|---|---|
committer | jsing <> | 2015-08-27 14:34:46 +0000 |
commit | 9385a1fd21f3850678c58b5cc8702c3a54b91ead (patch) | |
tree | c284333fe8898b330adf198552e397d905674dfe /src/lib/libtls/tls.c | |
parent | 105f7d024b2a7f7397069b4f94f8319797f0b252 (diff) | |
download | openbsd-9385a1fd21f3850678c58b5cc8702c3a54b91ead.tar.gz openbsd-9385a1fd21f3850678c58b5cc8702c3a54b91ead.tar.bz2 openbsd-9385a1fd21f3850678c58b5cc8702c3a54b91ead.zip |
Split the persistent/configuration flags from temporary state flags and
ensure that the temporary state flags get cleared in tls_reset(). Fixes a
bug spotted by Marko Kreen whereby TLS_CONNECTING could remain on reset.
While here, also move the TLS_STATE_CONNECTING check to after the
TLS_CLIENT check - if TLS_STATE_CONNECTING was ever set on any other
context type it would allow a bypass.
ok bluhm@
Diffstat (limited to 'src/lib/libtls/tls.c')
-rw-r--r-- | src/lib/libtls/tls.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/libtls/tls.c b/src/lib/libtls/tls.c index 4536bae183..c79191ee15 100644 --- a/src/lib/libtls/tls.c +++ b/src/lib/libtls/tls.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tls.c,v 1.13 2015/08/22 14:20:53 jsing Exp $ */ | 1 | /* $OpenBSD: tls.c,v 1.14 2015/08/27 14:34:46 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -233,6 +233,7 @@ tls_reset(struct tls *ctx) | |||
233 | ctx->ssl_ctx = NULL; | 233 | ctx->ssl_ctx = NULL; |
234 | 234 | ||
235 | ctx->socket = -1; | 235 | ctx->socket = -1; |
236 | ctx->state = 0; | ||
236 | 237 | ||
237 | ctx->err = 0; | 238 | ctx->err = 0; |
238 | free(ctx->errmsg); | 239 | free(ctx->errmsg); |