commit | cbbfaba5a6da7115d43fe5fea2e90d39e61166a0 | [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:09:52 2016 +0000 |
tree | b585c215d416992b6526c1803309fb3b62613afe | |
parent | e5b26c107bce88f4ed3af19ff230583c89ee3029 [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 6cdbd69..cb32bf4 100644 --- a/library/rsa.c +++ b/library/rsa.c
@@ -848,8 +848,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 );