summaryrefslogtreecommitdiff
path: root/src/lib/libssl/tls13_record_layer.c
diff options
context:
space:
mode:
authorjsing <>2019-02-21 17:09:51 +0000
committerjsing <>2019-02-21 17:09:51 +0000
commitc2747c010f47d9ef1447b26470fa7fb033c543c3 (patch)
tree37e9b40407a361bdc95cfaf9c0cabf83399eafa4 /src/lib/libssl/tls13_record_layer.c
parente76fac4c623c3bc630ce30d524b5f6a9fa699538 (diff)
downloadopenbsd-c2747c010f47d9ef1447b26470fa7fb033c543c3.tar.gz
openbsd-c2747c010f47d9ef1447b26470fa7fb033c543c3.tar.bz2
openbsd-c2747c010f47d9ef1447b26470fa7fb033c543c3.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 'src/lib/libssl/tls13_record_layer.c')
-rw-r--r--src/lib/libssl/tls13_record_layer.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/lib/libssl/tls13_record_layer.c b/src/lib/libssl/tls13_record_layer.c
index d1b53244c5..8f6eb94df4 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.3 2019/02/21 17:02:02 jsing Exp $ */ 1/* $OpenBSD: tls13_record_layer.c,v 1.4 2019/02/21 17:09:51 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 *
@@ -188,21 +188,23 @@ tls13_record_layer_process_alert(struct tls13_record_layer *rl)
188 * read channel closure (close_notify) or termination (all others). 188 * read channel closure (close_notify) or termination (all others).
189 */ 189 */
190 if (rl->rbuf == NULL) 190 if (rl->rbuf == NULL)
191 return -1; 191 return TLS13_IO_FAILURE;
192 if (rl->rbuf_content_type != SSL3_RT_ALERT) 192 if (rl->rbuf_content_type != SSL3_RT_ALERT)
193 return -1; 193 return TLS13_IO_FAILURE;
194 194
195 if (!CBS_get_u8(&rl->rbuf_cbs, &alert_level)) 195 if (!CBS_get_u8(&rl->rbuf_cbs, &alert_level))
196 return -1; /* XXX - decode error alert. */ 196 return TLS13_IO_FAILURE; /* XXX - decode error alert. */
197 if (!CBS_get_u8(&rl->rbuf_cbs, &alert_desc)) 197 if (!CBS_get_u8(&rl->rbuf_cbs, &alert_desc))
198 return -1; /* XXX - decode error alert. */ 198 return TLS13_IO_FAILURE; /* XXX - decode error alert. */
199 199
200 if (CBS_len(&rl->rbuf_cbs) != 0) 200 if (CBS_len(&rl->rbuf_cbs) != 0)
201 return -1; 201 return TLS13_IO_FAILURE;
202 202
203 tls13_record_layer_rbuf_free(rl); 203 tls13_record_layer_rbuf_free(rl);
204 204
205 return rl->alert_cb(alert_level, alert_desc, rl->cb_arg); 205 rl->alert_cb(alert_level, alert_desc, rl->cb_arg);
206
207 return TLS13_IO_SUCCESS;
206} 208}
207 209
208int 210int