aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-connectivity/openssl/openssl-qoriq/qoriq/0040-cryptodev-replace-caddr_t-with-void.patch
blob: 2c61d9b889835096066bc23a1b20abd3b88251b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
From 45429e5ea075867f9219a6fcb233677d062a4451 Mon Sep 17 00:00:00 2001
From: Cristian Stoica <cristian.stoica@nxp.com>
Date: Tue, 9 Feb 2016 11:28:23 +0200
Subject: [PATCH 40/48] cryptodev: replace caddr_t with void *

This avoids warnings such as "pointer targets in assignment differ in
signedness" when compiling the code

Signed-off-by: Cristian Stoica <cristian.stoica@nxp.com>
---
 crypto/engine/eng_cryptodev.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/crypto/engine/eng_cryptodev.c b/crypto/engine/eng_cryptodev.c
index 2791ca3..f172173 100644
--- a/crypto/engine/eng_cryptodev.c
+++ b/crypto/engine/eng_cryptodev.c
@@ -460,8 +460,8 @@ static int get_cryptodev_ciphers(const int **cnids)
         return (0);
     }
     memset(&sess, 0, sizeof(sess));
-    sess.key = (caddr_t) "123456789abcdefghijklmno";
-    sess.mackey = (caddr_t) "123456789ABCDEFGHIJKLMNO";
+    sess.key = (void *)"123456789abcdefghijklmno";
+    sess.mackey = (void *)"123456789ABCDEFGHIJKLMNO";
 
     for (i = 0; ciphers[i].id && count < CRYPTO_ALGORITHM_MAX; i++) {
         if (ciphers[i].nid == NID_undef)
@@ -501,7 +501,7 @@ static int get_cryptodev_digests(const int **cnids)
         return (0);
     }
     memset(&sess, 0, sizeof(sess));
-    sess.mackey = (caddr_t) "123456789abcdefghijklmno";
+    sess.mackey = (void *)"123456789abcdefghijklmno";
     for (i = 0; digests[i].id && count < CRYPTO_ALGORITHM_MAX; i++) {
         if (digests[i].nid == NID_undef)
             continue;
@@ -633,14 +633,14 @@ cryptodev_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
     cryp.ses = sess->ses;
     cryp.flags = 0;
     cryp.len = inl;
-    cryp.src = (caddr_t) in;
-    cryp.dst = (caddr_t) out;
+    cryp.src = (void *)in;
+    cryp.dst = (void *)out;
     cryp.mac = 0;
 
     cryp.op = ctx->encrypt ? COP_ENCRYPT : COP_DECRYPT;
 
     if (ctx->cipher->iv_len) {
-        cryp.iv = (caddr_t) ctx->iv;
+        cryp.iv = (void *)ctx->iv;
         if (!ctx->encrypt) {
             iiv = in + inl - ctx->cipher->iv_len;
             memcpy(save_iv, iiv, ctx->cipher->iv_len);
@@ -701,15 +701,15 @@ static int cryptodev_aead_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
     }
     cryp.ses = sess->ses;
     cryp.len = state->len;
-    cryp.src = (caddr_t) in;
-    cryp.dst = (caddr_t) out;
+    cryp.src = (void *)in;
+    cryp.dst = (void *)out;
     cryp.auth_src = state->aad;
     cryp.auth_len = state->aad_len;
 
     cryp.op = ctx->encrypt ? COP_ENCRYPT : COP_DECRYPT;
 
     if (ctx->cipher->iv_len) {
-        cryp.iv = (caddr_t) ctx->iv;
+        cryp.iv = (void *)ctx->iv;
         if (!ctx->encrypt) {
             iiv = in + len - ctx->cipher->iv_len;
             memcpy(save_iv, iiv, ctx->cipher->iv_len);
@@ -761,7 +761,7 @@ cryptodev_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
     if ((state->d_fd = get_dev_crypto()) < 0)
         return (0);
 
-    sess->key = (caddr_t) key;
+    sess->key = (void *)key;
     sess->keylen = ctx->key_len;
     sess->cipher = cipher;
 
@@ -804,7 +804,7 @@ static int cryptodev_init_aead_key(EVP_CIPHER_CTX *ctx,
 
     memset(sess, 0, sizeof(struct session_op));
 
-    sess->key = (caddr_t) key;
+    sess->key = (void *)key;
     sess->keylen = ctx->key_len;
     sess->cipher = cipher;
 
-- 
2.7.0