blob: f6c4ca76f33e3c3b1f9191b249bee40098ad2d08 [file] [log] [blame]
Brad Bishop37a0e4d2017-12-04 01:01:44 -05001CVE: CVE-2017-9526
2Upstream-Status: Backport
3Signed-off-by: Ross Burton <ross.burton@intel.com>
4
5From b3cab278eb9c2ceda79f980bc26460d97f260041 Mon Sep 17 00:00:00 2001
6From: Jo Van Bulck <jo.vanbulck@cs.kuleuven.be>
7Date: Thu, 19 Jan 2017 17:00:15 +0100
8Subject: [PATCH] ecc: Store EdDSA session key in secure memory.
9
10* cipher/ecc-eddsa.c (_gcry_ecc_eddsa_sign): use mpi_snew to allocate
11session key.
12--
13
14An attacker who learns the EdDSA session key from side-channel
15observation during the signing process, can easily revover the long-
16term secret key. Storing the session key in secure memory ensures that
17constant time point operations are used in the MPI library.
18
19Signed-off-by: Jo Van Bulck <jo.vanbulck@cs.kuleuven.be>
20---
21 cipher/ecc-eddsa.c | 2 +-
22 1 file changed, 1 insertion(+), 1 deletion(-)
23
24diff --git a/cipher/ecc-eddsa.c b/cipher/ecc-eddsa.c
25index f91f8489..813e030d 100644
26--- a/cipher/ecc-eddsa.c
27+++ b/cipher/ecc-eddsa.c
28@@ -603,7 +603,7 @@ _gcry_ecc_eddsa_sign (gcry_mpi_t input, ECC_secret_key *skey,
29 a = mpi_snew (0);
30 x = mpi_new (0);
31 y = mpi_new (0);
32- r = mpi_new (0);
33+ r = mpi_snew (0);
34 ctx = _gcry_mpi_ec_p_internal_new (skey->E.model, skey->E.dialect, 0,
35 skey->E.p, skey->E.a, skey->E.b);
36 b = (ctx->nbits+7)/8;
37--
382.11.0
39