1 From 1f7ef531a010a3a86c9c16f801044b5f01652eb2 Mon Sep 17 00:00:00 2001
2 From: Cristian Stoica <cristian.stoica@freescale.com>
3 Date: Tue, 17 Feb 2015 13:12:53 +0200
4 Subject: [PATCH 19/48] cryptodev: do not zero the buffer before use
6 - The buffer is just about to be overwritten. Zeroing it before that has
9 Change-Id: I478c31bd2e254561474a7edf5e37980ca04217ce
10 Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com>
11 Reviewed-on: http://git.am.freescale.net:8181/34217
13 crypto/engine/eng_cryptodev.c | 14 ++++----------
14 1 file changed, 4 insertions(+), 10 deletions(-)
16 diff --git a/crypto/engine/eng_cryptodev.c b/crypto/engine/eng_cryptodev.c
17 index 4cffaf1..bbc903b 100644
18 --- a/crypto/engine/eng_cryptodev.c
19 +++ b/crypto/engine/eng_cryptodev.c
20 @@ -1801,21 +1801,15 @@ cryptodev_engine_digests(ENGINE *e, const EVP_MD **digest,
21 static int bn2crparam(const BIGNUM *a, struct crparam *crp)
29 bits = BN_num_bits(a);
30 bytes = (bits + 7) / 8;
35 - memset(b, 0, bytes);
37 - crp->crp_p = (caddr_t) b;
38 crp->crp_nbits = bits;
39 + crp->crp_p = malloc(bytes);
41 + if (crp->crp_p == NULL)
44 BN_bn2bin(a, crp->crp_p);