1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-08-12 20:49:16 +03:00

* RC4 only used if PKCS12 is used.

* Buffer sizes tightned up.
* Buffer check on client handshake due to some incompatibilities.

git-svn-id: svn://svn.code.sf.net/p/axtls/code/trunk@270 9a5d90b5-6617-0410-8a86-bb477d3ed2e3
This commit is contained in:
cameronrich
2016-08-30 10:26:04 +00:00
committed by Ivan Grokhotkov
parent 822e866d05
commit da2dabf4ed
4 changed files with 9632 additions and 3 deletions

View File

@@ -37,6 +37,9 @@
#include "os_port.h" #include "os_port.h"
#include "crypto.h" #include "crypto.h"
/* only used for PKCS12 now */
#ifdef CONFIG_SSL_USE_PKCS12
/** /**
* Get ready for an encrypt/decrypt operation * Get ready for an encrypt/decrypt operation
*/ */
@@ -90,3 +93,5 @@ void RC4_crypt(RC4_CTX *ctx, const uint8_t *msg, uint8_t *out, int length)
ctx->x = x; ctx->x = x;
ctx->y = y; ctx->y = y;
} }
#endif

2521
ssl/test/ssltest.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -735,7 +735,7 @@ static void add_hmac_digest(SSL *ssl, int mode, uint8_t *hmac_header,
const uint8_t *buf, int buf_len, uint8_t *hmac_buf) const uint8_t *buf, int buf_len, uint8_t *hmac_buf)
{ {
int hmac_len = buf_len + 8 + SSL_RECORD_SIZE; int hmac_len = buf_len + 8 + SSL_RECORD_SIZE;
uint8_t *t_buf = (uint8_t *)malloc(buf_len+100); uint8_t *t_buf = (uint8_t *)malloc(hmac_len);
memcpy(t_buf, (mode == SSL_SERVER_WRITE || mode == SSL_CLIENT_WRITE) ? memcpy(t_buf, (mode == SSL_SERVER_WRITE || mode == SSL_CLIENT_WRITE) ?
ssl->write_sequence : ssl->read_sequence, 8); ssl->write_sequence : ssl->read_sequence, 8);
@@ -937,8 +937,8 @@ static void prf(SSL *ssl, const uint8_t *sec, int sec_len,
{ {
int len, i; int len, i;
const uint8_t *S1, *S2; const uint8_t *S1, *S2;
uint8_t xbuf[256]; /* needs to be > the amount of key data */ uint8_t xbuf[2*(SHA256_SIZE+32+16) + MD5_SIZE]; /* max keyblock */
uint8_t ybuf[256]; /* needs to be > the amount of key data */ uint8_t ybuf[2*(SHA256_SIZE+32+16) + SHA1_SIZE]; /* max keyblock */
len = sec_len/2; len = sec_len/2;
S1 = sec; S1 = sec;

7103
www/index.html Executable file

File diff suppressed because one or more lines are too long