Skip to content

Commit 5c51893

Browse files
author
ehuman
committed
Moved setting encryption flags to after handshake completion
git-svn-id: svn://svn.code.sf.net/p/axtls/code/trunk@230 9a5d90b5-6617-0410-8a86-bb477d3ed2e3
1 parent f74c9ca commit 5c51893

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

ssl/tls1.c

+5-4
Original file line numberDiff line numberDiff line change
@@ -1334,14 +1334,14 @@ int basic_read(SSL *ssl, uint8_t **in_data)
13341334
goto error;
13351335
}
13361336

1337-
/* all encrypted from now on */
1338-
SET_SSL_FLAG(SSL_RX_ENCRYPTED);
13391337
if (set_key_block(ssl, 0) < 0)
13401338
{
13411339
ret = SSL_ERROR_INVALID_HANDSHAKE;
13421340
goto error;
13431341
}
13441342

1343+
/* all encrypted from now on */
1344+
SET_SSL_FLAG(SSL_RX_ENCRYPTED);
13451345
memset(ssl->read_sequence, 0, 8);
13461346
break;
13471347

@@ -1441,11 +1441,12 @@ int send_change_cipher_spec(SSL *ssl)
14411441
{
14421442
int ret = send_packet(ssl, PT_CHANGE_CIPHER_SPEC,
14431443
g_chg_cipher_spec_pkt, sizeof(g_chg_cipher_spec_pkt));
1444-
SET_SSL_FLAG(SSL_TX_ENCRYPTED);
14451444

14461445
if (ret >= 0 && set_key_block(ssl, 1) < 0)
14471446
ret = SSL_ERROR_INVALID_HANDSHAKE;
1448-
1447+
1448+
if (ssl->cipher_info)
1449+
SET_SSL_FLAG(SSL_TX_ENCRYPTED);
14491450
memset(ssl->write_sequence, 0, 8);
14501451
return ret;
14511452
}

0 commit comments

Comments
 (0)