From ff8d8d72aa687d510ab1e2ef02b709e808b6fdfa Mon Sep 17 00:00:00 2001 From: Ron Eldor Date: Sun, 14 Apr 2019 17:36:10 +0300 Subject: [PATCH] Remove a redundant function call Remove a call to `mbedtls_mpi_bitlen()` since the returned value is overwritten in the line after. This is redundant since da31fa137a1183d3feed5981af6d05c550a8c005. Fixes #2377. --- ChangeLog | 3 +++ library/bignum.c | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 798e84a00..e0a824ebd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -38,6 +38,9 @@ Bugfix for the parameter. * Add a check for MBEDTLS_X509_CRL_PARSE_C in ssl_server2, guarding the crl sni entry parameter. Reported by inestlerode in #560. + * Remove redundant line for getting the bitlen of a bignum, since the variable + holding the returned value is overwritten a line after. + Found by irwir in #2377. Changes * Return from various debugging routines immediately if the diff --git a/library/bignum.c b/library/bignum.c index 41946183c..20a14328f 100644 --- a/library/bignum.c +++ b/library/bignum.c @@ -2333,8 +2333,6 @@ static int mpi_miller_rabin( const mbedtls_mpi *X, size_t rounds, MBEDTLS_MPI_CHK( mbedtls_mpi_copy( &R, &W ) ); MBEDTLS_MPI_CHK( mbedtls_mpi_shift_r( &R, s ) ); - i = mbedtls_mpi_bitlen( X ); - for( i = 0; i < rounds; i++ ) { /*