summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjsing <>2019-02-23 15:02:34 +0000
committerjsing <>2019-02-23 15:02:34 +0000
commit08a481095f1d7b38cdc1ac76d421391090fbc3ee (patch)
tree9f4afd811b09d3c55fb7cb6a19632ed0a0988cb6 /src
parent6dc7e73103356c68fb1a0e418474365eed4d822c (diff)
downloadopenbsd-08a481095f1d7b38cdc1ac76d421391090fbc3ee.tar.gz
openbsd-08a481095f1d7b38cdc1ac76d421391090fbc3ee.tar.bz2
openbsd-08a481095f1d7b38cdc1ac76d421391090fbc3ee.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 'src')
-rw-r--r--src/lib/libssl/tls13_record_layer.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/lib/libssl/tls13_record_layer.c b/src/lib/libssl/tls13_record_layer.c
index 86062e387f..07efcbc702 100644
--- a/src/lib/libssl/tls13_record_layer.c
+++ b/src/lib/libssl/tls13_record_layer.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tls13_record_layer.c,v 1.5 2019/02/21 17:15:00 jsing Exp $ */ 1/* $OpenBSD: tls13_record_layer.c,v 1.6 2019/02/23 15:02:34 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -581,8 +581,6 @@ tls13_record_layer_read_record(struct tls13_record_layer *rl)
581 ssize_t ret; 581 ssize_t ret;
582 CBS cbs; 582 CBS cbs;
583 583
584 again: /* XXX */
585
586 if (rl->rrec == NULL) { 584 if (rl->rrec == NULL) {
587 if ((rl->rrec = tls13_record_new()) == NULL) 585 if ((rl->rrec = tls13_record_new()) == NULL)
588 goto err; 586 goto err;
@@ -622,7 +620,7 @@ tls13_record_layer_read_record(struct tls13_record_layer *rl)
622 } 620 }
623 rl->change_cipher_spec_seen = 1; 621 rl->change_cipher_spec_seen = 1;
624 tls13_record_layer_rrec_free(rl); 622 tls13_record_layer_rrec_free(rl);
625 goto again; /* XXX */ 623 return TLS13_IO_WANT_POLLIN;
626 } 624 }
627 625
628 /* 626 /*
@@ -677,8 +675,6 @@ tls13_record_layer_read(struct tls13_record_layer *rl, uint8_t content_type,
677 /* XXX - loop here with record and byte limits. */ 675 /* XXX - loop here with record and byte limits. */
678 /* XXX - send alert... */ 676 /* XXX - send alert... */
679 677
680 again: /* XXX */
681
682 /* If necessary, pull up the next record. */ 678 /* If necessary, pull up the next record. */
683 if (CBS_len(&rl->rbuf_cbs) == 0) { 679 if (CBS_len(&rl->rbuf_cbs) == 0) {
684 if ((ret = tls13_record_layer_read_record(rl)) <= 0) 680 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,
697 if (rl->handshake_completed) { 693 if (rl->handshake_completed) {
698 /* XXX - call callback, drop for now... */ 694 /* XXX - call callback, drop for now... */
699 tls13_record_layer_rbuf_free(rl); 695 tls13_record_layer_rbuf_free(rl);
700 goto again; 696 return TLS13_IO_WANT_POLLIN;
701 } 697 }
702 } 698 }
703 699