mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
Merge remote-tracking branch 'crypto/development' into development-restricted
* crypto/development: (77 commits) all.sh: disable MEMORY_BUFFER_ALLOC in cmake asan build Unify gcc and clang cmake flags to test with UBsan Add an input check in psa_its_set Remove storage errors from psa_generate_random Update getting_started.md Update based on Jaeden's comments. Update getting_started.md Fix return code warnings Update getting_started.md Fix warnings Add PSA_ERROR_STORAGE_FAILURE to psa_cipher_generate_iv Remove errorneous insert Add STORAGE_FAILURE everywhere + add missing codes Add storage failure to psa_mac_verify_finish Add storage failure to psa_mac_sign_finish Add PSA_ERROR_STORAGE_FAILURE to psa_aead_*_setup functions Added PSA_ERROR_BAD_STATE to functions with operations Added extra bad state case to psa_hash_setup Add missing return codes to psa_generate_key Add PSA_ERROR_BUFFER_TOO_SMALL to psa_mac_compute ...
This commit is contained in:
@ -742,10 +742,15 @@ cleanup:
|
||||
static mbedtls_mpi_uint mpi_uint_bigendian_to_host_c( mbedtls_mpi_uint x )
|
||||
{
|
||||
uint8_t i;
|
||||
unsigned char *x_ptr;
|
||||
mbedtls_mpi_uint tmp = 0;
|
||||
/* This works regardless of the endianness. */
|
||||
for( i = 0; i < ciL; i++, x >>= 8 )
|
||||
tmp |= ( x & 0xFF ) << ( ( ciL - 1 - i ) << 3 );
|
||||
|
||||
for( i = 0, x_ptr = (unsigned char*) &x; i < ciL; i++, x_ptr++ )
|
||||
{
|
||||
tmp <<= CHAR_BIT;
|
||||
tmp |= (mbedtls_mpi_uint) *x_ptr;
|
||||
}
|
||||
|
||||
return( tmp );
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,10 @@ static void * (* const volatile memset_func)( void *, int, size_t ) = memset;
|
||||
|
||||
void mbedtls_platform_zeroize( void *buf, size_t len )
|
||||
{
|
||||
memset_func( buf, 0, len );
|
||||
MBEDTLS_INTERNAL_VALIDATE( len == 0 || buf != NULL );
|
||||
|
||||
if( len > 0 )
|
||||
memset_func( buf, 0, len );
|
||||
}
|
||||
#endif /* MBEDTLS_PLATFORM_ZEROIZE_ALT */
|
||||
|
||||
|
@ -214,9 +214,12 @@ psa_status_t psa_its_set( psa_storage_uid_t uid,
|
||||
n = fwrite( &header, 1, sizeof( header ), stream );
|
||||
if( n != sizeof( header ) )
|
||||
goto exit;
|
||||
n = fwrite( p_data, 1, data_length, stream );
|
||||
if( n != data_length )
|
||||
goto exit;
|
||||
if( data_length != 0 )
|
||||
{
|
||||
n = fwrite( p_data, 1, data_length, stream );
|
||||
if( n != data_length )
|
||||
goto exit;
|
||||
}
|
||||
status = PSA_SUCCESS;
|
||||
|
||||
exit:
|
||||
|
Reference in New Issue
Block a user