diff options
author | 2019-02-21 17:09:51 +0000 | |
---|---|---|
committer | 2019-02-21 17:09:51 +0000 | |
commit | 0ddb6aef89c5a441e0189bfaf3c6d2bee13dd417 (patch) | |
tree | 4fd18037c0d4f71fbfaf89848251615e71fb2103 /lib/libssl/tls13_record_layer.c | |
parent | Fix a few cases where int was used instead of ssize_t. (diff) | |
download | wireguard-openbsd-0ddb6aef89c5a441e0189bfaf3c6d2bee13dd417.tar.xz wireguard-openbsd-0ddb6aef89c5a441e0189bfaf3c6d2bee13dd417.zip |
Change the alert callback return type from int to void.
There is nothing for the handler to really signal, since it cannot change
the fact that we received an alert. While here use TLS13_IO_FAILURE instead
of hardcoding -1.
ok tb@
Diffstat (limited to 'lib/libssl/tls13_record_layer.c')
-rw-r--r-- | lib/libssl/tls13_record_layer.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/libssl/tls13_record_layer.c b/lib/libssl/tls13_record_layer.c index d1b53244c56..8f6eb94df4d 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.3 2019/02/21 17:02:02 jsing Exp $ */ +/* $OpenBSD: tls13_record_layer.c,v 1.4 2019/02/21 17:09:51 jsing Exp $ */ /* * Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org> * @@ -188,21 +188,23 @@ tls13_record_layer_process_alert(struct tls13_record_layer *rl) * read channel closure (close_notify) or termination (all others). */ if (rl->rbuf == NULL) - return -1; + return TLS13_IO_FAILURE; if (rl->rbuf_content_type != SSL3_RT_ALERT) - return -1; + return TLS13_IO_FAILURE; if (!CBS_get_u8(&rl->rbuf_cbs, &alert_level)) - return -1; /* XXX - decode error alert. */ + return TLS13_IO_FAILURE; /* XXX - decode error alert. */ if (!CBS_get_u8(&rl->rbuf_cbs, &alert_desc)) - return -1; /* XXX - decode error alert. */ + return TLS13_IO_FAILURE; /* XXX - decode error alert. */ if (CBS_len(&rl->rbuf_cbs) != 0) - return -1; + return TLS13_IO_FAILURE; tls13_record_layer_rbuf_free(rl); - return rl->alert_cb(alert_level, alert_desc, rl->cb_arg); + rl->alert_cb(alert_level, alert_desc, rl->cb_arg); + + return TLS13_IO_SUCCESS; } int |