Skip to content

Commit f74c9ca

Browse files
author
cameronrich
committed
Client version number comes from client hello and not the record layer. This was causing issues in Chrome
git-svn-id: svn://svn.code.sf.net/p/axtls/code/trunk@229 9a5d90b5-6617-0410-8a86-bb477d3ed2e3
1 parent df4606a commit f74c9ca

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

ssl/tls1.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ static void add_hmac_digest(SSL *ssl, int mode, uint8_t *hmac_header,
660660
ssl->cipher_info->digest_size, hmac_buf);
661661

662662
#if 0
663-
print_blob("record", ssl->hmac_tx, SSL_RECORD_SIZE);
663+
print_blob("record", hmac_header, SSL_RECORD_SIZE);
664664
print_blob("buf", buf, buf_len);
665665
if (mode == SSL_SERVER_WRITE || mode == SSL_CLIENT_WRITE)
666666
{
@@ -1071,7 +1071,6 @@ int send_packet(SSL *ssl, uint8_t protocol, const uint8_t *in, int length)
10711071
/* add the explicit IV for TLS1.1 */
10721072
if (ssl->version >= SSL_PROTOCOL_VERSION1_1 &&
10731073
ssl->cipher_info->iv_size)
1074-
10751074
{
10761075
uint8_t iv_size = ssl->cipher_info->iv_size;
10771076
uint8_t *t_buf = alloca(msg_length + iv_size);
@@ -1131,7 +1130,7 @@ static int set_key_block(SSL *ssl, int is_write)
11311130
ssl->dc->master_secret, ssl->dc->key_block,
11321131
ciph_info->key_block_size);
11331132
#if 0
1134-
print_blob("keyblock", ssl->key_block, ciph_info->key_block_size);
1133+
print_blob("keyblock", ssl->dc->key_block, ciph_info->key_block_size);
11351134
#endif
11361135
}
11371136

ssl/tls1_svr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ static int process_client_hello(SSL *ssl)
122122
int i, j, cs_len, id_len, offset = 6 + SSL_RANDOM_SIZE;
123123
int ret = SSL_OK;
124124

125-
uint8_t version = (record_buf[1] << 4) + record_buf[2];
125+
uint8_t version = (buf[4] << 4) + buf[5];
126126
ssl->version = ssl->client_version = version;
127127

128128
if (version > SSL_PROTOCOL_VERSION_MAX)

0 commit comments

Comments
 (0)