fix ssl/tsl

This commit is contained in:
pvvx 2017-02-18 17:35:50 +03:00
parent e423a86f64
commit 5cd20e5b8d
7 changed files with 37 additions and 10 deletions

View file

@ -2153,7 +2153,7 @@
//#define SSL_CACHE_DEFAULT_MAX_ENTRIES 50 /**< Maximum entries in cache */
/* SSL options */
#define SSL_MAX_CONTENT_LEN 4096 /**< Size of the input / output buffer */
//pvvx/#define SSL_MAX_CONTENT_LEN 4096 /**< Size of the input / output buffer */
//#define SSL_DEFAULT_TICKET_LIFETIME 86400 /**< Lifetime of session tickets (if enabled) */
//#define POLARSSL_PSK_MAX_LEN 32 /**< Max size of TLS pre-shared keys, in bytes (default 256 bits) */

View file

@ -258,7 +258,12 @@
* peers are using it too!
*/
#if !defined(SSL_MAX_CONTENT_LEN)
#define SSL_MAX_CONTENT_LEN 16384 /**< Size of the input / output buffer */
#if defined(POLARSSL_SSL_MAX_FRAGMENT_LENGTH)
extern unsigned int mfl_code_to_length[]; // pvvx
#define SSL_MAX_CONTENT_LEN mfl_code_to_length[0] // default = 16384 (!)
#else
#define SSL_MAX_CONTENT_LEN 16384 /**< Size of the input / output buffer */
#endif
#endif
/* \} name SECTION: Module settings */
@ -295,13 +300,15 @@
#define SSL_PADDING_ADD 0
#endif
#define SSL_BUFFER_LEN ( SSL_MAX_CONTENT_LEN \
#define SSL_BUFFER_LEN (rom_ssl_ram_map.ssl_buffer_len) // pvvx -> int set_ssl_max_frag_len(int len)
/*
( SSL_MAX_CONTENT_LEN \
+ SSL_COMPRESSION_ADD \
+ 29 /* counter + header + IV */ \
+ 29 // counter + header + IV \
+ SSL_MAC_ADD \
+ SSL_PADDING_ADD \
)
*/
/*
* Signaling ciphersuite values (SCSV)
*/

View file

@ -77,9 +77,10 @@ static void polarssl_zeroize( void *v, size_t n ) {
* } MaxFragmentLength;
* and we add 0 -> extension unused
*/
static unsigned int mfl_code_to_length[SSL_MAX_FRAG_LEN_INVALID] =
//static
unsigned int mfl_code_to_length[SSL_MAX_FRAG_LEN_INVALID] =
{
SSL_MAX_CONTENT_LEN, /* SSL_MAX_FRAG_LEN_NONE */
16384, /* = SSL_MAX_CONTENT_LEN */ /* SSL_MAX_FRAG_LEN_NONE */
512, /* SSL_MAX_FRAG_LEN_512 */
1024, /* SSL_MAX_FRAG_LEN_1024 */
2048, /* SSL_MAX_FRAG_LEN_2048 */