commit | 9ee7f6cf6d945a857fc41781afa4ea6a41f74363 | [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 21:46:34 2016 +0000 |
tree | ceff7c6fc2ea9292dce4ff9a00fdb62109c9ea61 | |
parent | 69db3bc7382941675ac325c5c4aca36b2de3607d [diff] [blame] |
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 2baf532..4c85c29 100644 --- a/library/rsa.c +++ b/library/rsa.c
@@ -856,8 +856,7 @@ bad |= *p++; /* Must be zero */ } - if( pad_count < 8 ) - return( MBEDTLS_ERR_RSA_BAD_INPUT_DATA ); + bad |= ( pad_count < 8 ); if( bad ) return( MBEDTLS_ERR_RSA_INVALID_PADDING );