diff options
-rw-r--r-- | src/lib/libssl/tls13_internal.h | 4 | ||||
-rw-r--r-- | src/lib/libssl/tls13_record_layer.c | 16 |
2 files changed, 11 insertions, 9 deletions
diff --git a/src/lib/libssl/tls13_internal.h b/src/lib/libssl/tls13_internal.h index 71abb6c443..43b65d6162 100644 --- a/src/lib/libssl/tls13_internal.h +++ b/src/lib/libssl/tls13_internal.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tls13_internal.h,v 1.19 2019/02/14 17:55:32 jsing Exp $ */ | 1 | /* $OpenBSD: tls13_internal.h,v 1.20 2019/02/21 17:09:51 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2018 Bob Beck <beck@openbsd.org> | 3 | * Copyright (c) 2018 Bob Beck <beck@openbsd.org> |
4 | * Copyright (c) 2018 Theo Buehler <tb@openbsd.org> | 4 | * Copyright (c) 2018 Theo Buehler <tb@openbsd.org> |
@@ -36,7 +36,7 @@ __BEGIN_HIDDEN_DECLS | |||
36 | #define TLS13_IO_WANT_POLLIN -2 | 36 | #define TLS13_IO_WANT_POLLIN -2 |
37 | #define TLS13_IO_WANT_POLLOUT -3 | 37 | #define TLS13_IO_WANT_POLLOUT -3 |
38 | 38 | ||
39 | typedef int (*tls13_alert_cb)(uint8_t _alert_level, uint8_t _alert_desc, | 39 | typedef void (*tls13_alert_cb)(uint8_t _alert_level, uint8_t _alert_desc, |
40 | void *_cb_arg); | 40 | void *_cb_arg); |
41 | typedef int (*tls13_post_handshake_cb)(void *_cb_arg); | 41 | typedef int (*tls13_post_handshake_cb)(void *_cb_arg); |
42 | typedef ssize_t (*tls13_read_cb)(void *_buf, size_t _buflen, void *_cb_arg); | 42 | typedef ssize_t (*tls13_read_cb)(void *_buf, size_t _buflen, void *_cb_arg); |
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 | ||
208 | int | 210 | int |