diff options
author | Matt Caswell <matt@openssl.org> | 2015-11-04 17:30:22 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-01-29 12:56:58 +0000 |
commit | 615614c8862fb89dcf1551a4e113be0789dddf5f (patch) | |
tree | 1c3bcfd008be669904d0186bb204494381479d9e /crypto/ec/ecp_nistp521.c | |
parent | f5a12207eccfd814bde68b880a96910dfa25f164 (diff) |
Fix bug in nistp224/256/521 where have_precompute_mult always returns 0
During precomputation if the group given is well known then we memcpy a
well known precomputation. However we go the wrong label in the code and
don't store the data properly. Consequently if we call have_precompute_mult
the data isn't there and we return 0.
RT#3600
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/ec/ecp_nistp521.c')
-rw-r--r-- | crypto/ec/ecp_nistp521.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/ec/ecp_nistp521.c b/crypto/ec/ecp_nistp521.c index 3122f3f8ee..04c3f08cc2 100644 --- a/crypto/ec/ecp_nistp521.c +++ b/crypto/ec/ecp_nistp521.c @@ -2031,8 +2031,7 @@ int ec_GFp_nistp521_precompute_mult(EC_GROUP *group, BN_CTX *ctx) */ if (0 == EC_POINT_cmp(group, generator, group->generator, ctx)) { memcpy(pre->g_pre_comp, gmul, sizeof(pre->g_pre_comp)); - ret = 1; - goto err; + goto done; } if ((!BN_to_felem(pre->g_pre_comp[1][0], group->generator->X)) || (!BN_to_felem(pre->g_pre_comp[1][1], group->generator->Y)) || @@ -2090,6 +2089,7 @@ int ec_GFp_nistp521_precompute_mult(EC_GROUP *group, BN_CTX *ctx) } make_points_affine(15, &(pre->g_pre_comp[1]), tmp_felems); + done: SETPRECOMP(group, nistp521, pre); ret = 1; pre = NULL; |