-/* $OpenBSD: tls13_internal.h,v 1.91 2021/09/04 16:26:12 jsing Exp $ */
+/* $OpenBSD: tls13_internal.h,v 1.92 2021/09/14 14:31:21 tb Exp $ */
/*
* Copyright (c) 2018 Bob Beck <beck@openbsd.org>
* Copyright (c) 2018 Theo Buehler <tb@openbsd.org>
#define TLS13_INFO_HANDSHAKE_COMPLETED SSL_CB_HANDSHAKE_DONE
#define TLS13_INFO_ACCEPT_LOOP SSL_CB_ACCEPT_LOOP
#define TLS13_INFO_CONNECT_LOOP SSL_CB_CONNECT_LOOP
+#define TLS13_INFO_ACCEPT_EXIT SSL_CB_ACCEPT_EXIT
+#define TLS13_INFO_CONNECT_EXIT SSL_CB_CONNECT_EXIT
typedef void (*tls13_alert_cb)(uint8_t _alert_desc, void *_cb_arg);
typedef ssize_t (*tls13_phh_recv_cb)(void *_cb_arg, CBS *_cbs);
-/* $OpenBSD: tls13_legacy.c,v 1.29 2021/09/04 16:26:12 jsing Exp $ */
+/* $OpenBSD: tls13_legacy.c,v 1.30 2021/09/14 14:31:21 tb Exp $ */
/*
* Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org>
*
if (ret == TLS13_IO_USE_LEGACY)
return ssl->method->ssl_accept(ssl);
- return tls13_legacy_return_code(ssl, ret);
+ ret = tls13_legacy_return_code(ssl, ret);
+
+ if (ctx->info_cb != NULL)
+ ctx->info_cb(ctx, TLS13_INFO_ACCEPT_EXIT, ret);
+
+ return ret;
}
int
if (ret == TLS13_IO_USE_LEGACY)
return ssl->method->ssl_connect(ssl);
- return tls13_legacy_return_code(ssl, ret);
+ ret = tls13_legacy_return_code(ssl, ret);
+
+ if (ctx->info_cb != NULL)
+ ctx->info_cb(ctx, TLS13_INFO_CONNECT_EXIT, ret);
+
+ return ret;
}
int