diff options
author | 2019-02-23 15:02:34 +0000 | |
---|---|---|
committer | 2019-02-23 15:02:34 +0000 | |
commit | 6a2edcca3dc766f4d6c4ae19e1a1777ec8e4effe (patch) | |
tree | 9db29c76ad0781f8f9d2e43bda523671e1b35ca8 /lib/libssl/tls13_record_layer.c | |
parent | Set BIO retry on TLS13_IO_WANT_POLLIN/TLS13_IO_WANT_POLLOUT. (diff) | |
download | wireguard-openbsd-6a2edcca3dc766f4d6c4ae19e1a1777ec8e4effe.tar.xz wireguard-openbsd-6a2edcca3dc766f4d6c4ae19e1a1777ec8e4effe.zip |
Remove temporary gotos.
In the case of a dummy CCS or post-handshake handshake message, return
TLS13_WANT_POLLIN rather than using a goto internally. This allows the
caller to retry at an appropriate time and reduces the complexity within
the record layer.
ok beck@ tb@
Diffstat (limited to 'lib/libssl/tls13_record_layer.c')
-rw-r--r-- | lib/libssl/tls13_record_layer.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/libssl/tls13_record_layer.c b/lib/libssl/tls13_record_layer.c index 86062e387fb..07efcbc7021 100644 --- a/lib/libssl/tls13_record_layer.c +++ b/lib/libssl/tls13_record_layer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tls13_record_layer.c,v 1.5 2019/02/21 17:15:00 jsing Exp $ */ +/* $OpenBSD: tls13_record_layer.c,v 1.6 2019/02/23 15:02:34 jsing Exp $ */ /* * Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org> * @@ -581,8 +581,6 @@ tls13_record_layer_read_record(struct tls13_record_layer *rl) ssize_t ret; CBS cbs; - again: /* XXX */ - if (rl->rrec == NULL) { if ((rl->rrec = tls13_record_new()) == NULL) goto err; @@ -622,7 +620,7 @@ tls13_record_layer_read_record(struct tls13_record_layer *rl) } rl->change_cipher_spec_seen = 1; tls13_record_layer_rrec_free(rl); - goto again; /* XXX */ + return TLS13_IO_WANT_POLLIN; } /* @@ -677,8 +675,6 @@ tls13_record_layer_read(struct tls13_record_layer *rl, uint8_t content_type, /* XXX - loop here with record and byte limits. */ /* XXX - send alert... */ - again: /* XXX */ - /* If necessary, pull up the next record. */ if (CBS_len(&rl->rbuf_cbs) == 0) { if ((ret = tls13_record_layer_read_record(rl)) <= 0) @@ -697,7 +693,7 @@ tls13_record_layer_read(struct tls13_record_layer *rl, uint8_t content_type, if (rl->handshake_completed) { /* XXX - call callback, drop for now... */ tls13_record_layer_rbuf_free(rl); - goto again; + return TLS13_IO_WANT_POLLIN; } } |