Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 1 | CVE: CVE-2018-0734 |
| 2 | |
| 3 | Upstream-Status: Backport |
| 4 | |
| 5 | Signed-off-by: Kai Kang <kai.kang@windriver.com> |
| 6 | |
| 7 | From 43e6a58d4991a451daf4891ff05a48735df871ac Mon Sep 17 00:00:00 2001 |
| 8 | From: Pauli <paul.dale@oracle.com> |
| 9 | Date: Mon, 29 Oct 2018 08:24:22 +1000 |
| 10 | Subject: [PATCH] Merge DSA reallocation timing fix CVE-2018-0734. |
| 11 | |
| 12 | Reviewed-by: Richard Levitte <levitte@openssl.org> |
| 13 | (Merged from https://github.com/openssl/openssl/pull/7513) |
| 14 | --- |
| 15 | crypto/dsa/dsa_ossl.c | 2 +- |
| 16 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 17 | |
| 18 | diff --git a/crypto/dsa/dsa_ossl.c b/crypto/dsa/dsa_ossl.c |
| 19 | index 2dcfedeeee..100e269268 100644 |
| 20 | --- a/crypto/dsa/dsa_ossl.c |
| 21 | +++ b/crypto/dsa/dsa_ossl.c |
| 22 | @@ -279,7 +279,7 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, |
| 23 | goto err; |
| 24 | |
| 25 | /* Preallocate space */ |
| 26 | - q_bits = BN_num_bits(dsa->q); |
| 27 | + q_bits = BN_num_bits(dsa->q) + sizeof(dsa->q->d[0]) * 16; |
| 28 | if (!BN_set_bit(&k, q_bits) |
| 29 | || !BN_set_bit(&l, q_bits) |
| 30 | || !BN_set_bit(&m, q_bits)) |
| 31 | -- |
| 32 | 2.17.0 |
| 33 | |