Fix unused parameters and ifdefs

Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
This commit is contained in:
Andrzej Kurek 2020-12-08 04:46:25 -05:00
parent 777d4217f1
commit 52e08cbcb2
2 changed files with 5 additions and 3 deletions

View File

@ -3654,14 +3654,14 @@ static int ssl_out_client_key_exchange_write( mbedtls_ssl_context *ssl,
{
((void) n);
((void) ret);
if( (size_t)( end - p ) < 2 * NUM_ECC_BYTES + 2 )
return( MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL );
*p++ = 2 * NUM_ECC_BYTES + 1;
*p++ = 0x04; /* uncompressed point presentation */
#if defined(MBEDTLS_EARLY_KEY_COMPUTATION) && defined(MBEDTLS_USE_TINYCRYPT)
#if defined(MBEDTLS_EARLY_KEY_COMPUTATION)
memcpy( p, ssl->handshake->ecdh_publickey, 2 * NUM_ECC_BYTES );
#else
ret = uECC_make_key( p, ssl->handshake->ecdh_privkey );

View File

@ -12056,7 +12056,9 @@ void mbedtls_ssl_handshake_free( mbedtls_ssl_context *ssl )
#endif
#endif /* MBEDTLS_SSL_PROTO_TLS1_2 */
#if defined(MBEDTLS_SSL_FREE_SERVER_CERTIFICATE)
#if defined(MBEDTLS_SSL_FREE_SERVER_CERTIFICATE) && \
defined(MBEDTLS_X509_CRT_PARSE_C) && \
defined(MBEDTLS_SSL_KEEP_PEER_CERTIFICATE)
mbedtls_x509_crt_free( ssl->session_negotiate->peer_cert );
mbedtls_free( ssl->session->peer_cert );
ssl->session->peer_cert = NULL;