Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/rsa/rsa_meth.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | RSA_METHOD *RSA_meth_new(const char *name, int flags) | - | ||||||
3 | { | - | ||||||
4 | RSA_METHOD *meth = CRYPTO_zalloc(sizeof(*meth), __FILE__, 16); | - | ||||||
5 | - | |||||||
6 | if (meth !=
| 0 | ||||||
7 | ((void *)0)
| 0 | ||||||
8 | ) { | - | ||||||
9 | meth->flags = flags; | - | ||||||
10 | - | |||||||
11 | meth->name = CRYPTO_strdup(name, __FILE__, 21); | - | ||||||
12 | if (meth->name !=
| 0 | ||||||
13 | ((void *)0)
| 0 | ||||||
14 | ) | - | ||||||
15 | return never executed: meth;return meth; never executed: return meth; | 0 | ||||||
16 | - | |||||||
17 | CRYPTO_free(meth, __FILE__, 25); | - | ||||||
18 | } never executed: end of block | 0 | ||||||
19 | - | |||||||
20 | ERR_put_error(4,(162),((1|64)),__FILE__,28); | - | ||||||
21 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||
22 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||
23 | ; never executed: return ((void *)0) ; | 0 | ||||||
24 | } | - | ||||||
25 | - | |||||||
26 | void RSA_meth_free(RSA_METHOD *meth) | - | ||||||
27 | { | - | ||||||
28 | if (meth !=
| 0 | ||||||
29 | ((void *)0)
| 0 | ||||||
30 | ) { | - | ||||||
31 | CRYPTO_free(meth->name, __FILE__, 35); | - | ||||||
32 | CRYPTO_free(meth, __FILE__, 36); | - | ||||||
33 | } never executed: end of block | 0 | ||||||
34 | } never executed: end of block | 0 | ||||||
35 | - | |||||||
36 | RSA_METHOD *RSA_meth_dup(const RSA_METHOD *meth) | - | ||||||
37 | { | - | ||||||
38 | RSA_METHOD *ret = CRYPTO_malloc(sizeof(*ret), __FILE__, 42); | - | ||||||
39 | - | |||||||
40 | if (ret !=
| 0 | ||||||
41 | ((void *)0)
| 0 | ||||||
42 | ) { | - | ||||||
43 | memcpy(ret, meth, sizeof(*meth)); | - | ||||||
44 | - | |||||||
45 | ret->name = CRYPTO_strdup(meth->name, __FILE__, 47); | - | ||||||
46 | if (ret->name !=
| 0 | ||||||
47 | ((void *)0)
| 0 | ||||||
48 | ) | - | ||||||
49 | return never executed: ret;return ret; never executed: return ret; | 0 | ||||||
50 | - | |||||||
51 | CRYPTO_free(ret, __FILE__, 51); | - | ||||||
52 | } never executed: end of block | 0 | ||||||
53 | - | |||||||
54 | ERR_put_error(4,(161),((1|64)),__FILE__,54); | - | ||||||
55 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||
56 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||
57 | ; never executed: return ((void *)0) ; | 0 | ||||||
58 | } | - | ||||||
59 | - | |||||||
60 | const char *RSA_meth_get0_name(const RSA_METHOD *meth) | - | ||||||
61 | { | - | ||||||
62 | return never executed: meth->name;return meth->name; never executed: return meth->name; | 0 | ||||||
63 | } | - | ||||||
64 | - | |||||||
65 | int RSA_meth_set1_name(RSA_METHOD *meth, const char *name) | - | ||||||
66 | { | - | ||||||
67 | char *tmpname = CRYPTO_strdup(name, __FILE__, 65); | - | ||||||
68 | - | |||||||
69 | if (tmpname ==
| 0 | ||||||
70 | ((void *)0)
| 0 | ||||||
71 | ) { | - | ||||||
72 | ERR_put_error(4,(163),((1|64)),__FILE__,68); | - | ||||||
73 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||
74 | } | - | ||||||
75 | - | |||||||
76 | CRYPTO_free(meth->name, __FILE__, 72); | - | ||||||
77 | meth->name = tmpname; | - | ||||||
78 | - | |||||||
79 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||
80 | } | - | ||||||
81 | - | |||||||
82 | int RSA_meth_get_flags(const RSA_METHOD *meth) | - | ||||||
83 | { | - | ||||||
84 | return never executed: meth->flags;return meth->flags; never executed: return meth->flags; | 0 | ||||||
85 | } | - | ||||||
86 | - | |||||||
87 | int RSA_meth_set_flags(RSA_METHOD *meth, int flags) | - | ||||||
88 | { | - | ||||||
89 | meth->flags = flags; | - | ||||||
90 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||
91 | } | - | ||||||
92 | - | |||||||
93 | void *RSA_meth_get0_app_data(const RSA_METHOD *meth) | - | ||||||
94 | { | - | ||||||
95 | return never executed: meth->app_data;return meth->app_data; never executed: return meth->app_data; | 0 | ||||||
96 | } | - | ||||||
97 | - | |||||||
98 | int RSA_meth_set0_app_data(RSA_METHOD *meth, void *app_data) | - | ||||||
99 | { | - | ||||||
100 | meth->app_data = app_data; | - | ||||||
101 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||
102 | } | - | ||||||
103 | - | |||||||
104 | int (*RSA_meth_get_pub_enc(const RSA_METHOD *meth)) | - | ||||||
105 | (int flen, const unsigned char *from, | - | ||||||
106 | unsigned char *to, RSA *rsa, int padding) | - | ||||||
107 | { | - | ||||||
108 | return never executed: meth->rsa_pub_enc;return meth->rsa_pub_enc; never executed: return meth->rsa_pub_enc; | 0 | ||||||
109 | } | - | ||||||
110 | - | |||||||
111 | int RSA_meth_set_pub_enc(RSA_METHOD *meth, | - | ||||||
112 | int (*pub_enc) (int flen, const unsigned char *from, | - | ||||||
113 | unsigned char *to, RSA *rsa, | - | ||||||
114 | int padding)) | - | ||||||
115 | { | - | ||||||
116 | meth->rsa_pub_enc = pub_enc; | - | ||||||
117 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||
118 | } | - | ||||||
119 | - | |||||||
120 | int (*RSA_meth_get_pub_dec(const RSA_METHOD *meth)) | - | ||||||
121 | (int flen, const unsigned char *from, | - | ||||||
122 | unsigned char *to, RSA *rsa, int padding) | - | ||||||
123 | { | - | ||||||
124 | return never executed: meth->rsa_pub_dec;return meth->rsa_pub_dec; never executed: return meth->rsa_pub_dec; | 0 | ||||||
125 | } | - | ||||||
126 | - | |||||||
127 | int RSA_meth_set_pub_dec(RSA_METHOD *meth, | - | ||||||
128 | int (*pub_dec) (int flen, const unsigned char *from, | - | ||||||
129 | unsigned char *to, RSA *rsa, | - | ||||||
130 | int padding)) | - | ||||||
131 | { | - | ||||||
132 | meth->rsa_pub_dec = pub_dec; | - | ||||||
133 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||
134 | } | - | ||||||
135 | - | |||||||
136 | int (*RSA_meth_get_priv_enc(const RSA_METHOD *meth)) | - | ||||||
137 | (int flen, const unsigned char *from, | - | ||||||
138 | unsigned char *to, RSA *rsa, int padding) | - | ||||||
139 | { | - | ||||||
140 | return never executed: meth->rsa_priv_enc;return meth->rsa_priv_enc; never executed: return meth->rsa_priv_enc; | 0 | ||||||
141 | } | - | ||||||
142 | - | |||||||
143 | int RSA_meth_set_priv_enc(RSA_METHOD *meth, | - | ||||||
144 | int (*priv_enc) (int flen, const unsigned char *from, | - | ||||||
145 | unsigned char *to, RSA *rsa, | - | ||||||
146 | int padding)) | - | ||||||
147 | { | - | ||||||
148 | meth->rsa_priv_enc = priv_enc; | - | ||||||
149 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||
150 | } | - | ||||||
151 | - | |||||||
152 | int (*RSA_meth_get_priv_dec(const RSA_METHOD *meth)) | - | ||||||
153 | (int flen, const unsigned char *from, | - | ||||||
154 | unsigned char *to, RSA *rsa, int padding) | - | ||||||
155 | { | - | ||||||
156 | return never executed: meth->rsa_priv_dec;return meth->rsa_priv_dec; never executed: return meth->rsa_priv_dec; | 0 | ||||||
157 | } | - | ||||||
158 | - | |||||||
159 | int RSA_meth_set_priv_dec(RSA_METHOD *meth, | - | ||||||
160 | int (*priv_dec) (int flen, const unsigned char *from, | - | ||||||
161 | unsigned char *to, RSA *rsa, | - | ||||||
162 | int padding)) | - | ||||||
163 | { | - | ||||||
164 | meth->rsa_priv_dec = priv_dec; | - | ||||||
165 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||
166 | } | - | ||||||
167 | - | |||||||
168 | - | |||||||
169 | int (*RSA_meth_get_mod_exp(const RSA_METHOD *meth)) | - | ||||||
170 | (BIGNUM *r0, const BIGNUM *i, RSA *rsa, BN_CTX *ctx) | - | ||||||
171 | { | - | ||||||
172 | return never executed: meth->rsa_mod_exp;return meth->rsa_mod_exp; never executed: return meth->rsa_mod_exp; | 0 | ||||||
173 | } | - | ||||||
174 | - | |||||||
175 | int RSA_meth_set_mod_exp(RSA_METHOD *meth, | - | ||||||
176 | int (*mod_exp) (BIGNUM *r0, const BIGNUM *i, RSA *rsa, | - | ||||||
177 | BN_CTX *ctx)) | - | ||||||
178 | { | - | ||||||
179 | meth->rsa_mod_exp = mod_exp; | - | ||||||
180 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||
181 | } | - | ||||||
182 | - | |||||||
183 | - | |||||||
184 | int (*RSA_meth_get_bn_mod_exp(const RSA_METHOD *meth)) | - | ||||||
185 | (BIGNUM *r, const BIGNUM *a, const BIGNUM *p, | - | ||||||
186 | const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx) | - | ||||||
187 | { | - | ||||||
188 | return never executed: meth->bn_mod_exp;return meth->bn_mod_exp; never executed: return meth->bn_mod_exp; | 0 | ||||||
189 | } | - | ||||||
190 | - | |||||||
191 | int RSA_meth_set_bn_mod_exp(RSA_METHOD *meth, | - | ||||||
192 | int (*bn_mod_exp) (BIGNUM *r, | - | ||||||
193 | const BIGNUM *a, | - | ||||||
194 | const BIGNUM *p, | - | ||||||
195 | const BIGNUM *m, | - | ||||||
196 | BN_CTX *ctx, | - | ||||||
197 | BN_MONT_CTX *m_ctx)) | - | ||||||
198 | { | - | ||||||
199 | meth->bn_mod_exp = bn_mod_exp; | - | ||||||
200 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||
201 | } | - | ||||||
202 | - | |||||||
203 | - | |||||||
204 | int (*RSA_meth_get_init(const RSA_METHOD *meth)) (RSA *rsa) | - | ||||||
205 | { | - | ||||||
206 | return never executed: meth->init;return meth->init; never executed: return meth->init; | 0 | ||||||
207 | } | - | ||||||
208 | - | |||||||
209 | int RSA_meth_set_init(RSA_METHOD *meth, int (*init) (RSA *rsa)) | - | ||||||
210 | { | - | ||||||
211 | meth->init = init; | - | ||||||
212 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||
213 | } | - | ||||||
214 | - | |||||||
215 | - | |||||||
216 | int (*RSA_meth_get_finish(const RSA_METHOD *meth)) (RSA *rsa) | - | ||||||
217 | { | - | ||||||
218 | return never executed: meth->finish;return meth->finish; never executed: return meth->finish; | 0 | ||||||
219 | } | - | ||||||
220 | - | |||||||
221 | int RSA_meth_set_finish(RSA_METHOD *meth, int (*finish) (RSA *rsa)) | - | ||||||
222 | { | - | ||||||
223 | meth->finish = finish; | - | ||||||
224 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||
225 | } | - | ||||||
226 | - | |||||||
227 | int (*RSA_meth_get_sign(const RSA_METHOD *meth)) | - | ||||||
228 | (int type, | - | ||||||
229 | const unsigned char *m, unsigned int m_length, | - | ||||||
230 | unsigned char *sigret, unsigned int *siglen, | - | ||||||
231 | const RSA *rsa) | - | ||||||
232 | { | - | ||||||
233 | return never executed: meth->rsa_sign;return meth->rsa_sign; never executed: return meth->rsa_sign; | 0 | ||||||
234 | } | - | ||||||
235 | - | |||||||
236 | int RSA_meth_set_sign(RSA_METHOD *meth, | - | ||||||
237 | int (*sign) (int type, const unsigned char *m, | - | ||||||
238 | unsigned int m_length, | - | ||||||
239 | unsigned char *sigret, unsigned int *siglen, | - | ||||||
240 | const RSA *rsa)) | - | ||||||
241 | { | - | ||||||
242 | meth->rsa_sign = sign; | - | ||||||
243 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||
244 | } | - | ||||||
245 | - | |||||||
246 | int (*RSA_meth_get_verify(const RSA_METHOD *meth)) | - | ||||||
247 | (int dtype, const unsigned char *m, | - | ||||||
248 | unsigned int m_length, const unsigned char *sigbuf, | - | ||||||
249 | unsigned int siglen, const RSA *rsa) | - | ||||||
250 | { | - | ||||||
251 | return never executed: meth->rsa_verify;return meth->rsa_verify; never executed: return meth->rsa_verify; | 0 | ||||||
252 | } | - | ||||||
253 | - | |||||||
254 | int RSA_meth_set_verify(RSA_METHOD *meth, | - | ||||||
255 | int (*verify) (int dtype, const unsigned char *m, | - | ||||||
256 | unsigned int m_length, | - | ||||||
257 | const unsigned char *sigbuf, | - | ||||||
258 | unsigned int siglen, const RSA *rsa)) | - | ||||||
259 | { | - | ||||||
260 | meth->rsa_verify = verify; | - | ||||||
261 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||
262 | } | - | ||||||
263 | - | |||||||
264 | int (*RSA_meth_get_keygen(const RSA_METHOD *meth)) | - | ||||||
265 | (RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb) | - | ||||||
266 | { | - | ||||||
267 | return never executed: meth->rsa_keygen;return meth->rsa_keygen; never executed: return meth->rsa_keygen; | 0 | ||||||
268 | } | - | ||||||
269 | - | |||||||
270 | int RSA_meth_set_keygen(RSA_METHOD *meth, | - | ||||||
271 | int (*keygen) (RSA *rsa, int bits, BIGNUM *e, | - | ||||||
272 | BN_GENCB *cb)) | - | ||||||
273 | { | - | ||||||
274 | meth->rsa_keygen = keygen; | - | ||||||
275 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||
276 | } | - | ||||||
277 | - | |||||||
278 | int (*RSA_meth_get_multi_prime_keygen(const RSA_METHOD *meth)) | - | ||||||
279 | (RSA *rsa, int bits, int primes, BIGNUM *e, BN_GENCB *cb) | - | ||||||
280 | { | - | ||||||
281 | return never executed: meth->rsa_multi_prime_keygen;return meth->rsa_multi_prime_keygen; never executed: return meth->rsa_multi_prime_keygen; | 0 | ||||||
282 | } | - | ||||||
283 | - | |||||||
284 | int RSA_meth_set_multi_prime_keygen(RSA_METHOD *meth, | - | ||||||
285 | int (*keygen) (RSA *rsa, int bits, | - | ||||||
286 | int primes, BIGNUM *e, | - | ||||||
287 | BN_GENCB *cb)) | - | ||||||
288 | { | - | ||||||
289 | meth->rsa_multi_prime_keygen = keygen; | - | ||||||
290 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||
291 | } | - | ||||||
Switch to Source code | Preprocessed file |