/[packages]/updates/5/nettle/current/SOURCES/0003-Check-for-invalid-keys-with-even-p-in-dsa_sign.patch
ViewVC logotype

Contents of /updates/5/nettle/current/SOURCES/0003-Check-for-invalid-keys-with-even-p-in-dsa_sign.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1046118 - (show annotations) (download)
Fri Aug 12 18:13:51 2016 UTC (7 years, 8 months ago) by luigiwalser
File size: 753 byte(s)
add more upstream bugfixes related to CVE-2016-6489
1 From 544b4047de689519ab3e6ec55b776b95b3e264a9 Mon Sep 17 00:00:00 2001
2 From: Niels Möller <nisse@lysator.liu.se>
3 Date: Thu, 4 Aug 2016 10:22:26 +0200
4 Subject: [PATCH] Check for invalid keys, with even p, in dsa_sign.
5
6 ---
7 dsa-sign.c | 5 +++++
8 1 files changed, 5 insertions(+), 0 deletions(-)
9
10 diff --git a/dsa-sign.c b/dsa-sign.c
11 index 9d6bb18..b713743 100644
12 --- a/dsa-sign.c
13 +++ b/dsa-sign.c
14 @@ -56,6 +56,11 @@ dsa_sign(const struct dsa_params *params,
15 mpz_t tmp;
16 int res;
17
18 + /* Check that p is odd, so that invalid keys don't result in a crash
19 + inside mpz_powm_sec. */
20 + if (mpz_even_p (params->p))
21 + return 0;
22 +
23 /* Select k, 0<k<q, randomly */
24 mpz_init_set(tmp, params->q);
25 mpz_sub_ui(tmp, tmp, 1);
26 --
27 libgit2 0.24.0
28

  ViewVC Help
Powered by ViewVC 1.1.30