]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
EAP-pwd: Fix a memory leak in hunting-and-pecking loop
authorJouni Malinen <jouni@codeaurora.org>
Wed, 6 Mar 2019 22:27:12 +0000 (00:27 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 6 Mar 2019 22:27:12 +0000 (00:27 +0200)
tmp2 (y^2) was derived once in each iteration of the loop and only freed
after all the loop iterations. Fix this by freeing the temporary value
during each iteration.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
src/eap_common/eap_pwd_common.c

index 88c6595887ab969fd3ee9d995b48eb86ba44b6f4..02fe01e9f177d16d1f6e52728ab5e01c0a708822 100644 (file)
@@ -238,6 +238,7 @@ int compute_password_element(EAP_PWD_group *grp, u16 num,
                 *
                 *      y^2 = x^3 + ax + b
                 */
+               crypto_bignum_deinit(tmp2, 1);
                tmp2 = crypto_ec_point_compute_y_sqr(grp->group, x_candidate);
                if (!tmp2)
                        goto fail;