From: Bernd Edlinger Date: Sun, 17 Mar 2019 16:28:24 +0000 (+0100) Subject: Clear the point S before freeing in ec_mul_consttime X-Git-Tag: OpenSSL_1_0_2s~9 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=94eb7d07c0c14bf18bd3a4e4d6c1ef1e6633d447;p=oweals%2Fopenssl.git Clear the point S before freeing in ec_mul_consttime The secret point R can be recovered from S using the equation R = S - P. The X and Z coordinates should be sufficient for that. Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/8505) (cherry picked from commit 502b871ad4eacc96a31f89d9a9470ca2858da998) --- diff --git a/crypto/ec/ec_mult.c b/crypto/ec/ec_mult.c index da71526818..fce88822f6 100644 --- a/crypto/ec/ec_mult.c +++ b/crypto/ec/ec_mult.c @@ -519,7 +519,7 @@ static int ec_mul_consttime(const EC_GROUP *group, EC_POINT *r, ret = 1; err: - EC_POINT_free(s); + EC_POINT_clear_free(s); BN_CTX_end(ctx); BN_CTX_free(new_ctx);