summaryrefslogtreecommitdiffstats
path: root/recipes-connectivity/openssl/openssl-qoriq/qoriq/0003-cryptodev-fix-algorithm-registration.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-connectivity/openssl/openssl-qoriq/qoriq/0003-cryptodev-fix-algorithm-registration.patch')
-rw-r--r--recipes-connectivity/openssl/openssl-qoriq/qoriq/0003-cryptodev-fix-algorithm-registration.patch71
1 files changed, 34 insertions, 37 deletions
diff --git a/recipes-connectivity/openssl/openssl-qoriq/qoriq/0003-cryptodev-fix-algorithm-registration.patch b/recipes-connectivity/openssl/openssl-qoriq/qoriq/0003-cryptodev-fix-algorithm-registration.patch
index f0d97e9..9d30cc3 100644
--- a/recipes-connectivity/openssl/openssl-qoriq/qoriq/0003-cryptodev-fix-algorithm-registration.patch
+++ b/recipes-connectivity/openssl/openssl-qoriq/qoriq/0003-cryptodev-fix-algorithm-registration.patch
@@ -1,64 +1,61 @@
1From 084fa469a8fef530d71a0870364df1c7997f6465 Mon Sep 17 00:00:00 2001 1From 36bb0879b498f8e87798848dafa058476f723165 Mon Sep 17 00:00:00 2001
2From: Cristian Stoica <cristian.stoica@freescale.com> 2From: Cristian Stoica <cristian.stoica@freescale.com>
3Date: Thu, 31 Jul 2014 14:06:19 +0300 3Date: Thu, 31 Jul 2014 14:06:19 +0300
4Subject: [PATCH 03/26] cryptodev: fix algorithm registration 4Subject: [PATCH 03/48] cryptodev: fix algorithm registration
5 5
6Cryptodev specific algorithms must register only if available in kernel. 6Cryptodev specific algorithms must register only if available in kernel.
7 7
8Change-Id: Iec5af8f4f3138357e4b96f2ec1627278134e4808
9Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com> 8Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com>
10Reviewed-on: http://git.am.freescale.net:8181/15326
11Reviewed-by: Horia Ioan Geanta Neag <horia.geanta@freescale.com> 9Reviewed-by: Horia Ioan Geanta Neag <horia.geanta@freescale.com>
12Reviewed-on: http://git.am.freescale.net:8181/17224
13--- 10---
14 crypto/engine/eng_cryptodev.c | 20 +++++++++++++++++--- 11 crypto/engine/eng_cryptodev.c | 20 +++++++++++++++++---
15 1 file changed, 17 insertions(+), 3 deletions(-) 12 1 file changed, 17 insertions(+), 3 deletions(-)
16 13
17diff --git a/crypto/engine/eng_cryptodev.c b/crypto/engine/eng_cryptodev.c 14diff --git a/crypto/engine/eng_cryptodev.c b/crypto/engine/eng_cryptodev.c
18index 7588a28..e3eb98b 100644 15index 4d783d4..3b6515e 100644
19--- a/crypto/engine/eng_cryptodev.c 16--- a/crypto/engine/eng_cryptodev.c
20+++ b/crypto/engine/eng_cryptodev.c 17+++ b/crypto/engine/eng_cryptodev.c
21@@ -133,6 +133,8 @@ static int cryptodev_dh_compute_key(unsigned char *key, 18@@ -134,6 +134,8 @@ static int cryptodev_dh_compute_key(unsigned char *key, const BIGNUM *pub_key,
22 static int cryptodev_ctrl(ENGINE *e, int cmd, long i, void *p, 19 static int cryptodev_ctrl(ENGINE *e, int cmd, long i, void *p,
23 void (*f)(void)); 20 void (*f) (void));
24 void ENGINE_load_cryptodev(void); 21 void ENGINE_load_cryptodev(void);
25+const EVP_CIPHER cryptodev_aes_128_cbc_hmac_sha1; 22+const EVP_CIPHER cryptodev_aes_128_cbc_hmac_sha1;
26+const EVP_CIPHER cryptodev_aes_256_cbc_hmac_sha1; 23+const EVP_CIPHER cryptodev_aes_256_cbc_hmac_sha1;
27 24
28 static const ENGINE_CMD_DEFN cryptodev_defns[] = { 25 static const ENGINE_CMD_DEFN cryptodev_defns[] = {
29 { 0, NULL, NULL, 0 } 26 {0, NULL, NULL, 0}
30@@ -342,7 +344,21 @@ get_cryptodev_digests(const int **cnids) 27@@ -389,7 +391,21 @@ static int get_cryptodev_digests(const int **cnids)
31 static int 28 */
32 cryptodev_usable_ciphers(const int **nids) 29 static int cryptodev_usable_ciphers(const int **nids)
33 { 30 {
34- return (get_cryptodev_ciphers(nids)); 31- return (get_cryptodev_ciphers(nids));
35+ int i, count; 32+ int i, count;
36+ 33+
37+ count = get_cryptodev_ciphers(nids); 34+ count = get_cryptodev_ciphers(nids);
38+ /* add ciphers specific to cryptodev if found in kernel */ 35+ /* add ciphers specific to cryptodev if found in kernel */
39+ for(i = 0; i < count; i++) { 36+ for (i = 0; i < count; i++) {
40+ switch (*(*nids + i)) { 37+ switch (*(*nids + i)) {
41+ case NID_aes_128_cbc_hmac_sha1: 38+ case NID_aes_128_cbc_hmac_sha1:
42+ EVP_add_cipher(&cryptodev_aes_128_cbc_hmac_sha1); 39+ EVP_add_cipher(&cryptodev_aes_128_cbc_hmac_sha1);
43+ break; 40+ break;
44+ case NID_aes_256_cbc_hmac_sha1: 41+ case NID_aes_256_cbc_hmac_sha1:
45+ EVP_add_cipher(&cryptodev_aes_256_cbc_hmac_sha1); 42+ EVP_add_cipher(&cryptodev_aes_256_cbc_hmac_sha1);
46+ break; 43+ break;
47+ } 44+ }
48+ } 45+ }
49+ return count; 46+ return count;
50 } 47 }
51 48
52 static int 49 static int cryptodev_usable_digests(const int **nids)
53@@ -1582,8 +1598,6 @@ ENGINE_load_cryptodev(void) 50@@ -1674,8 +1690,6 @@ void ENGINE_load_cryptodev(void)
54 } 51 }
55 put_dev_crypto(fd); 52 put_dev_crypto(fd);
56 53
57- EVP_add_cipher(&cryptodev_aes_128_cbc_hmac_sha1); 54- EVP_add_cipher(&cryptodev_aes_128_cbc_hmac_sha1);
58- EVP_add_cipher(&cryptodev_aes_256_cbc_hmac_sha1); 55- EVP_add_cipher(&cryptodev_aes_256_cbc_hmac_sha1);
59 if (!ENGINE_set_id(engine, "cryptodev") || 56 if (!ENGINE_set_id(engine, "cryptodev") ||
60 !ENGINE_set_name(engine, "BSD cryptodev engine") || 57 !ENGINE_set_name(engine, "BSD cryptodev engine") ||
61 !ENGINE_set_ciphers(engine, cryptodev_engine_ciphers) || 58 !ENGINE_set_ciphers(engine, cryptodev_engine_ciphers) ||
62-- 59--
632.3.5 602.7.0
64 61