summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornagendra modadugu <ngm@google.com>2016-04-27 23:19:27 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-04-30 02:43:22 -0700
commitb2280c24b4bb93aaa4b41592ea8fa34aeed7d789 (patch)
tree72d65813d69cc024db0b07cee15cef28ec448eb7
parent61e065326117f6aef474164a6a42fa0e50eeb096 (diff)
downloadchrome-ec-b2280c24b4bb93aaa4b41592ea8fa34aeed7d789.tar.gz
CR50: point multiply should check point for curve membership
_cpri__EccPointMultiply should check whether the provided point is on the curve prior to doing a multiply. BRANCH=none BUG=chrome-os-partner:43025,chrome-os-partner:47524 TEST=TCG test CPCTPM_TC2_4_13_01_01 passes Change-Id: Ia92494070c62f7e03b395975138c0c8446a7284d Signed-off-by: nagendra modadugu <ngm@google.com> Reviewed-on: https://chromium-review.googlesource.com/341112 Commit-Ready: Nagendra Modadugu <ngm@google.com> Tested-by: Nagendra Modadugu <ngm@google.com> Reviewed-by: Marius Schilder <mschilder@chromium.org>
-rw-r--r--board/cr50/tpm2/ecc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/board/cr50/tpm2/ecc.c b/board/cr50/tpm2/ecc.c
index 838fbc1143..b573284608 100644
--- a/board/cr50/tpm2/ecc.c
+++ b/board/cr50/tpm2/ecc.c
@@ -75,7 +75,9 @@ CRYPT_RESULT _cpri__EccPointMultiply(
return CRYPT_PARAMETER;
if (n1 != NULL && !check_p256_param(n1))
return CRYPT_PARAMETER;
- if (in != NULL && !check_p256_point(in))
+ if (in != NULL &&
+ (!check_p256_point(in) ||
+ !_cpri__EccIsPointOnCurve(curve_id, in)))
return CRYPT_POINT;
if (n2 != NULL && !check_p256_param(n2))
return CRYPT_PARAMETER;