Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/libressl/src/crypto/asn1/x_name.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||
2 | - | |||||||||||||||||||
3 | - | |||||||||||||||||||
4 | typedef struct stack_st_X509_NAME_ENTRY STACK_OF_X509_NAME_ENTRY; | - | ||||||||||||||||||
5 | struct stack_st_STACK_OF_X509_NAME_ENTRY { _STACK stack; }; | - | ||||||||||||||||||
6 | - | |||||||||||||||||||
7 | static int x509_name_ex_d2i(ASN1_VALUE **val, const unsigned char **in, | - | ||||||||||||||||||
8 | long len, const ASN1_ITEM *it, int tag, int aclass, char opt, | - | ||||||||||||||||||
9 | ASN1_TLC *ctx); | - | ||||||||||||||||||
10 | - | |||||||||||||||||||
11 | static int x509_name_ex_i2d(ASN1_VALUE **val, unsigned char **out, | - | ||||||||||||||||||
12 | const ASN1_ITEM *it, int tag, int aclass); | - | ||||||||||||||||||
13 | static int x509_name_ex_new(ASN1_VALUE **val, const ASN1_ITEM *it); | - | ||||||||||||||||||
14 | static void x509_name_ex_free(ASN1_VALUE **val, const ASN1_ITEM *it); | - | ||||||||||||||||||
15 | - | |||||||||||||||||||
16 | static int x509_name_encode(X509_NAME *a); | - | ||||||||||||||||||
17 | static int x509_name_canon(X509_NAME *a); | - | ||||||||||||||||||
18 | static int asn1_string_canon(ASN1_STRING *out, ASN1_STRING *in); | - | ||||||||||||||||||
19 | static int i2d_name_canon(struct stack_st_STACK_OF_X509_NAME_ENTRY *intname, | - | ||||||||||||||||||
20 | unsigned char **in); | - | ||||||||||||||||||
21 | - | |||||||||||||||||||
22 | static int x509_name_ex_print(BIO *out, ASN1_VALUE **pval, int indent, | - | ||||||||||||||||||
23 | const char *fname, const ASN1_PCTX *pctx); | - | ||||||||||||||||||
24 | - | |||||||||||||||||||
25 | static const ASN1_TEMPLATE X509_NAME_ENTRY_seq_tt[] = { | - | ||||||||||||||||||
26 | { | - | ||||||||||||||||||
27 | .offset = | - | ||||||||||||||||||
28 | __builtin_offsetof ( | - | ||||||||||||||||||
29 | X509_NAME_ENTRY | - | ||||||||||||||||||
30 | , | - | ||||||||||||||||||
31 | object | - | ||||||||||||||||||
32 | ) | - | ||||||||||||||||||
33 | , | - | ||||||||||||||||||
34 | .field_name = "object", | - | ||||||||||||||||||
35 | .item = &ASN1_OBJECT_it, | - | ||||||||||||||||||
36 | }, | - | ||||||||||||||||||
37 | { | - | ||||||||||||||||||
38 | .offset = | - | ||||||||||||||||||
39 | __builtin_offsetof ( | - | ||||||||||||||||||
40 | X509_NAME_ENTRY | - | ||||||||||||||||||
41 | , | - | ||||||||||||||||||
42 | value | - | ||||||||||||||||||
43 | ) | - | ||||||||||||||||||
44 | , | - | ||||||||||||||||||
45 | .field_name = "value", | - | ||||||||||||||||||
46 | .item = &ASN1_PRINTABLE_it, | - | ||||||||||||||||||
47 | }, | - | ||||||||||||||||||
48 | }; | - | ||||||||||||||||||
49 | - | |||||||||||||||||||
50 | const ASN1_ITEM X509_NAME_ENTRY_it = { | - | ||||||||||||||||||
51 | .itype = 0x1, | - | ||||||||||||||||||
52 | .utype = 16, | - | ||||||||||||||||||
53 | .templates = X509_NAME_ENTRY_seq_tt, | - | ||||||||||||||||||
54 | .tcount = sizeof(X509_NAME_ENTRY_seq_tt) / sizeof(ASN1_TEMPLATE), | - | ||||||||||||||||||
55 | .size = sizeof(X509_NAME_ENTRY), | - | ||||||||||||||||||
56 | .sname = "X509_NAME_ENTRY", | - | ||||||||||||||||||
57 | }; | - | ||||||||||||||||||
58 | - | |||||||||||||||||||
59 | - | |||||||||||||||||||
60 | X509_NAME_ENTRY * | - | ||||||||||||||||||
61 | d2i_X509_NAME_ENTRY(X509_NAME_ENTRY **a, const unsigned char **in, long len) | - | ||||||||||||||||||
62 | { | - | ||||||||||||||||||
63 | return never executed: (X509_NAME_ENTRY *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,return (X509_NAME_ENTRY *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &X509_NAME_ENTRY_it); never executed: return (X509_NAME_ENTRY *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &X509_NAME_ENTRY_it); | 0 | ||||||||||||||||||
64 | &X509_NAME_ENTRY_it); never executed: return (X509_NAME_ENTRY *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &X509_NAME_ENTRY_it); | 0 | ||||||||||||||||||
65 | } | - | ||||||||||||||||||
66 | - | |||||||||||||||||||
67 | int | - | ||||||||||||||||||
68 | i2d_X509_NAME_ENTRY(X509_NAME_ENTRY *a, unsigned char **out) | - | ||||||||||||||||||
69 | { | - | ||||||||||||||||||
70 | return never executed: ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_NAME_ENTRY_it);return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_NAME_ENTRY_it); never executed: return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_NAME_ENTRY_it); | 0 | ||||||||||||||||||
71 | } | - | ||||||||||||||||||
72 | - | |||||||||||||||||||
73 | X509_NAME_ENTRY * | - | ||||||||||||||||||
74 | X509_NAME_ENTRY_new(void) | - | ||||||||||||||||||
75 | { | - | ||||||||||||||||||
76 | return executed 1871 times by 8 tests: (X509_NAME_ENTRY *)ASN1_item_new(&X509_NAME_ENTRY_it);return (X509_NAME_ENTRY *)ASN1_item_new(&X509_NAME_ENTRY_it); Executed by:
executed 1871 times by 8 tests: return (X509_NAME_ENTRY *)ASN1_item_new(&X509_NAME_ENTRY_it); Executed by:
| 1871 | ||||||||||||||||||
77 | } | - | ||||||||||||||||||
78 | - | |||||||||||||||||||
79 | void | - | ||||||||||||||||||
80 | X509_NAME_ENTRY_free(X509_NAME_ENTRY *a) | - | ||||||||||||||||||
81 | { | - | ||||||||||||||||||
82 | ASN1_item_free((ASN1_VALUE *)a, &X509_NAME_ENTRY_it); | - | ||||||||||||||||||
83 | } executed 3664 times by 9 tests: end of block Executed by:
| 3664 | ||||||||||||||||||
84 | - | |||||||||||||||||||
85 | X509_NAME_ENTRY * | - | ||||||||||||||||||
86 | X509_NAME_ENTRY_dup(X509_NAME_ENTRY *x) | - | ||||||||||||||||||
87 | { | - | ||||||||||||||||||
88 | return executed 33 times by 2 tests: ASN1_item_dup(&X509_NAME_ENTRY_it, x);return ASN1_item_dup(&X509_NAME_ENTRY_it, x); Executed by:
executed 33 times by 2 tests: return ASN1_item_dup(&X509_NAME_ENTRY_it, x); Executed by:
| 33 | ||||||||||||||||||
89 | } | - | ||||||||||||||||||
90 | - | |||||||||||||||||||
91 | - | |||||||||||||||||||
92 | - | |||||||||||||||||||
93 | - | |||||||||||||||||||
94 | - | |||||||||||||||||||
95 | static const ASN1_TEMPLATE X509_NAME_ENTRIES_item_tt = { | - | ||||||||||||||||||
96 | .flags = (0x1 << 1), | - | ||||||||||||||||||
97 | .tag = 0, | - | ||||||||||||||||||
98 | .offset = 0, | - | ||||||||||||||||||
99 | .field_name = "RDNS", | - | ||||||||||||||||||
100 | .item = &X509_NAME_ENTRY_it, | - | ||||||||||||||||||
101 | }; | - | ||||||||||||||||||
102 | - | |||||||||||||||||||
103 | const ASN1_ITEM X509_NAME_ENTRIES_it = { | - | ||||||||||||||||||
104 | .itype = 0x0, | - | ||||||||||||||||||
105 | .utype = -1, | - | ||||||||||||||||||
106 | .templates = &X509_NAME_ENTRIES_item_tt, | - | ||||||||||||||||||
107 | .tcount = 0, | - | ||||||||||||||||||
108 | .funcs = | - | ||||||||||||||||||
109 | ((void *)0) | - | ||||||||||||||||||
110 | , | - | ||||||||||||||||||
111 | .size = 0, | - | ||||||||||||||||||
112 | .sname = "X509_NAME_ENTRIES", | - | ||||||||||||||||||
113 | }; | - | ||||||||||||||||||
114 | - | |||||||||||||||||||
115 | static const ASN1_TEMPLATE X509_NAME_INTERNAL_item_tt = { | - | ||||||||||||||||||
116 | .flags = (0x2 << 1), | - | ||||||||||||||||||
117 | .tag = 0, | - | ||||||||||||||||||
118 | .offset = 0, | - | ||||||||||||||||||
119 | .field_name = "Name", | - | ||||||||||||||||||
120 | .item = &X509_NAME_ENTRIES_it, | - | ||||||||||||||||||
121 | }; | - | ||||||||||||||||||
122 | - | |||||||||||||||||||
123 | const ASN1_ITEM X509_NAME_INTERNAL_it = { | - | ||||||||||||||||||
124 | .itype = 0x0, | - | ||||||||||||||||||
125 | .utype = -1, | - | ||||||||||||||||||
126 | .templates = &X509_NAME_INTERNAL_item_tt, | - | ||||||||||||||||||
127 | .tcount = 0, | - | ||||||||||||||||||
128 | .funcs = | - | ||||||||||||||||||
129 | ((void *)0) | - | ||||||||||||||||||
130 | , | - | ||||||||||||||||||
131 | .size = 0, | - | ||||||||||||||||||
132 | .sname = "X509_NAME_INTERNAL", | - | ||||||||||||||||||
133 | }; | - | ||||||||||||||||||
134 | - | |||||||||||||||||||
135 | - | |||||||||||||||||||
136 | - | |||||||||||||||||||
137 | - | |||||||||||||||||||
138 | - | |||||||||||||||||||
139 | - | |||||||||||||||||||
140 | - | |||||||||||||||||||
141 | const ASN1_EXTERN_FUNCS x509_name_ff = { | - | ||||||||||||||||||
142 | - | |||||||||||||||||||
143 | ((void *)0) | - | ||||||||||||||||||
144 | , | - | ||||||||||||||||||
145 | x509_name_ex_new, | - | ||||||||||||||||||
146 | x509_name_ex_free, | - | ||||||||||||||||||
147 | 0, | - | ||||||||||||||||||
148 | x509_name_ex_d2i, | - | ||||||||||||||||||
149 | x509_name_ex_i2d, | - | ||||||||||||||||||
150 | x509_name_ex_print | - | ||||||||||||||||||
151 | }; | - | ||||||||||||||||||
152 | - | |||||||||||||||||||
153 | const ASN1_ITEM X509_NAME_it = { | - | ||||||||||||||||||
154 | .itype = 0x4, | - | ||||||||||||||||||
155 | .utype = 16, | - | ||||||||||||||||||
156 | .templates = | - | ||||||||||||||||||
157 | ((void *)0) | - | ||||||||||||||||||
158 | , | - | ||||||||||||||||||
159 | .tcount = 0, | - | ||||||||||||||||||
160 | .funcs = &x509_name_ff, | - | ||||||||||||||||||
161 | .size = 0, | - | ||||||||||||||||||
162 | .sname = "X509_NAME", | - | ||||||||||||||||||
163 | }; | - | ||||||||||||||||||
164 | - | |||||||||||||||||||
165 | X509_NAME * | - | ||||||||||||||||||
166 | d2i_X509_NAME(X509_NAME **a, const unsigned char **in, long len) | - | ||||||||||||||||||
167 | { | - | ||||||||||||||||||
168 | return never executed: (X509_NAME *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,return (X509_NAME *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &X509_NAME_it); never executed: return (X509_NAME *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &X509_NAME_it); | 0 | ||||||||||||||||||
169 | &X509_NAME_it); never executed: return (X509_NAME *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &X509_NAME_it); | 0 | ||||||||||||||||||
170 | } | - | ||||||||||||||||||
171 | - | |||||||||||||||||||
172 | int | - | ||||||||||||||||||
173 | i2d_X509_NAME(X509_NAME *a, unsigned char **out) | - | ||||||||||||||||||
174 | { | - | ||||||||||||||||||
175 | return never executed: ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_NAME_it);return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_NAME_it); never executed: return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_NAME_it); | 0 | ||||||||||||||||||
176 | } | - | ||||||||||||||||||
177 | - | |||||||||||||||||||
178 | X509_NAME * | - | ||||||||||||||||||
179 | X509_NAME_new(void) | - | ||||||||||||||||||
180 | { | - | ||||||||||||||||||
181 | return executed 25 times by 1 test: (X509_NAME *)ASN1_item_new(&X509_NAME_it);return (X509_NAME *)ASN1_item_new(&X509_NAME_it); Executed by:
executed 25 times by 1 test: return (X509_NAME *)ASN1_item_new(&X509_NAME_it); Executed by:
| 25 | ||||||||||||||||||
182 | } | - | ||||||||||||||||||
183 | - | |||||||||||||||||||
184 | void | - | ||||||||||||||||||
185 | X509_NAME_free(X509_NAME *a) | - | ||||||||||||||||||
186 | { | - | ||||||||||||||||||
187 | ASN1_item_free((ASN1_VALUE *)a, &X509_NAME_it); | - | ||||||||||||||||||
188 | } executed 65 times by 5 tests: end of block Executed by:
| 65 | ||||||||||||||||||
189 | - | |||||||||||||||||||
190 | X509_NAME * | - | ||||||||||||||||||
191 | X509_NAME_dup(X509_NAME *x) | - | ||||||||||||||||||
192 | { | - | ||||||||||||||||||
193 | return executed 32 times by 3 tests: ASN1_item_dup(&X509_NAME_it, x);return ASN1_item_dup(&X509_NAME_it, x); Executed by:
executed 32 times by 3 tests: return ASN1_item_dup(&X509_NAME_it, x); Executed by:
| 32 | ||||||||||||||||||
194 | } | - | ||||||||||||||||||
195 | - | |||||||||||||||||||
196 | static int | - | ||||||||||||||||||
197 | x509_name_ex_new(ASN1_VALUE **val, const ASN1_ITEM *it) | - | ||||||||||||||||||
198 | { | - | ||||||||||||||||||
199 | X509_NAME *ret = | - | ||||||||||||||||||
200 | ((void *)0) | - | ||||||||||||||||||
201 | ; | - | ||||||||||||||||||
202 | - | |||||||||||||||||||
203 | ret = malloc(sizeof(X509_NAME)); | - | ||||||||||||||||||
204 | if (!ret
| 0-1004 | ||||||||||||||||||
205 | goto never executed: memerr;goto memerr; never executed: goto memerr; | 0 | ||||||||||||||||||
206 | if ((
| 0-1004 | ||||||||||||||||||
207 | ((void *)0)
| 0-1004 | ||||||||||||||||||
208 | ) | - | ||||||||||||||||||
209 | goto never executed: memerr;goto memerr; never executed: goto memerr; | 0 | ||||||||||||||||||
210 | if ((
| 0-1004 | ||||||||||||||||||
211 | ((void *)0)
| 0-1004 | ||||||||||||||||||
212 | ) | - | ||||||||||||||||||
213 | goto never executed: memerr;goto memerr; never executed: goto memerr; | 0 | ||||||||||||||||||
214 | ret->canon_enc = | - | ||||||||||||||||||
215 | ((void *)0) | - | ||||||||||||||||||
216 | ; | - | ||||||||||||||||||
217 | ret->canon_enclen = 0; | - | ||||||||||||||||||
218 | ret->modified = 1; | - | ||||||||||||||||||
219 | *val = (ASN1_VALUE *)ret; | - | ||||||||||||||||||
220 | return executed 1004 times by 8 tests: 1;return 1; Executed by:
executed 1004 times by 8 tests: return 1; Executed by:
| 1004 | ||||||||||||||||||
221 | - | |||||||||||||||||||
222 | memerr: | - | ||||||||||||||||||
223 | ERR_put_error(13,(0xfff),((1|64)),__FILE__,260); | - | ||||||||||||||||||
224 | if (ret
| 0 | ||||||||||||||||||
225 | if (ret->entries
| 0 | ||||||||||||||||||
226 | sk_free(((_STACK*) (1 ? (ret->entries) : (struct stack_st_X509_NAME_ENTRY*)0))); never executed: sk_free(((_STACK*) (1 ? (ret->entries) : (struct stack_st_X509_NAME_ENTRY*)0))); | 0 | ||||||||||||||||||
227 | free(ret); | - | ||||||||||||||||||
228 | } never executed: end of block | 0 | ||||||||||||||||||
229 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||
230 | } | - | ||||||||||||||||||
231 | - | |||||||||||||||||||
232 | static void | - | ||||||||||||||||||
233 | x509_name_ex_free(ASN1_VALUE **pval, const ASN1_ITEM *it) | - | ||||||||||||||||||
234 | { | - | ||||||||||||||||||
235 | X509_NAME *a; | - | ||||||||||||||||||
236 | - | |||||||||||||||||||
237 | if (!pval
| 0-991 | ||||||||||||||||||
238 | return; never executed: return; | 0 | ||||||||||||||||||
239 | a = (X509_NAME *)*pval; | - | ||||||||||||||||||
240 | - | |||||||||||||||||||
241 | BUF_MEM_free(a->bytes); | - | ||||||||||||||||||
242 | sk_pop_free(((_STACK*) (1 ? (a->entries) : (struct stack_st_X509_NAME_ENTRY*)0)), ((void (*)(void *)) ((1 ? (X509_NAME_ENTRY_free) : (void (*)(X509_NAME_ENTRY *))0)))); | - | ||||||||||||||||||
243 | free(a->canon_enc); | - | ||||||||||||||||||
244 | free(a); | - | ||||||||||||||||||
245 | *pval = | - | ||||||||||||||||||
246 | ((void *)0) | - | ||||||||||||||||||
247 | ; | - | ||||||||||||||||||
248 | } executed 991 times by 8 tests: end of block Executed by:
| 991 | ||||||||||||||||||
249 | - | |||||||||||||||||||
250 | static int | - | ||||||||||||||||||
251 | x509_name_ex_d2i(ASN1_VALUE **val, const unsigned char **in, long len, | - | ||||||||||||||||||
252 | const ASN1_ITEM *it, int tag, int aclass, char opt, ASN1_TLC *ctx) | - | ||||||||||||||||||
253 | { | - | ||||||||||||||||||
254 | const unsigned char *p = *in, *q; | - | ||||||||||||||||||
255 | union { | - | ||||||||||||||||||
256 | struct stack_st_STACK_OF_X509_NAME_ENTRY *s; | - | ||||||||||||||||||
257 | ASN1_VALUE *a; | - | ||||||||||||||||||
258 | } intname = { | - | ||||||||||||||||||
259 | ((void *)0) | - | ||||||||||||||||||
260 | }; | - | ||||||||||||||||||
261 | union { | - | ||||||||||||||||||
262 | X509_NAME *x; | - | ||||||||||||||||||
263 | ASN1_VALUE *a; | - | ||||||||||||||||||
264 | } nm = { | - | ||||||||||||||||||
265 | ((void *)0) | - | ||||||||||||||||||
266 | }; | - | ||||||||||||||||||
267 | int i, j, ret; | - | ||||||||||||||||||
268 | struct stack_st_X509_NAME_ENTRY *entries; | - | ||||||||||||||||||
269 | X509_NAME_ENTRY *entry; | - | ||||||||||||||||||
270 | q = p; | - | ||||||||||||||||||
271 | - | |||||||||||||||||||
272 | - | |||||||||||||||||||
273 | ret = ASN1_item_ex_d2i(&intname.a, &p, len, | - | ||||||||||||||||||
274 | &X509_NAME_INTERNAL_it, tag, aclass, opt, ctx); | - | ||||||||||||||||||
275 | - | |||||||||||||||||||
276 | if (ret <= 0
| 0-473 | ||||||||||||||||||
277 | return never executed: ret;return ret; never executed: return ret; | 0 | ||||||||||||||||||
278 | - | |||||||||||||||||||
279 | if (*
| 32-441 | ||||||||||||||||||
280 | x509_name_ex_free(val, executed 441 times by 7 tests: x509_name_ex_free(val, ((void *)0) ); Executed by:
| 441 | ||||||||||||||||||
281 | ((void *)0) executed 441 times by 7 tests: x509_name_ex_free(val, ((void *)0) ); Executed by:
| 441 | ||||||||||||||||||
282 | ); executed 441 times by 7 tests: x509_name_ex_free(val, ((void *)0) ); Executed by:
| 441 | ||||||||||||||||||
283 | if (!x509_name_ex_new(&nm.a,
| 0-473 | ||||||||||||||||||
284 | ((void *)0)
| 0-473 | ||||||||||||||||||
285 | )
| 0-473 | ||||||||||||||||||
286 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||
287 | - | |||||||||||||||||||
288 | if (!BUF_MEM_grow(nm.x->bytes, p - q)
| 0-473 | ||||||||||||||||||
289 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||
290 | memcpy(nm.x->bytes->data, q, p - q); | - | ||||||||||||||||||
291 | - | |||||||||||||||||||
292 | - | |||||||||||||||||||
293 | for (i = 0; i < sk_num(((_STACK*) (1 ? (intname.s) : (struct stack_st_STACK_OF_X509_NAME_ENTRY*)0)))
| 473-1805 | ||||||||||||||||||
294 | entries = ((STACK_OF_X509_NAME_ENTRY *)sk_value(((_STACK*) (1 ? (intname.s) : (struct stack_st_STACK_OF_X509_NAME_ENTRY*)0)), (i))); | - | ||||||||||||||||||
295 | for (j = 0; j < sk_num(((_STACK*) (1 ? (entries) : (struct stack_st_X509_NAME_ENTRY*)0)))
| 1805 | ||||||||||||||||||
296 | entry = ((X509_NAME_ENTRY *)sk_value(((_STACK*) (1 ? (entries) : (struct stack_st_X509_NAME_ENTRY*)0)), (j))); | - | ||||||||||||||||||
297 | entry->set = i; | - | ||||||||||||||||||
298 | if (!sk_push(((_STACK*) (1 ? (nm.x->entries) : (struct stack_st_X509_NAME_ENTRY*)0)), ((void*) (1 ? (entry) : (X509_NAME_ENTRY*)0)))
| 0-1805 | ||||||||||||||||||
299 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||
300 | } executed 1805 times by 8 tests: end of block Executed by:
| 1805 | ||||||||||||||||||
301 | sk_free(((_STACK*) (1 ? (entries) : (struct stack_st_X509_NAME_ENTRY*)0))); | - | ||||||||||||||||||
302 | } executed 1805 times by 8 tests: end of block Executed by:
| 1805 | ||||||||||||||||||
303 | sk_free(((_STACK*) (1 ? (intname.s) : (struct stack_st_STACK_OF_X509_NAME_ENTRY*)0))); | - | ||||||||||||||||||
304 | ret = x509_name_canon(nm.x); | - | ||||||||||||||||||
305 | if (!ret
| 0-473 | ||||||||||||||||||
306 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||
307 | nm.x->modified = 0; | - | ||||||||||||||||||
308 | *val = nm.a; | - | ||||||||||||||||||
309 | *in = p; | - | ||||||||||||||||||
310 | return executed 473 times by 8 tests: ret;return ret; Executed by:
executed 473 times by 8 tests: return ret; Executed by:
| 473 | ||||||||||||||||||
311 | - | |||||||||||||||||||
312 | err: | - | ||||||||||||||||||
313 | if (nm.x !=
| 0 | ||||||||||||||||||
314 | ((void *)0)
| 0 | ||||||||||||||||||
315 | ) | - | ||||||||||||||||||
316 | X509_NAME_free(nm.x); never executed: X509_NAME_free(nm.x); | 0 | ||||||||||||||||||
317 | ERR_put_error(13,(0xfff),(58),__FILE__,342); | - | ||||||||||||||||||
318 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||
319 | } | - | ||||||||||||||||||
320 | - | |||||||||||||||||||
321 | static int | - | ||||||||||||||||||
322 | x509_name_ex_i2d(ASN1_VALUE **val, unsigned char **out, const ASN1_ITEM *it, | - | ||||||||||||||||||
323 | int tag, int aclass) | - | ||||||||||||||||||
324 | { | - | ||||||||||||||||||
325 | int ret; | - | ||||||||||||||||||
326 | X509_NAME *a = (X509_NAME *)*val; | - | ||||||||||||||||||
327 | - | |||||||||||||||||||
328 | if (a->modified
| 27-89 | ||||||||||||||||||
329 | ret = x509_name_encode(a); | - | ||||||||||||||||||
330 | if (ret < 0
| 0-27 | ||||||||||||||||||
331 | return never executed: ret;return ret; never executed: return ret; | 0 | ||||||||||||||||||
332 | ret = x509_name_canon(a); | - | ||||||||||||||||||
333 | if (ret < 0
| 0-27 | ||||||||||||||||||
334 | return never executed: ret;return ret; never executed: return ret; | 0 | ||||||||||||||||||
335 | } executed 27 times by 2 tests: end of block Executed by:
| 27 | ||||||||||||||||||
336 | ret = a->bytes->length; | - | ||||||||||||||||||
337 | if (out !=
| 43-73 | ||||||||||||||||||
338 | ((void *)0)
| 43-73 | ||||||||||||||||||
339 | ) { | - | ||||||||||||||||||
340 | memcpy(*out, a->bytes->data, ret); | - | ||||||||||||||||||
341 | *out += ret; | - | ||||||||||||||||||
342 | } executed 43 times by 3 tests: end of block Executed by:
| 43 | ||||||||||||||||||
343 | return executed 116 times by 3 tests: ret;return ret; Executed by:
executed 116 times by 3 tests: return ret; Executed by:
| 116 | ||||||||||||||||||
344 | } | - | ||||||||||||||||||
345 | - | |||||||||||||||||||
346 | static void | - | ||||||||||||||||||
347 | local_sk_X509_NAME_ENTRY_free(struct stack_st_X509_NAME_ENTRY *ne) | - | ||||||||||||||||||
348 | { | - | ||||||||||||||||||
349 | sk_free(((_STACK*) (1 ? (ne) : (struct stack_st_X509_NAME_ENTRY*)0))); | - | ||||||||||||||||||
350 | } executed 33 times by 2 tests: end of block Executed by:
| 33 | ||||||||||||||||||
351 | - | |||||||||||||||||||
352 | static void | - | ||||||||||||||||||
353 | local_sk_X509_NAME_ENTRY_pop_free(struct stack_st_X509_NAME_ENTRY *ne) | - | ||||||||||||||||||
354 | { | - | ||||||||||||||||||
355 | sk_pop_free(((_STACK*) (1 ? (ne) : (struct stack_st_X509_NAME_ENTRY*)0)), ((void (*)(void *)) ((1 ? (X509_NAME_ENTRY_free) : (void (*)(X509_NAME_ENTRY *))0)))); | - | ||||||||||||||||||
356 | } executed 1838 times by 8 tests: end of block Executed by:
| 1838 | ||||||||||||||||||
357 | - | |||||||||||||||||||
358 | static int | - | ||||||||||||||||||
359 | x509_name_encode(X509_NAME *a) | - | ||||||||||||||||||
360 | { | - | ||||||||||||||||||
361 | union { | - | ||||||||||||||||||
362 | struct stack_st_STACK_OF_X509_NAME_ENTRY *s; | - | ||||||||||||||||||
363 | ASN1_VALUE *a; | - | ||||||||||||||||||
364 | } intname = { | - | ||||||||||||||||||
365 | ((void *)0) | - | ||||||||||||||||||
366 | }; | - | ||||||||||||||||||
367 | int len; | - | ||||||||||||||||||
368 | unsigned char *p; | - | ||||||||||||||||||
369 | struct stack_st_X509_NAME_ENTRY *entries = | - | ||||||||||||||||||
370 | ((void *)0) | - | ||||||||||||||||||
371 | ; | - | ||||||||||||||||||
372 | X509_NAME_ENTRY *entry; | - | ||||||||||||||||||
373 | int i, set = -1; | - | ||||||||||||||||||
374 | - | |||||||||||||||||||
375 | intname.s = ((struct stack_st_STACK_OF_X509_NAME_ENTRY *)sk_new_null()); | - | ||||||||||||||||||
376 | if (!intname.s
| 0-27 | ||||||||||||||||||
377 | goto never executed: memerr;goto memerr; never executed: goto memerr; | 0 | ||||||||||||||||||
378 | for (i = 0; i < sk_num(((_STACK*) (1 ? (a->entries) : (struct stack_st_X509_NAME_ENTRY*)0)))
| 27-33 | ||||||||||||||||||
379 | entry = ((X509_NAME_ENTRY *)sk_value(((_STACK*) (1 ? (a->entries) : (struct stack_st_X509_NAME_ENTRY*)0)), (i))); | - | ||||||||||||||||||
380 | if (entry->set != set
| 0-33 | ||||||||||||||||||
381 | entries = ((struct stack_st_X509_NAME_ENTRY *)sk_new_null()); | - | ||||||||||||||||||
382 | if (!entries
| 0-33 | ||||||||||||||||||
383 | goto never executed: memerr;goto memerr; never executed: goto memerr; | 0 | ||||||||||||||||||
384 | if (!sk_push(((_STACK*) (1 ? (intname.s) : (struct stack_st_STACK_OF_X509_NAME_ENTRY*)0)), ((void*) (1 ? (entries) : (STACK_OF_X509_NAME_ENTRY*)0)))
| 0-33 | ||||||||||||||||||
385 | ) | - | ||||||||||||||||||
386 | goto never executed: memerr;goto memerr; never executed: goto memerr; | 0 | ||||||||||||||||||
387 | set = entry->set; | - | ||||||||||||||||||
388 | } executed 33 times by 2 tests: end of block Executed by:
| 33 | ||||||||||||||||||
389 | if (entries ==
| 0-33 | ||||||||||||||||||
390 | ((void *)0)
| 0-33 | ||||||||||||||||||
391 | || | - | ||||||||||||||||||
392 | !sk_push(((_STACK*) (1 ? (entries) : (struct stack_st_X509_NAME_ENTRY*)0)), ((void*) (1 ? (entry) : (X509_NAME_ENTRY*)0)))
| 0-33 | ||||||||||||||||||
393 | goto never executed: memerr;goto memerr; never executed: goto memerr; | 0 | ||||||||||||||||||
394 | } executed 33 times by 2 tests: end of block Executed by:
| 33 | ||||||||||||||||||
395 | len = ASN1_item_ex_i2d(&intname.a, | - | ||||||||||||||||||
396 | ((void *)0) | - | ||||||||||||||||||
397 | , | - | ||||||||||||||||||
398 | &X509_NAME_INTERNAL_it, -1, -1); | - | ||||||||||||||||||
399 | if (!BUF_MEM_grow(a->bytes, len)
| 0-27 | ||||||||||||||||||
400 | goto never executed: memerr;goto memerr; never executed: goto memerr; | 0 | ||||||||||||||||||
401 | p = (unsigned char *)a->bytes->data; | - | ||||||||||||||||||
402 | ASN1_item_ex_i2d(&intname.a, &p, &X509_NAME_INTERNAL_it, | - | ||||||||||||||||||
403 | -1, -1); | - | ||||||||||||||||||
404 | sk_pop_free(((_STACK*) (1 ? (intname.s) : (struct stack_st_STACK_OF_X509_NAME_ENTRY*)0)), ((void (*)(void *)) ((1 ? (local_sk_X509_NAME_ENTRY_free) : (void (*)(STACK_OF_X509_NAME_ENTRY *))0)))) | - | ||||||||||||||||||
405 | ; | - | ||||||||||||||||||
406 | a->modified = 0; | - | ||||||||||||||||||
407 | return executed 27 times by 2 tests: len;return len; Executed by:
executed 27 times by 2 tests: return len; Executed by:
| 27 | ||||||||||||||||||
408 | - | |||||||||||||||||||
409 | memerr: | - | ||||||||||||||||||
410 | sk_pop_free(((_STACK*) (1 ? (intname.s) : (struct stack_st_STACK_OF_X509_NAME_ENTRY*)0)), ((void (*)(void *)) ((1 ? (local_sk_X509_NAME_ENTRY_free) : (void (*)(STACK_OF_X509_NAME_ENTRY *))0)))) | - | ||||||||||||||||||
411 | ; | - | ||||||||||||||||||
412 | ERR_put_error(13,(0xfff),((1|64)),__FILE__,427); | - | ||||||||||||||||||
413 | return never executed: -1;return -1; never executed: return -1; | 0 | ||||||||||||||||||
414 | } | - | ||||||||||||||||||
415 | - | |||||||||||||||||||
416 | static int | - | ||||||||||||||||||
417 | x509_name_ex_print(BIO *out, ASN1_VALUE **pval, int indent, const char *fname, | - | ||||||||||||||||||
418 | const ASN1_PCTX *pctx) | - | ||||||||||||||||||
419 | { | - | ||||||||||||||||||
420 | if (X509_NAME_print_ex(out, (X509_NAME *)*pval, indent,
| 0 | ||||||||||||||||||
421 | pctx->nm_flags) <= 0
| 0 | ||||||||||||||||||
422 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||
423 | return never executed: 2;return 2; never executed: return 2; | 0 | ||||||||||||||||||
424 | } | - | ||||||||||||||||||
425 | static int | - | ||||||||||||||||||
426 | x509_name_canon(X509_NAME *a) | - | ||||||||||||||||||
427 | { | - | ||||||||||||||||||
428 | unsigned char *p; | - | ||||||||||||||||||
429 | struct stack_st_STACK_OF_X509_NAME_ENTRY *intname = | - | ||||||||||||||||||
430 | ((void *)0) | - | ||||||||||||||||||
431 | ; | - | ||||||||||||||||||
432 | struct stack_st_X509_NAME_ENTRY *entries = | - | ||||||||||||||||||
433 | ((void *)0) | - | ||||||||||||||||||
434 | ; | - | ||||||||||||||||||
435 | X509_NAME_ENTRY *entry, *tmpentry = | - | ||||||||||||||||||
436 | ((void *)0) | - | ||||||||||||||||||
437 | ; | - | ||||||||||||||||||
438 | int i, len, set = -1, ret = 0; | - | ||||||||||||||||||
439 | - | |||||||||||||||||||
440 | if (a->canon_enc
| 0-500 | ||||||||||||||||||
441 | free(a->canon_enc); | - | ||||||||||||||||||
442 | a->canon_enc = | - | ||||||||||||||||||
443 | ((void *)0) | - | ||||||||||||||||||
444 | ; | - | ||||||||||||||||||
445 | } never executed: end of block | 0 | ||||||||||||||||||
446 | - | |||||||||||||||||||
447 | if (sk_num(((_STACK*) (1 ? (a->entries) : (struct stack_st_X509_NAME_ENTRY*)0))) == 0
| 0-500 | ||||||||||||||||||
448 | a->canon_enclen = 0; | - | ||||||||||||||||||
449 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||||||||||||||
450 | } | - | ||||||||||||||||||
451 | intname = ((struct stack_st_STACK_OF_X509_NAME_ENTRY *)sk_new_null()); | - | ||||||||||||||||||
452 | if (!intname
| 0-500 | ||||||||||||||||||
453 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||
454 | for (i = 0; i < sk_num(((_STACK*) (1 ? (a->entries) : (struct stack_st_X509_NAME_ENTRY*)0)))
| 500-1838 | ||||||||||||||||||
455 | entry = ((X509_NAME_ENTRY *)sk_value(((_STACK*) (1 ? (a->entries) : (struct stack_st_X509_NAME_ENTRY*)0)), (i))); | - | ||||||||||||||||||
456 | if (entry->set != set
| 0-1838 | ||||||||||||||||||
457 | entries = ((struct stack_st_X509_NAME_ENTRY *)sk_new_null()); | - | ||||||||||||||||||
458 | if (!entries
| 0-1838 | ||||||||||||||||||
459 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||
460 | if (sk_push(((_STACK*) (1 ? (intname) : (struct stack_st_STACK_OF_X509_NAME_ENTRY*)0)), ((void*) (1 ? (entries) : (STACK_OF_X509_NAME_ENTRY*)0)))
| 0-1838 | ||||||||||||||||||
461 | == 0
| 0-1838 | ||||||||||||||||||
462 | sk_free(((_STACK*) (1 ? (entries) : (struct stack_st_X509_NAME_ENTRY*)0))); | - | ||||||||||||||||||
463 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||
464 | } | - | ||||||||||||||||||
465 | set = entry->set; | - | ||||||||||||||||||
466 | } executed 1838 times by 8 tests: end of block Executed by:
| 1838 | ||||||||||||||||||
467 | tmpentry = X509_NAME_ENTRY_new(); | - | ||||||||||||||||||
468 | if (tmpentry ==
| 0-1838 | ||||||||||||||||||
469 | ((void *)0)
| 0-1838 | ||||||||||||||||||
470 | ) | - | ||||||||||||||||||
471 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||
472 | tmpentry->object = OBJ_dup(entry->object); | - | ||||||||||||||||||
473 | if (tmpentry->object ==
| 0-1838 | ||||||||||||||||||
474 | ((void *)0)
| 0-1838 | ||||||||||||||||||
475 | ) | - | ||||||||||||||||||
476 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||
477 | if (!asn1_string_canon(tmpentry->value, entry->value)
| 0-1838 | ||||||||||||||||||
478 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||
479 | if (entries ==
| 0-1838 | ||||||||||||||||||
480 | ((void *)0)
| 0-1838 | ||||||||||||||||||
481 | || | - | ||||||||||||||||||
482 | !sk_push(((_STACK*) (1 ? (entries) : (struct stack_st_X509_NAME_ENTRY*)0)), ((void*) (1 ? (tmpentry) : (X509_NAME_ENTRY*)0)))
| 0-1838 | ||||||||||||||||||
483 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||
484 | tmpentry = | - | ||||||||||||||||||
485 | ((void *)0) | - | ||||||||||||||||||
486 | ; | - | ||||||||||||||||||
487 | } executed 1838 times by 8 tests: end of block Executed by:
| 1838 | ||||||||||||||||||
488 | - | |||||||||||||||||||
489 | - | |||||||||||||||||||
490 | len = i2d_name_canon(intname, | - | ||||||||||||||||||
491 | ((void *)0) | - | ||||||||||||||||||
492 | ); | - | ||||||||||||||||||
493 | if (len < 0
| 0-500 | ||||||||||||||||||
494 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||
495 | p = malloc(len); | - | ||||||||||||||||||
496 | if (p ==
| 0-500 | ||||||||||||||||||
497 | ((void *)0)
| 0-500 | ||||||||||||||||||
498 | ) | - | ||||||||||||||||||
499 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||
500 | a->canon_enc = p; | - | ||||||||||||||||||
501 | a->canon_enclen = len; | - | ||||||||||||||||||
502 | i2d_name_canon(intname, &p); | - | ||||||||||||||||||
503 | ret = 1; | - | ||||||||||||||||||
504 | - | |||||||||||||||||||
505 | err: code before this statement executed 500 times by 8 tests: err: Executed by:
| 500 | ||||||||||||||||||
506 | if (tmpentry
| 0-500 | ||||||||||||||||||
507 | X509_NAME_ENTRY_free(tmpentry); never executed: X509_NAME_ENTRY_free(tmpentry); | 0 | ||||||||||||||||||
508 | if (intname
| 0-500 | ||||||||||||||||||
509 | sk_pop_free(((_STACK*) (1 ? (intname) : (struct stack_st_STACK_OF_X509_NAME_ENTRY*)0)), ((void (*)(void *)) ((1 ? (local_sk_X509_NAME_ENTRY_pop_free) : (void (*)(STACK_OF_X509_NAME_ENTRY *))0)))) executed 500 times by 8 tests: sk_pop_free(((_STACK*) (1 ? (intname) : (struct stack_st_STACK_OF_X509_NAME_ENTRY*)0)), ((void (*)(void *)) ((1 ? (local_sk_X509_NAME_ENTRY_pop_free) : (void (*)(STACK_OF_X509_NAME_ENTRY *))0)))) ; Executed by:
| 500 | ||||||||||||||||||
510 | ; executed 500 times by 8 tests: sk_pop_free(((_STACK*) (1 ? (intname) : (struct stack_st_STACK_OF_X509_NAME_ENTRY*)0)), ((void (*)(void *)) ((1 ? (local_sk_X509_NAME_ENTRY_pop_free) : (void (*)(STACK_OF_X509_NAME_ENTRY *))0)))) ; Executed by:
| 500 | ||||||||||||||||||
511 | return executed 500 times by 8 tests: ret;return ret; Executed by:
executed 500 times by 8 tests: return ret; Executed by:
| 500 | ||||||||||||||||||
512 | } | - | ||||||||||||||||||
513 | static int | - | ||||||||||||||||||
514 | asn1_string_canon(ASN1_STRING *out, ASN1_STRING *in) | - | ||||||||||||||||||
515 | { | - | ||||||||||||||||||
516 | unsigned char *to, *from; | - | ||||||||||||||||||
517 | int len, i; | - | ||||||||||||||||||
518 | - | |||||||||||||||||||
519 | - | |||||||||||||||||||
520 | if (!(ASN1_tag2bit(in->type) & (0x2000 | 0x0800 | 0x0100 | 0x0002 | 0x0004 | 0x0010 | 0x0040))
| 0-1838 | ||||||||||||||||||
521 | if (!ASN1_STRING_copy(out, in)
| 0 | ||||||||||||||||||
522 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||
523 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||||||||||||||
524 | } | - | ||||||||||||||||||
525 | - | |||||||||||||||||||
526 | out->type = 12; | - | ||||||||||||||||||
527 | out->length = ASN1_STRING_to_UTF8(&out->data, in); | - | ||||||||||||||||||
528 | if (out->length == -1
| 0-1838 | ||||||||||||||||||
529 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||
530 | - | |||||||||||||||||||
531 | to = out->data; | - | ||||||||||||||||||
532 | from = to; | - | ||||||||||||||||||
533 | - | |||||||||||||||||||
534 | len = out->length; | - | ||||||||||||||||||
535 | while ((
| 0-1838 | ||||||||||||||||||
536 | ((*
| 0-1838 | ||||||||||||||||||
537 | *from
| 0-1838 | ||||||||||||||||||
538 | ))] & (unsigned short int) _ISspace)
| 0-1838 | ||||||||||||||||||
539 | ) { | - | ||||||||||||||||||
540 | from++; | - | ||||||||||||||||||
541 | len--; | - | ||||||||||||||||||
542 | } never executed: end of block | 0 | ||||||||||||||||||
543 | - | |||||||||||||||||||
544 | to = from + len - 1; | - | ||||||||||||||||||
545 | - | |||||||||||||||||||
546 | - | |||||||||||||||||||
547 | while ((
| 0-1838 | ||||||||||||||||||
548 | ((*
| 0-1838 | ||||||||||||||||||
549 | *to
| 0-1838 | ||||||||||||||||||
550 | ))] & (unsigned short int) _ISspace)
| 0-1838 | ||||||||||||||||||
551 | ) { | - | ||||||||||||||||||
552 | to--; | - | ||||||||||||||||||
553 | len--; | - | ||||||||||||||||||
554 | } never executed: end of block | 0 | ||||||||||||||||||
555 | - | |||||||||||||||||||
556 | to = out->data; | - | ||||||||||||||||||
557 | - | |||||||||||||||||||
558 | i = 0; | - | ||||||||||||||||||
559 | while (i < len
| 1838-28148 | ||||||||||||||||||
560 | - | |||||||||||||||||||
561 | if (*
| 0-28148 | ||||||||||||||||||
562 | *to++ = *from++; | - | ||||||||||||||||||
563 | i++; | - | ||||||||||||||||||
564 | } never executed: end of block | 0 | ||||||||||||||||||
565 | - | |||||||||||||||||||
566 | else if ( | - | ||||||||||||||||||
567 | ((*
| 2943-25205 | ||||||||||||||||||
568 | *from
| 2943-25205 | ||||||||||||||||||
569 | ))] & (unsigned short int) _ISspace)
| 2943-25205 | ||||||||||||||||||
570 | ) { | - | ||||||||||||||||||
571 | - | |||||||||||||||||||
572 | *to++ = ' '; | - | ||||||||||||||||||
573 | - | |||||||||||||||||||
574 | - | |||||||||||||||||||
575 | - | |||||||||||||||||||
576 | - | |||||||||||||||||||
577 | do { | - | ||||||||||||||||||
578 | from++; | - | ||||||||||||||||||
579 | i++; | - | ||||||||||||||||||
580 | } executed 2943 times by 7 tests: while (!(*from & 0x80)end of block Executed by:
| 0-2943 | ||||||||||||||||||
581 | ((*
| 0-2943 | ||||||||||||||||||
582 | *from
| 0-2943 | ||||||||||||||||||
583 | ))] & (unsigned short int) _ISspace)
| 0-2943 | ||||||||||||||||||
584 | ); | - | ||||||||||||||||||
585 | } executed 2943 times by 7 tests: else {end of block Executed by:
| 2943 | ||||||||||||||||||
586 | *to++ = | - | ||||||||||||||||||
587 | (__extension__ ({ int __res; if (sizeof (
| 0-25205 | ||||||||||||||||||
588 | *from
| 0-25205 | ||||||||||||||||||
589 | ) > 1
| 0-25205 | ||||||||||||||||||
590 | *from
| 0 | ||||||||||||||||||
591 | )
| 0 | ||||||||||||||||||
592 | *from | - | ||||||||||||||||||
593 | ); __res = __c < -128
never executed: else __res = tolower (end of block never executed: __res = tolower ( *from ); | 0 | ||||||||||||||||||
594 | *from never executed: __res = tolower ( *from ); | 0 | ||||||||||||||||||
595 | ); never executed: } else __res = (*__ctype_tolower_loc ())[(int) (__res = tolower ( *from ); executed 25205 times by 8 tests: __res = (*__ctype_tolower_loc ())[(int) ( *from )]; Executed by:
| 0-25205 | ||||||||||||||||||
596 | *from executed 25205 times by 8 tests: __res = (*__ctype_tolower_loc ())[(int) ( *from )]; Executed by:
| 25205 | ||||||||||||||||||
597 | )]; executed 25205 times by 8 tests: __res; }))__res = (*__ctype_tolower_loc ())[(int) ( *from )]; Executed by:
| 25205 | ||||||||||||||||||
598 | ; | - | ||||||||||||||||||
599 | from++; | - | ||||||||||||||||||
600 | i++; | - | ||||||||||||||||||
601 | } executed 25205 times by 8 tests: end of block Executed by:
| 25205 | ||||||||||||||||||
602 | } | - | ||||||||||||||||||
603 | - | |||||||||||||||||||
604 | out->length = to - out->data; | - | ||||||||||||||||||
605 | - | |||||||||||||||||||
606 | return executed 1838 times by 8 tests: 1;return 1; Executed by:
executed 1838 times by 8 tests: return 1; Executed by:
| 1838 | ||||||||||||||||||
607 | } | - | ||||||||||||||||||
608 | - | |||||||||||||||||||
609 | static int | - | ||||||||||||||||||
610 | i2d_name_canon(struct stack_st_STACK_OF_X509_NAME_ENTRY *_intname, unsigned char **in) | - | ||||||||||||||||||
611 | { | - | ||||||||||||||||||
612 | int i, len, ltmp; | - | ||||||||||||||||||
613 | ASN1_VALUE *v; | - | ||||||||||||||||||
614 | struct stack_st_ASN1_VALUE *intname = (struct stack_st_ASN1_VALUE *)_intname; | - | ||||||||||||||||||
615 | - | |||||||||||||||||||
616 | len = 0; | - | ||||||||||||||||||
617 | for (i = 0; i < sk_num(((_STACK*) (1 ? (intname) : (struct stack_st_ASN1_VALUE*)0)))
| 1000-3676 | ||||||||||||||||||
618 | v = ((ASN1_VALUE *)sk_value(((_STACK*) (1 ? (intname) : (struct stack_st_ASN1_VALUE*)0)), (i))); | - | ||||||||||||||||||
619 | ltmp = ASN1_item_ex_i2d(&v, in, | - | ||||||||||||||||||
620 | &X509_NAME_ENTRIES_it, -1, -1); | - | ||||||||||||||||||
621 | if (ltmp < 0
| 0-3676 | ||||||||||||||||||
622 | return never executed: ltmp;return ltmp; never executed: return ltmp; | 0 | ||||||||||||||||||
623 | len += ltmp; | - | ||||||||||||||||||
624 | } executed 3676 times by 8 tests: end of block Executed by:
| 3676 | ||||||||||||||||||
625 | return executed 1000 times by 8 tests: len;return len; Executed by:
executed 1000 times by 8 tests: return len; Executed by:
| 1000 | ||||||||||||||||||
626 | } | - | ||||||||||||||||||
627 | - | |||||||||||||||||||
628 | int | - | ||||||||||||||||||
629 | X509_NAME_set(X509_NAME **xn, X509_NAME *name) | - | ||||||||||||||||||
630 | { | - | ||||||||||||||||||
631 | X509_NAME *in; | - | ||||||||||||||||||
632 | - | |||||||||||||||||||
633 | if (!xn
| 0-32 | ||||||||||||||||||
634 | return never executed: (0);return (0); never executed: return (0); | 0 | ||||||||||||||||||
635 | - | |||||||||||||||||||
636 | if (*
| 0-32 | ||||||||||||||||||
637 | in = X509_NAME_dup(name); | - | ||||||||||||||||||
638 | if (in !=
| 0-32 | ||||||||||||||||||
639 | ((void *)0)
| 0-32 | ||||||||||||||||||
640 | ) { | - | ||||||||||||||||||
641 | X509_NAME_free(*xn); | - | ||||||||||||||||||
642 | *xn = in; | - | ||||||||||||||||||
643 | } executed 32 times by 3 tests: end of block Executed by:
| 32 | ||||||||||||||||||
644 | } executed 32 times by 3 tests: end of block Executed by:
| 32 | ||||||||||||||||||
645 | return executed 32 times by 3 tests: (*xn != return (*xn != ((void *)0) ); Executed by:
executed 32 times by 3 tests: return (*xn != ((void *)0) ); Executed by:
| 32 | ||||||||||||||||||
646 | ((void *)0) executed 32 times by 3 tests: return (*xn != ((void *)0) ); Executed by:
| 32 | ||||||||||||||||||
647 | ); executed 32 times by 3 tests: return (*xn != ((void *)0) ); Executed by:
| 32 | ||||||||||||||||||
648 | } | - | ||||||||||||||||||
649 | - | |||||||||||||||||||
650 | int | - | ||||||||||||||||||
651 | X509_NAME_get0_der(X509_NAME *nm, const unsigned char **pder, size_t *pderlen) | - | ||||||||||||||||||
652 | { | - | ||||||||||||||||||
653 | - | |||||||||||||||||||
654 | if (i2d_X509_NAME(nm,
| 0 | ||||||||||||||||||
655 | ((void *)0)
| 0 | ||||||||||||||||||
656 | ) <= 0
| 0 | ||||||||||||||||||
657 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||
658 | if (pder !=
| 0 | ||||||||||||||||||
659 | ((void *)0)
| 0 | ||||||||||||||||||
660 | ) | - | ||||||||||||||||||
661 | * never executed: pder = (unsigned char *)nm->bytes->data;*pder = (unsigned char *)nm->bytes->data; never executed: *pder = (unsigned char *)nm->bytes->data; | 0 | ||||||||||||||||||
662 | if (pderlen !=
| 0 | ||||||||||||||||||
663 | ((void *)0)
| 0 | ||||||||||||||||||
664 | ) | - | ||||||||||||||||||
665 | * never executed: pderlen = nm->bytes->length;*pderlen = nm->bytes->length; never executed: *pderlen = nm->bytes->length; | 0 | ||||||||||||||||||
666 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||||||||||||||
667 | } | - | ||||||||||||||||||
Switch to Source code | Preprocessed file |