mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-21 10:26:06 +03:00
Fixed variable length macs used by gnutls.
git-svn-id: svn://svn.code.sf.net/p/axtls/code/trunk@205 9a5d90b5-6617-0410-8a86-bb477d3ed2e3
This commit is contained in:
parent
2ae9a3ec83
commit
8558c49351
@ -798,13 +798,13 @@ static void do_client(client_t *clnt)
|
|||||||
/* show the session ids in the reconnect test */
|
/* show the session ids in the reconnect test */
|
||||||
if (strcmp(clnt->testname, "Session Reuse") == 0)
|
if (strcmp(clnt->testname, "Session Reuse") == 0)
|
||||||
{
|
{
|
||||||
sprintf(openssl_buf, "echo \"hello client\" | openssl s_client "
|
sprintf(openssl_buf, "echo \"hello client\" | openssl s_client -tls1 "
|
||||||
"-connect localhost:%d %s 2>&1 | grep \"Session-ID:\"",
|
"-connect localhost:%d %s 2>&1 | grep \"Session-ID:\"",
|
||||||
g_port, clnt->openssl_option);
|
g_port, clnt->openssl_option);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf(openssl_buf, "echo \"hello client\" | openssl s_client "
|
sprintf(openssl_buf, "echo \"hello client\" | openssl s_client -tls1 "
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
"-connect localhost:%d -quiet %s",
|
"-connect localhost:%d -quiet %s",
|
||||||
#else
|
#else
|
||||||
|
@ -698,7 +698,7 @@ static int verify_digest(SSL *ssl, int mode, const uint8_t *buf, int read_len)
|
|||||||
hmac_offset = read_len-last_blk_size-ssl->cipher_info->digest_size-1;
|
hmac_offset = read_len-last_blk_size-ssl->cipher_info->digest_size-1;
|
||||||
|
|
||||||
/* guard against a timing attack - make sure we do the digest */
|
/* guard against a timing attack - make sure we do the digest */
|
||||||
if (hmac_offset < 0 || last_blk_size > ssl->cipher_info->padding_size)
|
if (hmac_offset < 0)
|
||||||
{
|
{
|
||||||
hmac_offset = 0;
|
hmac_offset = 0;
|
||||||
}
|
}
|
||||||
|
@ -124,9 +124,10 @@ static int process_client_hello(SSL *ssl)
|
|||||||
|
|
||||||
/* should be v3.1 (TLSv1) or better - we'll send in v3.1 mode anyway */
|
/* should be v3.1 (TLSv1) or better - we'll send in v3.1 mode anyway */
|
||||||
uint8_t version = (record_buf[1] << 4) + record_buf[2];
|
uint8_t version = (record_buf[1] << 4) + record_buf[2];
|
||||||
|
|
||||||
if (version > SSL_PROTOCOL_VERSION)
|
if (version > SSL_PROTOCOL_VERSION)
|
||||||
version = SSL_PROTOCOL_VERSION;
|
version = SSL_PROTOCOL_VERSION;
|
||||||
else if (ssl->version < SSL_PROTOCOL_MIN_VERSION)
|
else if (version < SSL_PROTOCOL_MIN_VERSION)
|
||||||
{
|
{
|
||||||
ret = SSL_ERROR_INVALID_VERSION;
|
ret = SSL_ERROR_INVALID_VERSION;
|
||||||
ssl_display_error(ret);
|
ssl_display_error(ret);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user