diff options
Diffstat (limited to 'recipes-connectivity/openssl/openssl-fsl/0013-Removed-local-copy-of-curve_t-type.patch')
-rw-r--r-- | recipes-connectivity/openssl/openssl-fsl/0013-Removed-local-copy-of-curve_t-type.patch | 164 |
1 files changed, 164 insertions, 0 deletions
diff --git a/recipes-connectivity/openssl/openssl-fsl/0013-Removed-local-copy-of-curve_t-type.patch b/recipes-connectivity/openssl/openssl-fsl/0013-Removed-local-copy-of-curve_t-type.patch new file mode 100644 index 00000000..c9d8ace8 --- /dev/null +++ b/recipes-connectivity/openssl/openssl-fsl/0013-Removed-local-copy-of-curve_t-type.patch | |||
@@ -0,0 +1,164 @@ | |||
1 | From 6aaa306cdf878250d7b6eaf30978de313653886b 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 13/26] 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 | 34 ++++++++++++++-------------------- | ||
12 | crypto/engine/eng_cryptodev_ec.h | 7 ------- | ||
13 | 2 files changed, 14 insertions(+), 27 deletions(-) | ||
14 | |||
15 | diff --git a/crypto/engine/eng_cryptodev.c b/crypto/engine/eng_cryptodev.c | ||
16 | index ed5f20f..5d883fa 100644 | ||
17 | --- a/crypto/engine/eng_cryptodev.c | ||
18 | +++ b/crypto/engine/eng_cryptodev.c | ||
19 | @@ -2398,12 +2398,6 @@ static ECDSA_METHOD cryptodev_ecdsa = { | ||
20 | NULL /* app_data */ | ||
21 | }; | ||
22 | |||
23 | -typedef enum ec_curve_s | ||
24 | -{ | ||
25 | - EC_PRIME, | ||
26 | - EC_BINARY | ||
27 | -} ec_curve_t; | ||
28 | - | ||
29 | /* ENGINE handler for ECDSA Sign */ | ||
30 | static ECDSA_SIG *cryptodev_ecdsa_do_sign( const unsigned char *dgst, | ||
31 | int dgst_len, const BIGNUM *in_kinv, const BIGNUM *in_r, EC_KEY *eckey) | ||
32 | @@ -2420,7 +2414,7 @@ static ECDSA_SIG *cryptodev_ecdsa_do_sign( const unsigned char *dgst, | ||
33 | const BIGNUM *order = NULL, *priv_key=NULL; | ||
34 | const EC_GROUP *group = NULL; | ||
35 | struct crypt_kop kop; | ||
36 | - ec_curve_t ec_crv = EC_PRIME; | ||
37 | + enum ec_curve_t ec_crv = EC_PRIME; | ||
38 | |||
39 | memset(&kop, 0, sizeof(kop)); | ||
40 | ecdsa = ecdsa_check(eckey); | ||
41 | @@ -2553,7 +2547,7 @@ static ECDSA_SIG *cryptodev_ecdsa_do_sign( const unsigned char *dgst, | ||
42 | else | ||
43 | goto err; | ||
44 | } | ||
45 | - kop.curve_type = ECC_BINARY; | ||
46 | + kop.curve_type = EC_BINARY; | ||
47 | } | ||
48 | |||
49 | /* Calculation of Generator point */ | ||
50 | @@ -2647,7 +2641,7 @@ static int cryptodev_ecdsa_verify(const unsigned char *dgst, int dgst_len, | ||
51 | const EC_POINT *pub_key = NULL; | ||
52 | const BIGNUM *order = NULL; | ||
53 | const EC_GROUP *group=NULL; | ||
54 | - ec_curve_t ec_crv = EC_PRIME; | ||
55 | + enum ec_curve_t ec_crv = EC_PRIME; | ||
56 | struct crypt_kop kop; | ||
57 | |||
58 | memset(&kop, 0, sizeof kop); | ||
59 | @@ -2792,7 +2786,7 @@ static int cryptodev_ecdsa_verify(const unsigned char *dgst, int dgst_len, | ||
60 | else | ||
61 | goto err; | ||
62 | } | ||
63 | - kop.curve_type = ECC_BINARY; | ||
64 | + kop.curve_type = EC_BINARY; | ||
65 | } | ||
66 | |||
67 | /* Calculation of Generator point */ | ||
68 | @@ -2893,7 +2887,7 @@ static int cryptodev_ecdsa_do_sign_async( const unsigned char *dgst, | ||
69 | const BIGNUM *order = NULL, *priv_key=NULL; | ||
70 | const EC_GROUP *group = NULL; | ||
71 | struct crypt_kop *kop = malloc(sizeof(struct crypt_kop)); | ||
72 | - ec_curve_t ec_crv = EC_PRIME; | ||
73 | + enum ec_curve_t ec_crv = EC_PRIME; | ||
74 | |||
75 | if (!(sig->r = BN_new()) || !kop) | ||
76 | goto err; | ||
77 | @@ -3029,7 +3023,7 @@ static int cryptodev_ecdsa_do_sign_async( const unsigned char *dgst, | ||
78 | else | ||
79 | goto err; | ||
80 | } | ||
81 | - kop->curve_type = ECC_BINARY; | ||
82 | + kop->curve_type = EC_BINARY; | ||
83 | } | ||
84 | |||
85 | /* Calculation of Generator point */ | ||
86 | @@ -3105,7 +3099,7 @@ static int cryptodev_ecdsa_verify_async(const unsigned char *dgst, int dgst_len, | ||
87 | const EC_POINT *pub_key = NULL; | ||
88 | const BIGNUM *order = NULL; | ||
89 | const EC_GROUP *group=NULL; | ||
90 | - ec_curve_t ec_crv = EC_PRIME; | ||
91 | + enum ec_curve_t ec_crv = EC_PRIME; | ||
92 | struct crypt_kop *kop = malloc(sizeof(struct crypt_kop)); | ||
93 | |||
94 | if (!kop) | ||
95 | @@ -3247,7 +3241,7 @@ static int cryptodev_ecdsa_verify_async(const unsigned char *dgst, int dgst_len, | ||
96 | /* copy b' i.e c(b), instead of only b */ | ||
97 | eng_ec_get_cparam (EC_GROUP_get_curve_name(group), | ||
98 | ab+q_len, q_len); | ||
99 | - kop->curve_type = ECC_BINARY; | ||
100 | + kop->curve_type = EC_BINARY; | ||
101 | } | ||
102 | |||
103 | /* Calculation of Generator point */ | ||
104 | @@ -3552,7 +3546,7 @@ int cryptodev_ecdh_compute_key(void *out, size_t outlen, | ||
105 | const EC_POINT *pub_key, EC_KEY *ecdh, void *(*KDF)(const void *in, size_t inlen, | ||
106 | void *out, size_t *outlen)) | ||
107 | { | ||
108 | - ec_curve_t ec_crv = EC_PRIME; | ||
109 | + enum ec_curve_t ec_crv = EC_PRIME; | ||
110 | unsigned char * q = NULL, *w_xy = NULL, *ab = NULL, *s = NULL, *r = NULL; | ||
111 | BIGNUM * w_x = NULL, *w_y = NULL; | ||
112 | int q_len = 0, ab_len = 0, pub_key_len = 0, r_len = 0, priv_key_len = 0; | ||
113 | @@ -3678,9 +3672,9 @@ int cryptodev_ecdh_compute_key(void *out, size_t outlen, | ||
114 | else | ||
115 | goto err; | ||
116 | } | ||
117 | - kop.curve_type = ECC_BINARY; | ||
118 | + kop.curve_type = EC_BINARY; | ||
119 | } else | ||
120 | - kop.curve_type = ECC_PRIME; | ||
121 | + kop.curve_type = EC_PRIME; | ||
122 | |||
123 | priv_key_len = r_len; | ||
124 | |||
125 | @@ -3729,7 +3723,7 @@ int cryptodev_ecdh_compute_key_async(void *out, size_t outlen, | ||
126 | const EC_POINT *pub_key, EC_KEY *ecdh, void *(*KDF)(const void *in, size_t inlen, | ||
127 | void *out, size_t *outlen), struct pkc_cookie_s *cookie) | ||
128 | { | ||
129 | - ec_curve_t ec_crv = EC_PRIME; | ||
130 | + enum ec_curve_t ec_crv = EC_PRIME; | ||
131 | unsigned char * q = NULL, *w_xy = NULL, *ab = NULL, *s = NULL, *r = NULL; | ||
132 | BIGNUM * w_x = NULL, *w_y = NULL; | ||
133 | int q_len = 0, ab_len = 0, pub_key_len = 0, r_len = 0, priv_key_len = 0; | ||
134 | @@ -3857,9 +3851,9 @@ int cryptodev_ecdh_compute_key_async(void *out, size_t outlen, | ||
135 | else | ||
136 | goto err; | ||
137 | } | ||
138 | - kop->curve_type = ECC_BINARY; | ||
139 | + kop->curve_type = EC_BINARY; | ||
140 | } else | ||
141 | - kop->curve_type = ECC_PRIME; | ||
142 | + kop->curve_type = EC_PRIME; | ||
143 | |||
144 | priv_key_len = r_len; | ||
145 | |||
146 | diff --git a/crypto/engine/eng_cryptodev_ec.h b/crypto/engine/eng_cryptodev_ec.h | ||
147 | index 77aee71..a4b8da5 100644 | ||
148 | --- a/crypto/engine/eng_cryptodev_ec.h | ||
149 | +++ b/crypto/engine/eng_cryptodev_ec.h | ||
150 | @@ -286,11 +286,4 @@ static inline unsigned char *eng_copy_curve_points(BIGNUM * x, BIGNUM * y, | ||
151 | |||
152 | return xy; | ||
153 | } | ||
154 | - | ||
155 | -enum curve_t { | ||
156 | - DISCRETE_LOG, | ||
157 | - ECC_PRIME, | ||
158 | - ECC_BINARY, | ||
159 | - MAX_ECC_TYPE | ||
160 | -}; | ||
161 | #endif | ||
162 | -- | ||
163 | 2.3.5 | ||
164 | |||