diff options
author | jsing <> | 2021-05-02 17:46:58 +0000 |
---|---|---|
committer | jsing <> | 2021-05-02 17:46:58 +0000 |
commit | d1a380af7888ba8c1a576a485256b5ecd49b922a (patch) | |
tree | 50c9893a25ead9ba252f8ac28a27688e77d6f79d /src/lib/libssl/ssl_srvr.c | |
parent | 74e477d81efb107c03529d6d2a90b807d604de30 (diff) | |
download | openbsd-d1a380af7888ba8c1a576a485256b5ecd49b922a.tar.gz openbsd-d1a380af7888ba8c1a576a485256b5ecd49b922a.tar.bz2 openbsd-d1a380af7888ba8c1a576a485256b5ecd49b922a.zip |
Clean up tls1_change_cipher_state().
Replace flag gymnastics at call sites with separate read and write,
functions which call the common code. Condition on s->server instead of
using SSL_ST_ACCEPT, for consistency and more readable code.
ok inoguchi@ tb@
Diffstat (limited to 'src/lib/libssl/ssl_srvr.c')
-rw-r--r-- | src/lib/libssl/ssl_srvr.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/lib/libssl/ssl_srvr.c b/src/lib/libssl/ssl_srvr.c index 8e6a1859eb..f884ea316f 100644 --- a/src/lib/libssl/ssl_srvr.c +++ b/src/lib/libssl/ssl_srvr.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssl_srvr.c,v 1.107 2021/05/02 17:28:33 jsing Exp $ */ | 1 | /* $OpenBSD: ssl_srvr.c,v 1.108 2021/05/02 17:46:58 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -647,15 +647,13 @@ ssl3_accept(SSL *s) | |||
647 | goto end; | 647 | goto end; |
648 | S3I(s)->hs.state = SSL3_ST_SW_FINISHED_A; | 648 | S3I(s)->hs.state = SSL3_ST_SW_FINISHED_A; |
649 | s->internal->init_num = 0; | 649 | s->internal->init_num = 0; |
650 | |||
651 | s->session->cipher = S3I(s)->hs.cipher; | 650 | s->session->cipher = S3I(s)->hs.cipher; |
651 | |||
652 | if (!tls1_setup_key_block(s)) { | 652 | if (!tls1_setup_key_block(s)) { |
653 | ret = -1; | 653 | ret = -1; |
654 | goto end; | 654 | goto end; |
655 | } | 655 | } |
656 | 656 | if (!tls1_change_write_cipher_state(s)) { | |
657 | if (!tls1_change_cipher_state(s, | ||
658 | SSL3_CHANGE_CIPHER_SERVER_WRITE)) { | ||
659 | ret = -1; | 657 | ret = -1; |
660 | goto end; | 658 | goto end; |
661 | } | 659 | } |