mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-02-11 18:40:53 +00:00
Fix error in handling of return value from mbedtls_nist_kw_unwrap
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
This commit is contained in:
parent
f8182d91a7
commit
4fc14cc4ae
@ -421,8 +421,8 @@ int mbedtls_nist_kw_unwrap(mbedtls_nist_kw_context *ctx,
|
|||||||
* larger than 8, because of the type wrap around.
|
* larger than 8, because of the type wrap around.
|
||||||
*/
|
*/
|
||||||
padlen = in_len - KW_SEMIBLOCK_LENGTH - Plen;
|
padlen = in_len - KW_SEMIBLOCK_LENGTH - Plen;
|
||||||
ret = -((int) mbedtls_ct_uint_if_else_0(mbedtls_ct_uint_gt(padlen, 7),
|
ret = -((int) mbedtls_ct_uint_if(mbedtls_ct_uint_gt(padlen, 7),
|
||||||
-MBEDTLS_ERR_CIPHER_AUTH_FAILED));
|
-MBEDTLS_ERR_CIPHER_AUTH_FAILED, -ret));
|
||||||
padlen &= 7;
|
padlen &= 7;
|
||||||
|
|
||||||
/* Check padding in "constant-time" */
|
/* Check padding in "constant-time" */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user