diff options
author | tb <> | 2021-09-14 14:31:21 +0000 |
---|---|---|
committer | tb <> | 2021-09-14 14:31:21 +0000 |
commit | ac5a0d433026e460d43c793dbc5fe91945375ec3 (patch) | |
tree | 15822237b4621e3b97d198129a25420867b43636 | |
parent | 721f84f987db2650c18bfa5c6bfe892cc9cfb1eb (diff) | |
download | openbsd-ac5a0d433026e460d43c793dbc5fe91945375ec3.tar.gz openbsd-ac5a0d433026e460d43c793dbc5fe91945375ec3.tar.bz2 openbsd-ac5a0d433026e460d43c793dbc5fe91945375ec3.zip |
Call the info cb on connect/accept exit in TLSv1.3
The p5-Net-SSLeay test expects the info callback to be called on
connect exit. This is the behavior in the legacy stack but wasn't
implemented in the TLSv1.3 stack. With this commit, p5-Net-SSLeay
tests are happy again after the bump.
ok bluhm inoguchi jsing
-rw-r--r-- | src/lib/libssl/tls13_internal.h | 4 | ||||
-rw-r--r-- | src/lib/libssl/tls13_legacy.c | 16 |
2 files changed, 16 insertions, 4 deletions
diff --git a/src/lib/libssl/tls13_internal.h b/src/lib/libssl/tls13_internal.h index 12ed733f2b..2e78e37226 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.91 2021/09/04 16:26:12 jsing Exp $ */ | 1 | /* $OpenBSD: tls13_internal.h,v 1.92 2021/09/14 14:31:21 tb 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> |
@@ -83,6 +83,8 @@ __BEGIN_HIDDEN_DECLS | |||
83 | #define TLS13_INFO_HANDSHAKE_COMPLETED SSL_CB_HANDSHAKE_DONE | 83 | #define TLS13_INFO_HANDSHAKE_COMPLETED SSL_CB_HANDSHAKE_DONE |
84 | #define TLS13_INFO_ACCEPT_LOOP SSL_CB_ACCEPT_LOOP | 84 | #define TLS13_INFO_ACCEPT_LOOP SSL_CB_ACCEPT_LOOP |
85 | #define TLS13_INFO_CONNECT_LOOP SSL_CB_CONNECT_LOOP | 85 | #define TLS13_INFO_CONNECT_LOOP SSL_CB_CONNECT_LOOP |
86 | #define TLS13_INFO_ACCEPT_EXIT SSL_CB_ACCEPT_EXIT | ||
87 | #define TLS13_INFO_CONNECT_EXIT SSL_CB_CONNECT_EXIT | ||
86 | 88 | ||
87 | typedef void (*tls13_alert_cb)(uint8_t _alert_desc, void *_cb_arg); | 89 | typedef void (*tls13_alert_cb)(uint8_t _alert_desc, void *_cb_arg); |
88 | typedef ssize_t (*tls13_phh_recv_cb)(void *_cb_arg, CBS *_cbs); | 90 | typedef ssize_t (*tls13_phh_recv_cb)(void *_cb_arg, CBS *_cbs); |
diff --git a/src/lib/libssl/tls13_legacy.c b/src/lib/libssl/tls13_legacy.c index df4408d903..3368600c60 100644 --- a/src/lib/libssl/tls13_legacy.c +++ b/src/lib/libssl/tls13_legacy.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tls13_legacy.c,v 1.29 2021/09/04 16:26:12 jsing Exp $ */ | 1 | /* $OpenBSD: tls13_legacy.c,v 1.30 2021/09/14 14:31:21 tb 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 | * |
@@ -407,7 +407,12 @@ tls13_legacy_accept(SSL *ssl) | |||
407 | if (ret == TLS13_IO_USE_LEGACY) | 407 | if (ret == TLS13_IO_USE_LEGACY) |
408 | return ssl->method->ssl_accept(ssl); | 408 | return ssl->method->ssl_accept(ssl); |
409 | 409 | ||
410 | return tls13_legacy_return_code(ssl, ret); | 410 | ret = tls13_legacy_return_code(ssl, ret); |
411 | |||
412 | if (ctx->info_cb != NULL) | ||
413 | ctx->info_cb(ctx, TLS13_INFO_ACCEPT_EXIT, ret); | ||
414 | |||
415 | return ret; | ||
411 | } | 416 | } |
412 | 417 | ||
413 | int | 418 | int |
@@ -446,7 +451,12 @@ tls13_legacy_connect(SSL *ssl) | |||
446 | if (ret == TLS13_IO_USE_LEGACY) | 451 | if (ret == TLS13_IO_USE_LEGACY) |
447 | return ssl->method->ssl_connect(ssl); | 452 | return ssl->method->ssl_connect(ssl); |
448 | 453 | ||
449 | return tls13_legacy_return_code(ssl, ret); | 454 | ret = tls13_legacy_return_code(ssl, ret); |
455 | |||
456 | if (ctx->info_cb != NULL) | ||
457 | ctx->info_cb(ctx, TLS13_INFO_CONNECT_EXIT, ret); | ||
458 | |||
459 | return ret; | ||
450 | } | 460 | } |
451 | 461 | ||
452 | int | 462 | int |