mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
Merge branch 'development' into dtls
* development: (100 commits) Update Changelog for the mem-measure branch Fix issues introduced when rebasing Fix compile error in memory_buffer_alloc_selftest Code cosmetics Add curve25519 to ecc-heap.sh Add curve25519 to the benchmark program Fix compile issue when buffer_alloc not available New script ecc-heap.sh Fix unused variable issue in some configs Rm usunused member in private struct Add heap usage for PK in benchmark Use memory_buffer_alloc() in benchmark if available Only define mode_func if mode is enabled (CBC etc) PKCS8 encrypted key depend on PKCS5 or PKCS12 Disable SRV_C for client measurement Output stack+heap usage with massif Enable NIST_OPTIM by default for config-suite-b Refactor memory.sh Adapt memory.sh to config-suite-b Adapt mini-client for config-suite-b.h ... Conflicts: ChangeLog include/polarssl/net.h library/Makefile library/error.c library/ssl_tls.c programs/Makefile programs/ssl/ssl_client2.c programs/ssl/ssl_server2.c tests/Makefile
This commit is contained in:
@ -30,6 +30,9 @@
|
||||
|
||||
#include "polarssl/debug.h"
|
||||
#include "polarssl/ssl.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#if defined(POLARSSL_ECP_C)
|
||||
#include "polarssl/ecp.h"
|
||||
#endif
|
||||
@ -37,13 +40,11 @@
|
||||
#if defined(POLARSSL_PLATFORM_C)
|
||||
#include "polarssl/platform.h"
|
||||
#else
|
||||
#include <stdlib.h>
|
||||
#define polarssl_malloc malloc
|
||||
#define polarssl_free free
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined(POLARSSL_HAVE_TIME)
|
||||
#include <time.h>
|
||||
#endif
|
||||
@ -3220,7 +3221,6 @@ static int ssl_parse_encrypted_pms( ssl_context *ssl,
|
||||
unsigned char ver[2];
|
||||
unsigned char fake_pms[48], peer_pms[48];
|
||||
unsigned char mask;
|
||||
unsigned int uret;
|
||||
size_t i;
|
||||
|
||||
if( ! pk_can_do( ssl_own_key( ssl ), POLARSSL_PK_RSA ) )
|
||||
@ -3287,10 +3287,7 @@ static int ssl_parse_encrypted_pms( ssl_context *ssl,
|
||||
}
|
||||
ssl->handshake->pmslen = 48;
|
||||
|
||||
uret = (unsigned) ret;
|
||||
uret |= -uret; /* msb = ( ret != 0 ) */
|
||||
uret >>= 8 * sizeof( uret ) - 1; /* uret = ( ret != 0 ) */
|
||||
mask = (unsigned char)( -uret ) ; /* ret ? 0xff : 0x00 */
|
||||
mask = (unsigned char)( - ( ret != 0 ) ); /* ret ? 0xff : 0x00 */
|
||||
for( i = 0; i < ssl->handshake->pmslen; i++ )
|
||||
pms[i] = ( mask & fake_pms[i] ) | ( (~mask) & peer_pms[i] );
|
||||
|
||||
|
Reference in New Issue
Block a user