summaryrefslogtreecommitdiffstats
path: root/recipes-connectivity/openssl/openssl-qoriq/qoriq/0022-cryptodev-do-not-zero-the-buffer-before-use.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-connectivity/openssl/openssl-qoriq/qoriq/0022-cryptodev-do-not-zero-the-buffer-before-use.patch')
-rw-r--r--recipes-connectivity/openssl/openssl-qoriq/qoriq/0022-cryptodev-do-not-zero-the-buffer-before-use.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/recipes-connectivity/openssl/openssl-qoriq/qoriq/0022-cryptodev-do-not-zero-the-buffer-before-use.patch b/recipes-connectivity/openssl/openssl-qoriq/qoriq/0022-cryptodev-do-not-zero-the-buffer-before-use.patch
new file mode 100644
index 0000000..0b2f0f1
--- /dev/null
+++ b/recipes-connectivity/openssl/openssl-qoriq/qoriq/0022-cryptodev-do-not-zero-the-buffer-before-use.patch
@@ -0,0 +1,48 @@
1From 75e3e7d600eb72e7374b1ecf5ece7b831bc98ed8 Mon Sep 17 00:00:00 2001
2From: Cristian Stoica <cristian.stoica@freescale.com>
3Date: Tue, 17 Feb 2015 13:12:53 +0200
4Subject: [PATCH 22/26] cryptodev: do not zero the buffer before use
5
6- The buffer is just about to be overwritten. Zeroing it before that has
7 no purpose
8
9Change-Id: I478c31bd2e254561474a7edf5e37980ca04217ce
10Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com>
11Reviewed-on: http://git.am.freescale.net:8181/34217
12---
13 crypto/engine/eng_cryptodev.c | 13 ++++---------
14 1 file changed, 4 insertions(+), 9 deletions(-)
15
16diff --git a/crypto/engine/eng_cryptodev.c b/crypto/engine/eng_cryptodev.c
17index 1ab5551..dbc5989 100644
18--- a/crypto/engine/eng_cryptodev.c
19+++ b/crypto/engine/eng_cryptodev.c
20@@ -1681,21 +1681,16 @@ static int
21 bn2crparam(const BIGNUM *a, struct crparam *crp)
22 {
23 ssize_t bytes, bits;
24- u_char *b;
25-
26- crp->crp_p = NULL;
27- crp->crp_nbits = 0;
28
29 bits = BN_num_bits(a);
30 bytes = (bits + 7) / 8;
31
32- b = malloc(bytes);
33- if (b == NULL)
34+ crp->crp_nbits = bits;
35+ crp->crp_p = malloc(bytes);
36+
37+ if (crp->crp_p == NULL)
38 return (1);
39- memset(b, 0, bytes);
40
41- crp->crp_p = (caddr_t) b;
42- crp->crp_nbits = bits;
43 BN_bn2bin(a, crp->crp_p);
44 return (0);
45 }
46--
472.3.5
48