CR50: remove incorrect output length check in RSA decrypt

The required output length is not known until padding
verification completes (this check is already done
in the appropriate padding check functions).

BRANCH=none
BUG=chrome-os-partner:43025,chrome-os-partner:47524
TEST=tests under test/tpm2/ pass.

Change-Id: I452244d052b7f334a6907bd653645671033a0890
Signed-off-by: nagendra modadugu <ngm@google.com>
Reviewed-on: https://chromium-review.googlesource.com/327074
Commit-Ready: Nagendra Modadugu <ngm@google.com>
Tested-by: Nagendra Modadugu <ngm@google.com>
Reviewed-by: Marius Schilder <mschilder@chromium.org>
This commit is contained in:
nagendra modadugu
2016-02-09 15:10:13 -08:00
committed by chrome-bot
parent e7b5e7b050
commit 388a7fa8cf

View File

@@ -380,7 +380,7 @@ int DCRYPTO_rsa_decrypt(struct RSA *rsa, uint8_t *out, uint32_t *out_len,
struct BIGNUM padded;
int ret = 1;
if (!check_modulus_params(&rsa->N, out_len))
if (!check_modulus_params(&rsa->N, NULL))
return 0;
if (in_len != bn_size(&rsa->N))
return 0; /* Invalid input length. */