commit | 7c3be6b97e69280aac3401be46323cd6869bdb5f | [log] [tgz] |
---|---|---|
author | Janos Follath <janos.follath@arm.com> | Fri Feb 12 13:30:09 2016 +0000 |
committer | Simon Butcher <simon.butcher@arm.com> | Tue Mar 01 22:28:42 2016 +0000 |
tree | 2aaf75ff5d7a21003835f9acba3f6d2d085a36d6 | |
parent | f1225eaffce425acfbac79673ce89695ca8291f2 [diff] |
Removing 'if' branch from the fix. This new error shouldn't be distinguishable from other padding errors. Updating 'bad' instead of adding a new 'if' branch.
diff --git a/library/rsa.c b/library/rsa.c index aa7e272..5ab636f 100644 --- a/library/rsa.c +++ b/library/rsa.c
@@ -844,8 +844,7 @@ bad |= *p++; /* Must be zero */ } - if( pad_count < 8 ) - return( MBEDTLS_ERR_RSA_BAD_INPUT_DATA ); + bad |= ( pad_count < 8 ); if( bad ) return( POLARSSL_ERR_RSA_INVALID_PADDING );