From 388a7fa8cff831dcb5f25a3ea4bd67de898d865a Mon Sep 17 00:00:00 2001 From: nagendra modadugu Date: Tue, 9 Feb 2016 15:10:13 -0800 Subject: [PATCH] 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 Reviewed-on: https://chromium-review.googlesource.com/327074 Commit-Ready: Nagendra Modadugu Tested-by: Nagendra Modadugu Reviewed-by: Marius Schilder --- chip/g/dcrypto/rsa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chip/g/dcrypto/rsa.c b/chip/g/dcrypto/rsa.c index 92e9af4c59..9d854e7533 100644 --- a/chip/g/dcrypto/rsa.c +++ b/chip/g/dcrypto/rsa.c @@ -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. */