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_internal.h | |
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_internal.h')
-rw-r--r-- | src/lib/libtls/tls_internal.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/libtls/tls_internal.h b/src/lib/libtls/tls_internal.h index ba37e136e6..cf4a8e28ad 100644 --- a/src/lib/libtls/tls_internal.h +++ b/src/lib/libtls/tls_internal.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tls_internal.h,v 1.12 2015/03/31 12:21:27 jsing Exp $ */ | 1 | /* $OpenBSD: tls_internal.h,v 1.13 2015/08/27 14:34:46 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2014 Jeremie Courreges-Anglas <jca@openbsd.org> | 3 | * Copyright (c) 2014 Jeremie Courreges-Anglas <jca@openbsd.org> |
4 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> | 4 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> |
@@ -51,11 +51,13 @@ struct tls_config { | |||
51 | #define TLS_CLIENT (1 << 0) | 51 | #define TLS_CLIENT (1 << 0) |
52 | #define TLS_SERVER (1 << 1) | 52 | #define TLS_SERVER (1 << 1) |
53 | #define TLS_SERVER_CONN (1 << 2) | 53 | #define TLS_SERVER_CONN (1 << 2) |
54 | #define TLS_CONNECTING (1 << 3) | 54 | |
55 | #define TLS_STATE_CONNECTING (1 << 0) | ||
55 | 56 | ||
56 | struct tls { | 57 | struct tls { |
57 | struct tls_config *config; | 58 | struct tls_config *config; |
58 | uint64_t flags; | 59 | uint32_t flags; |
60 | uint32_t state; | ||
59 | 61 | ||
60 | int err; | 62 | int err; |
61 | char *errmsg; | 63 | char *errmsg; |