aboutsummaryrefslogtreecommitdiffstats
path: root/meta-fsl-ppc/recipes-connectivity/openssl/openssl-fsl/0013-Removed-local-copy-of-curve_t-type.patch
blob: c9d8ace865b024a55c2c38c6e124f839648c2241 (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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
From 6aaa306cdf878250d7b6eaf30978de313653886b Mon Sep 17 00:00:00 2001
From: Yashpal Dutta <yashpal.dutta@freescale.com>
Date: Thu, 17 Apr 2014 06:57:59 +0545
Subject: [PATCH 13/26] Removed local copy of curve_t type

Upstream-status: Pending

Signed-off-by: Yashpal Dutta <yashpal.dutta@freescale.com>
Tested-by: Cristian Stoica <cristian.stoica@freescale.com>
---
 crypto/engine/eng_cryptodev.c    | 34 ++++++++++++++--------------------
 crypto/engine/eng_cryptodev_ec.h |  7 -------
 2 files changed, 14 insertions(+), 27 deletions(-)

diff --git a/crypto/engine/eng_cryptodev.c b/crypto/engine/eng_cryptodev.c
index ed5f20f..5d883fa 100644
--- a/crypto/engine/eng_cryptodev.c
+++ b/crypto/engine/eng_cryptodev.c
@@ -2398,12 +2398,6 @@ static ECDSA_METHOD cryptodev_ecdsa = {
 	NULL	/* app_data */
 };
 
-typedef enum ec_curve_s
-{
-	EC_PRIME,
-	EC_BINARY
-} ec_curve_t;
-
 /* ENGINE handler for ECDSA Sign */
 static ECDSA_SIG *cryptodev_ecdsa_do_sign( const unsigned char  *dgst,
 	int dgst_len, const BIGNUM *in_kinv, const BIGNUM *in_r, EC_KEY *eckey)
@@ -2420,7 +2414,7 @@ static ECDSA_SIG *cryptodev_ecdsa_do_sign( const unsigned char  *dgst,
 	const BIGNUM   *order = NULL, *priv_key=NULL;
 	const EC_GROUP *group = NULL;
 	struct crypt_kop kop;
-	ec_curve_t ec_crv = EC_PRIME;
+	enum ec_curve_t ec_crv = EC_PRIME;
 
 	memset(&kop, 0, sizeof(kop));
 	ecdsa = ecdsa_check(eckey);
@@ -2553,7 +2547,7 @@ static ECDSA_SIG *cryptodev_ecdsa_do_sign( const unsigned char  *dgst,
 			else
 				goto err;
 		}
-		kop.curve_type = ECC_BINARY;
+		kop.curve_type = EC_BINARY;
 	}
 
 	/* Calculation of Generator point */
@@ -2647,7 +2641,7 @@ static int cryptodev_ecdsa_verify(const unsigned char *dgst, int dgst_len,
 	const EC_POINT *pub_key = NULL;
 	const BIGNUM   *order = NULL;
 	const EC_GROUP *group=NULL;
-	ec_curve_t       ec_crv = EC_PRIME;
+	enum ec_curve_t       ec_crv = EC_PRIME;
 	struct crypt_kop kop;
 
 	memset(&kop, 0, sizeof kop);
@@ -2792,7 +2786,7 @@ static int cryptodev_ecdsa_verify(const unsigned char *dgst, int dgst_len,
 			else
 				goto err;
 		}
-		kop.curve_type = ECC_BINARY;
+		kop.curve_type = EC_BINARY;
 	}
 
 	/* Calculation of Generator point */
@@ -2893,7 +2887,7 @@ static int cryptodev_ecdsa_do_sign_async( const unsigned char  *dgst,
 	const BIGNUM   *order = NULL, *priv_key=NULL;
 	const EC_GROUP *group = NULL;
 	struct crypt_kop *kop = malloc(sizeof(struct crypt_kop));
-	ec_curve_t ec_crv = EC_PRIME;
+	enum ec_curve_t ec_crv = EC_PRIME;
 
 	if (!(sig->r = BN_new()) || !kop)
 		goto err;
@@ -3029,7 +3023,7 @@ static int cryptodev_ecdsa_do_sign_async( const unsigned char  *dgst,
 			else
 				goto err;
 		}
-		kop->curve_type = ECC_BINARY;
+		kop->curve_type = EC_BINARY;
 	}
 
 	/* Calculation of Generator point */
@@ -3105,7 +3099,7 @@ static int cryptodev_ecdsa_verify_async(const unsigned char *dgst, int dgst_len,
 	const EC_POINT *pub_key = NULL;
 	const BIGNUM   *order = NULL;
 	const EC_GROUP *group=NULL;
-	ec_curve_t       ec_crv = EC_PRIME;
+	enum ec_curve_t       ec_crv = EC_PRIME;
 	struct crypt_kop *kop = malloc(sizeof(struct crypt_kop));
 
 	if (!kop)
@@ -3247,7 +3241,7 @@ static int cryptodev_ecdsa_verify_async(const unsigned char *dgst, int dgst_len,
 		/* copy b' i.e c(b), instead of only b */
 		eng_ec_get_cparam (EC_GROUP_get_curve_name(group),
 			ab+q_len, q_len);
-		kop->curve_type = ECC_BINARY;
+		kop->curve_type = EC_BINARY;
 	}
 
 	/* Calculation of Generator point */
@@ -3552,7 +3546,7 @@ int cryptodev_ecdh_compute_key(void *out, size_t outlen,
 	const EC_POINT *pub_key, EC_KEY *ecdh, void *(*KDF)(const void *in, size_t inlen,
 	void *out, size_t *outlen))
 {
-	ec_curve_t       ec_crv = EC_PRIME;
+	enum ec_curve_t       ec_crv = EC_PRIME;
 	unsigned char * q = NULL, *w_xy = NULL, *ab = NULL, *s = NULL, *r = NULL;
 	BIGNUM         * w_x = NULL, *w_y = NULL;
 	int q_len = 0, ab_len = 0, pub_key_len = 0, r_len = 0, priv_key_len = 0;
@@ -3678,9 +3672,9 @@ int cryptodev_ecdh_compute_key(void *out, size_t outlen,
 			else
 				goto err;
 		}
-		kop.curve_type = ECC_BINARY;
+		kop.curve_type = EC_BINARY;
 	} else
-		kop.curve_type = ECC_PRIME;
+		kop.curve_type = EC_PRIME;
 
 	priv_key_len = r_len;
 
@@ -3729,7 +3723,7 @@ int cryptodev_ecdh_compute_key_async(void *out, size_t outlen,
 	const EC_POINT *pub_key, EC_KEY *ecdh, void *(*KDF)(const void *in, size_t inlen,
 	void *out, size_t *outlen), struct pkc_cookie_s *cookie)
 {
-	ec_curve_t       ec_crv = EC_PRIME;
+	enum ec_curve_t       ec_crv = EC_PRIME;
 	unsigned char * q = NULL, *w_xy = NULL, *ab = NULL, *s = NULL, *r = NULL;
 	BIGNUM         * w_x = NULL, *w_y = NULL;
 	int q_len = 0, ab_len = 0, pub_key_len = 0, r_len = 0, priv_key_len = 0;
@@ -3857,9 +3851,9 @@ int cryptodev_ecdh_compute_key_async(void *out, size_t outlen,
 			else
 				goto err;
 		}
-		kop->curve_type = ECC_BINARY;
+		kop->curve_type = EC_BINARY;
 	} else
-		kop->curve_type = ECC_PRIME;
+		kop->curve_type = EC_PRIME;
 
 	priv_key_len = r_len;
 
diff --git a/crypto/engine/eng_cryptodev_ec.h b/crypto/engine/eng_cryptodev_ec.h
index 77aee71..a4b8da5 100644
--- a/crypto/engine/eng_cryptodev_ec.h
+++ b/crypto/engine/eng_cryptodev_ec.h
@@ -286,11 +286,4 @@ static inline unsigned char *eng_copy_curve_points(BIGNUM * x, BIGNUM * y,
 
 	return xy;
 }
-
-enum curve_t {
-	DISCRETE_LOG,
-	ECC_PRIME,
-	ECC_BINARY,
-	MAX_ECC_TYPE
-};
 #endif
-- 
2.3.5