Merge pull request #3513 from gilles-peskine-arm/ecp-bignum-error-checks-2.16

Backport 2.16: add missing some error checks in ECP and bignum
This commit is contained in:
Gilles Peskine 2020-12-07 13:06:42 +01:00 committed by GitHub
commit 8ed9ac85e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 43 additions and 39 deletions

View file

@ -1044,7 +1044,7 @@ static inline void sub32( uint32_t *dst, uint32_t src, signed char *carry )
STORE32; i++; \
cur = c > 0 ? c : 0; STORE32; \
cur = 0; while( ++i < MAX32 ) { STORE32; } \
if( c < 0 ) fix_negative( N, c, &C, bits );
if( c < 0 ) MBEDTLS_MPI_CHK( fix_negative( N, c, &C, bits ) );
/*
* If the result is negative, we get it in the form