diff options
| author | Ross Burton <ross.burton@intel.com> | 2017-07-18 23:07:08 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-07-19 11:30:22 +0100 |
| commit | 74bfe85d5ceabe351ff7151423a5279d6adc0a37 (patch) | |
| tree | d3fb925c81dccab7665d1331a4d3121ee0f568cc | |
| parent | 6bd890d9e011014cf323e61267f8b256949d44aa (diff) | |
| download | poky-74bfe85d5ceabe351ff7151423a5279d6adc0a37.tar.gz | |
libgcrypt: fix CVE-2017-9526
In libgcrypt before 1.7.7, an attacker who learns the EdDSA session key (from
side-channel observation during the signing process) can easily recover the
long-term secret key. 1.7.7 makes a cipher/ecc-eddsa.c change to store this
session key in secure memory, to ensure that constant-time point operations are
used in the MPI library.
(From OE-Core rev: 6039dbfd981830b5406c25a27ccfae0e5ed016e8)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-support/libgcrypt/files/0001-ecc-Store-EdDSA-session-key-in-secure-memory.patch | 39 | ||||
| -rw-r--r-- | meta/recipes-support/libgcrypt/libgcrypt.inc | 1 |
2 files changed, 40 insertions, 0 deletions
diff --git a/meta/recipes-support/libgcrypt/files/0001-ecc-Store-EdDSA-session-key-in-secure-memory.patch b/meta/recipes-support/libgcrypt/files/0001-ecc-Store-EdDSA-session-key-in-secure-memory.patch new file mode 100644 index 0000000000..0a4dfe6773 --- /dev/null +++ b/meta/recipes-support/libgcrypt/files/0001-ecc-Store-EdDSA-session-key-in-secure-memory.patch | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | CVE: CVE-2017-9526 | ||
| 2 | Upstream-Status: Backport | ||
| 3 | Signed-off-by: Ross Burton <ross.burton@intel.com> | ||
| 4 | |||
| 5 | From 4a1768d683f6572ad86d833508c70e6b3dc1efdc Mon Sep 17 00:00:00 2001 | ||
| 6 | From: Jo Van Bulck <jo.vanbulck@cs.kuleuven.be> | ||
| 7 | Date: Thu, 19 Jan 2017 17:00:15 +0100 | ||
| 8 | Subject: [PATCH] ecc: Store EdDSA session key in secure memory. | ||
| 9 | |||
| 10 | * cipher/ecc-eddsa.c (_gcry_ecc_eddsa_sign): use mpi_snew to allocate | ||
| 11 | session key. | ||
| 12 | -- | ||
| 13 | |||
| 14 | An attacker who learns the EdDSA session key from side-channel | ||
| 15 | observation during the signing process, can easily revover the long- | ||
| 16 | term secret key. Storing the session key in secure memory ensures that | ||
| 17 | constant time point operations are used in the MPI library. | ||
| 18 | |||
| 19 | Signed-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 | |||
| 24 | diff --git a/cipher/ecc-eddsa.c b/cipher/ecc-eddsa.c | ||
| 25 | index 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 | -- | ||
| 38 | 2.11.0 | ||
| 39 | |||
diff --git a/meta/recipes-support/libgcrypt/libgcrypt.inc b/meta/recipes-support/libgcrypt/libgcrypt.inc index 84c1cc018b..e95c059c87 100644 --- a/meta/recipes-support/libgcrypt/libgcrypt.inc +++ b/meta/recipes-support/libgcrypt/libgcrypt.inc | |||
| @@ -20,6 +20,7 @@ SRC_URI = "${GNUPG_MIRROR}/libgcrypt/libgcrypt-${PV}.tar.gz \ | |||
| 20 | file://libgcrypt-fix-building-error-with-O2-in-sysroot-path.patch \ | 20 | file://libgcrypt-fix-building-error-with-O2-in-sysroot-path.patch \ |
| 21 | file://fix-ICE-failure-on-mips-with-option-O-and-g.patch \ | 21 | file://fix-ICE-failure-on-mips-with-option-O-and-g.patch \ |
| 22 | file://fix-undefined-reference-to-pthread.patch \ | 22 | file://fix-undefined-reference-to-pthread.patch \ |
| 23 | file://0001-ecc-Store-EdDSA-session-key-in-secure-memory.patch \ | ||
| 23 | " | 24 | " |
| 24 | 25 | ||
| 25 | BINCONFIG = "${bindir}/libgcrypt-config" | 26 | BINCONFIG = "${bindir}/libgcrypt-config" |
