[MBEDTLS] Update to version 2.7.14. CORE-16787

This commit is contained in:
Thomas Faber 2020-04-04 21:30:22 +02:00
parent 040546d8ff
commit 1b00a1f50f
No known key found for this signature in database
GPG key ID: 076E7C3D44720826
8 changed files with 115 additions and 52 deletions

View file

@ -153,9 +153,10 @@ int mbedtls_mpi_shrink( mbedtls_mpi *X, size_t nblimbs )
mbedtls_mpi_uint *p;
size_t i;
/* Actually resize up in this case */
/* Actually resize up if there are currently fewer than nblimbs limbs. */
if( X->n <= nblimbs )
return( mbedtls_mpi_grow( X, nblimbs ) );
/* After this point, then X->n > nblimbs and in particular X->n > 0. */
for( i = X->n - 1; i > 0; i-- )
if( X->p[i] != 0 )
@ -192,7 +193,7 @@ int mbedtls_mpi_copy( mbedtls_mpi *X, const mbedtls_mpi *Y )
if( X == Y )
return( 0 );
if( Y->p == NULL )
if( Y->n == 0 )
{
mbedtls_mpi_free( X );
return( 0 );