diff options
author | jsing <> | 2021-05-02 17:28:33 +0000 |
---|---|---|
committer | jsing <> | 2021-05-02 17:28:33 +0000 |
commit | 9f7bc5899b5335b444e8b9f837aee040b51730e7 (patch) | |
tree | a46c434ea56449f62dc5b8cbd318cd3c0ff0e98c /src/lib | |
parent | 74ea211ec5e7b4700067e49d7703512760086ab8 (diff) | |
download | openbsd-9f7bc5899b5335b444e8b9f837aee040b51730e7.tar.gz openbsd-9f7bc5899b5335b444e8b9f837aee040b51730e7.tar.bz2 openbsd-9f7bc5899b5335b444e8b9f837aee040b51730e7.zip |
In the TLSv1.2 server, set up the key block after sending the CCS.
This avoids calling into the key block setup code multiple times and makes
the server code consistent with the client.
ok inoguchi@ tb@
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libssl/ssl_srvr.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/libssl/ssl_srvr.c b/src/lib/libssl/ssl_srvr.c index 2d1af2f86f..8e6a1859eb 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.106 2021/05/02 17:18:10 jsing Exp $ */ | 1 | /* $OpenBSD: ssl_srvr.c,v 1.107 2021/05/02 17:28:33 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 | * |
@@ -641,12 +641,6 @@ ssl3_accept(SSL *s) | |||
641 | 641 | ||
642 | case SSL3_ST_SW_CHANGE_A: | 642 | case SSL3_ST_SW_CHANGE_A: |
643 | case SSL3_ST_SW_CHANGE_B: | 643 | case SSL3_ST_SW_CHANGE_B: |
644 | s->session->cipher = S3I(s)->hs.cipher; | ||
645 | if (!tls1_setup_key_block(s)) { | ||
646 | ret = -1; | ||
647 | goto end; | ||
648 | } | ||
649 | |||
650 | ret = ssl3_send_change_cipher_spec(s, | 644 | ret = ssl3_send_change_cipher_spec(s, |
651 | SSL3_ST_SW_CHANGE_A, SSL3_ST_SW_CHANGE_B); | 645 | SSL3_ST_SW_CHANGE_A, SSL3_ST_SW_CHANGE_B); |
652 | if (ret <= 0) | 646 | if (ret <= 0) |
@@ -654,6 +648,12 @@ ssl3_accept(SSL *s) | |||
654 | S3I(s)->hs.state = SSL3_ST_SW_FINISHED_A; | 648 | S3I(s)->hs.state = SSL3_ST_SW_FINISHED_A; |
655 | s->internal->init_num = 0; | 649 | s->internal->init_num = 0; |
656 | 650 | ||
651 | s->session->cipher = S3I(s)->hs.cipher; | ||
652 | if (!tls1_setup_key_block(s)) { | ||
653 | ret = -1; | ||
654 | goto end; | ||
655 | } | ||
656 | |||
657 | if (!tls1_change_cipher_state(s, | 657 | if (!tls1_change_cipher_state(s, |
658 | SSL3_CHANGE_CIPHER_SERVER_WRITE)) { | 658 | SSL3_CHANGE_CIPHER_SERVER_WRITE)) { |
659 | ret = -1; | 659 | ret = -1; |