diff options
Diffstat (limited to 'recipes-connectivity/openssl/openssl-qoriq/qoriq/0010-Removed-local-copy-of-curve_t-type.patch')
-rw-r--r-- | recipes-connectivity/openssl/openssl-qoriq/qoriq/0010-Removed-local-copy-of-curve_t-type.patch | 163 |
1 files changed, 163 insertions, 0 deletions
diff --git a/recipes-connectivity/openssl/openssl-qoriq/qoriq/0010-Removed-local-copy-of-curve_t-type.patch b/recipes-connectivity/openssl/openssl-qoriq/qoriq/0010-Removed-local-copy-of-curve_t-type.patch new file mode 100644 index 0000000..8908d54 --- /dev/null +++ b/recipes-connectivity/openssl/openssl-qoriq/qoriq/0010-Removed-local-copy-of-curve_t-type.patch | |||
@@ -0,0 +1,163 @@ | |||
1 | From cd80be25a3da28d23dfcb2762252b413879eaa74 Mon Sep 17 00:00:00 2001 | ||
2 | From: Yashpal Dutta <yashpal.dutta@freescale.com> | ||
3 | Date: Thu, 17 Apr 2014 06:57:59 +0545 | ||
4 | Subject: [PATCH 10/48] Removed local copy of curve_t type | ||
5 | |||
6 | Upstream-status: Pending | ||
7 | |||
8 | Signed-off-by: Yashpal Dutta <yashpal.dutta@freescale.com> | ||
9 | Tested-by: Cristian Stoica <cristian.stoica@freescale.com> | ||
10 | --- | ||
11 | crypto/engine/eng_cryptodev.c | 33 ++++++++++++++------------------- | ||
12 | crypto/engine/eng_cryptodev_ec.h | 7 ------- | ||
13 | 2 files changed, 14 insertions(+), 26 deletions(-) | ||
14 | |||
15 | diff --git a/crypto/engine/eng_cryptodev.c b/crypto/engine/eng_cryptodev.c | ||
16 | index eac5fb6..151774c 100644 | ||
17 | --- a/crypto/engine/eng_cryptodev.c | ||
18 | +++ b/crypto/engine/eng_cryptodev.c | ||
19 | @@ -2504,11 +2504,6 @@ static ECDSA_METHOD cryptodev_ecdsa = { | ||
20 | NULL /* app_data */ | ||
21 | }; | ||
22 | |||
23 | -typedef enum ec_curve_s { | ||
24 | - EC_PRIME, | ||
25 | - EC_BINARY | ||
26 | -} ec_curve_t; | ||
27 | - | ||
28 | /* ENGINE handler for ECDSA Sign */ | ||
29 | static ECDSA_SIG *cryptodev_ecdsa_do_sign(const unsigned char *dgst, | ||
30 | int dgst_len, const BIGNUM *in_kinv, | ||
31 | @@ -2527,7 +2522,7 @@ static ECDSA_SIG *cryptodev_ecdsa_do_sign(const unsigned char *dgst, | ||
32 | const BIGNUM *order = NULL, *priv_key = NULL; | ||
33 | const EC_GROUP *group = NULL; | ||
34 | struct crypt_kop kop; | ||
35 | - ec_curve_t ec_crv = EC_PRIME; | ||
36 | + enum ec_curve_t ec_crv = EC_PRIME; | ||
37 | |||
38 | memset(&kop, 0, sizeof(kop)); | ||
39 | ecdsa = ecdsa_check(eckey); | ||
40 | @@ -2665,7 +2660,7 @@ static ECDSA_SIG *cryptodev_ecdsa_do_sign(const unsigned char *dgst, | ||
41 | else | ||
42 | goto err; | ||
43 | } | ||
44 | - kop.curve_type = ECC_BINARY; | ||
45 | + kop.curve_type = EC_BINARY; | ||
46 | } | ||
47 | |||
48 | /* Calculation of Generator point */ | ||
49 | @@ -2760,7 +2755,7 @@ static int cryptodev_ecdsa_verify(const unsigned char *dgst, int dgst_len, | ||
50 | const EC_POINT *pub_key = NULL; | ||
51 | const BIGNUM *order = NULL; | ||
52 | const EC_GROUP *group = NULL; | ||
53 | - ec_curve_t ec_crv = EC_PRIME; | ||
54 | + enum ec_curve_t ec_crv = EC_PRIME; | ||
55 | struct crypt_kop kop; | ||
56 | |||
57 | memset(&kop, 0, sizeof kop); | ||
58 | @@ -2911,7 +2906,7 @@ static int cryptodev_ecdsa_verify(const unsigned char *dgst, int dgst_len, | ||
59 | else | ||
60 | goto err; | ||
61 | } | ||
62 | - kop.curve_type = ECC_BINARY; | ||
63 | + kop.curve_type = EC_BINARY; | ||
64 | } | ||
65 | |||
66 | /* Calculation of Generator point */ | ||
67 | @@ -3016,7 +3011,7 @@ static int cryptodev_ecdsa_do_sign_async(const unsigned char *dgst, | ||
68 | const BIGNUM *order = NULL, *priv_key = NULL; | ||
69 | const EC_GROUP *group = NULL; | ||
70 | struct crypt_kop *kop = malloc(sizeof(struct crypt_kop)); | ||
71 | - ec_curve_t ec_crv = EC_PRIME; | ||
72 | + enum ec_curve_t ec_crv = EC_PRIME; | ||
73 | |||
74 | if (!(sig->r = BN_new()) || !kop) | ||
75 | goto err; | ||
76 | @@ -3157,7 +3152,7 @@ static int cryptodev_ecdsa_do_sign_async(const unsigned char *dgst, | ||
77 | else | ||
78 | goto err; | ||
79 | } | ||
80 | - kop->curve_type = ECC_BINARY; | ||
81 | + kop->curve_type = EC_BINARY; | ||
82 | } | ||
83 | |||
84 | /* Calculation of Generator point */ | ||
85 | @@ -3237,7 +3232,7 @@ static int cryptodev_ecdsa_verify_async(const unsigned char *dgst, | ||
86 | const EC_POINT *pub_key = NULL; | ||
87 | const BIGNUM *order = NULL; | ||
88 | const EC_GROUP *group = NULL; | ||
89 | - ec_curve_t ec_crv = EC_PRIME; | ||
90 | + enum ec_curve_t ec_crv = EC_PRIME; | ||
91 | struct crypt_kop *kop = malloc(sizeof(struct crypt_kop)); | ||
92 | |||
93 | if (!kop) | ||
94 | @@ -3384,7 +3379,7 @@ static int cryptodev_ecdsa_verify_async(const unsigned char *dgst, | ||
95 | if (ec_crv == EC_BINARY) { | ||
96 | /* copy b' i.e c(b), instead of only b */ | ||
97 | eng_ec_get_cparam(EC_GROUP_get_curve_name(group), ab + q_len, q_len); | ||
98 | - kop->curve_type = ECC_BINARY; | ||
99 | + kop->curve_type = EC_BINARY; | ||
100 | } | ||
101 | |||
102 | /* Calculation of Generator point */ | ||
103 | @@ -3690,7 +3685,7 @@ int cryptodev_ecdh_compute_key(void *out, size_t outlen, | ||
104 | void *(*KDF) (const void *in, size_t inlen, | ||
105 | void *out, size_t *outlen)) | ||
106 | { | ||
107 | - ec_curve_t ec_crv = EC_PRIME; | ||
108 | + enum ec_curve_t ec_crv = EC_PRIME; | ||
109 | unsigned char *q = NULL, *w_xy = NULL, *ab = NULL, *s = NULL, *r = NULL; | ||
110 | BIGNUM *w_x = NULL, *w_y = NULL; | ||
111 | int q_len = 0, ab_len = 0, pub_key_len = 0, r_len = 0, priv_key_len = 0; | ||
112 | @@ -3820,9 +3815,9 @@ int cryptodev_ecdh_compute_key(void *out, size_t outlen, | ||
113 | else | ||
114 | goto err; | ||
115 | } | ||
116 | - kop.curve_type = ECC_BINARY; | ||
117 | + kop.curve_type = EC_BINARY; | ||
118 | } else | ||
119 | - kop.curve_type = ECC_PRIME; | ||
120 | + kop.curve_type = EC_PRIME; | ||
121 | |||
122 | priv_key_len = r_len; | ||
123 | |||
124 | @@ -3874,7 +3869,7 @@ int cryptodev_ecdh_compute_key_async(void *out, size_t outlen, | ||
125 | size_t *outlen), | ||
126 | struct pkc_cookie_s *cookie) | ||
127 | { | ||
128 | - ec_curve_t ec_crv = EC_PRIME; | ||
129 | + enum ec_curve_t ec_crv = EC_PRIME; | ||
130 | unsigned char *q = NULL, *w_xy = NULL, *ab = NULL, *s = NULL, *r = NULL; | ||
131 | BIGNUM *w_x = NULL, *w_y = NULL; | ||
132 | int q_len = 0, ab_len = 0, pub_key_len = 0, r_len = 0, priv_key_len = 0; | ||
133 | @@ -4005,9 +4000,9 @@ int cryptodev_ecdh_compute_key_async(void *out, size_t outlen, | ||
134 | else | ||
135 | goto err; | ||
136 | } | ||
137 | - kop->curve_type = ECC_BINARY; | ||
138 | + kop->curve_type = EC_BINARY; | ||
139 | } else | ||
140 | - kop->curve_type = ECC_PRIME; | ||
141 | + kop->curve_type = EC_PRIME; | ||
142 | |||
143 | priv_key_len = r_len; | ||
144 | |||
145 | diff --git a/crypto/engine/eng_cryptodev_ec.h b/crypto/engine/eng_cryptodev_ec.h | ||
146 | index af54c51..41a8702 100644 | ||
147 | --- a/crypto/engine/eng_cryptodev_ec.h | ||
148 | +++ b/crypto/engine/eng_cryptodev_ec.h | ||
149 | @@ -287,11 +287,4 @@ static inline unsigned char *eng_copy_curve_points(BIGNUM * x, BIGNUM * y, | ||
150 | |||
151 | return xy; | ||
152 | } | ||
153 | - | ||
154 | -enum curve_t { | ||
155 | - DISCRETE_LOG, | ||
156 | - ECC_PRIME, | ||
157 | - ECC_BINARY, | ||
158 | - MAX_ECC_TYPE | ||
159 | -}; | ||
160 | #endif | ||
161 | -- | ||
162 | 2.7.0 | ||
163 | |||