From tianjia.zhang at linux.alibaba.com Mon May 17 04:47:29 2021 From: tianjia.zhang at linux.alibaba.com (Tianjia Zhang) Date: Mon, 17 May 2021 10:47:29 +0800 Subject: [PATCH] cipher: Fix memory leaks for EdDSA. Message-ID: <20210517024729.33320-1-tianjia.zhang@linux.alibaba.com> * cipher/ecc-eddsa.c (_gcry_ecc_eddsa_genkey): Initialize point Q when used. -- Signed-off-by: Tianjia Zhang --- cipher/ecc-eddsa.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/cipher/ecc-eddsa.c b/cipher/ecc-eddsa.c index 2025cbca..fedf5ad6 100644 --- a/cipher/ecc-eddsa.c +++ b/cipher/ecc-eddsa.c @@ -598,8 +598,6 @@ _gcry_ecc_eddsa_genkey (mpi_ec_t ec, int flags) size_t dlen; unsigned char *hash_d = NULL; - point_init (&Q); - if ((flags & PUBKEY_FLAG_TRANSIENT_KEY)) random_level = GCRY_STRONG_RANDOM; else @@ -625,16 +623,14 @@ _gcry_ecc_eddsa_genkey (mpi_ec_t ec, int flags) ec->d = _gcry_mpi_set_opaque (NULL, dbuf, dlen*8); rc = _gcry_ecc_eddsa_compute_h_d (&hash_d, ec); if (rc) - { - point_free (&Q); - goto leave; - } + goto leave; _gcry_mpi_set_buffer (a, hash_d, b, 0); xfree (hash_d); /* log_printmpi ("ecgen a", a); */ /* Compute Q. */ + point_init (&Q); _gcry_mpi_ec_mul_point (&Q, a, ec->G, ec); if (DBG_CIPHER) log_printpnt ("ecgen pk", &Q, ec); -- 2.19.1.3.ge56e4f7 From jussi.kivilinna at iki.fi Mon May 17 20:39:17 2021 From: jussi.kivilinna at iki.fi (Jussi Kivilinna) Date: Mon, 17 May 2021 21:39:17 +0300 Subject: [PATCH] Always include in cipher assembly codes In-Reply-To: <20210427162928.849963-1-hjl.tools@gmail.com> References: <20210427162928.849963-1-hjl.tools@gmail.com> Message-ID: Hello, On 27.4.2021 19.29, H.J. Lu via Gcrypt-devel wrote: > * cipher/poly1305-s390x.S: Always include . > > When Intel CET is enabled, we need to include in assembly codes > to mark Intel CET support even if it is empty. We should always include > in cipher assembly codes so that they will be marked for > Intel CET support when compiling for x86-64 and i686. > > Signed-off-by: H.J. Lu Patch applied. Thanks. -Jussi From jussi.kivilinna at iki.fi Mon May 17 20:39:49 2021 From: jussi.kivilinna at iki.fi (Jussi Kivilinna) Date: Mon, 17 May 2021 21:39:49 +0300 Subject: [PATCH] cipher: Fix memory leaks for EdDSA. In-Reply-To: <20210517024729.33320-1-tianjia.zhang@linux.alibaba.com> References: <20210517024729.33320-1-tianjia.zhang@linux.alibaba.com> Message-ID: On 17.5.2021 5.47, Tianjia Zhang via Gcrypt-devel wrote: > * cipher/ecc-eddsa.c (_gcry_ecc_eddsa_genkey): Initialize point Q when used. > -- > > Signed-off-by: Tianjia Zhang Patch applied. Thanks. -Jussi