Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/x509/x_name.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | static int x509_name_ex_d2i(ASN1_VALUE **val, | - | ||||||||||||||||||||||||
2 | const unsigned char **in, long len, | - | ||||||||||||||||||||||||
3 | const ASN1_ITEM *it, | - | ||||||||||||||||||||||||
4 | int tag, int aclass, char opt, ASN1_TLC *ctx); | - | ||||||||||||||||||||||||
5 | - | |||||||||||||||||||||||||
6 | static int x509_name_ex_i2d(ASN1_VALUE **val, unsigned char **out, | - | ||||||||||||||||||||||||
7 | const ASN1_ITEM *it, int tag, int aclass); | - | ||||||||||||||||||||||||
8 | static int x509_name_ex_new(ASN1_VALUE **val, const ASN1_ITEM *it); | - | ||||||||||||||||||||||||
9 | static void x509_name_ex_free(ASN1_VALUE **val, const ASN1_ITEM *it); | - | ||||||||||||||||||||||||
10 | - | |||||||||||||||||||||||||
11 | static int x509_name_encode(X509_NAME *a); | - | ||||||||||||||||||||||||
12 | static int x509_name_canon(X509_NAME *a); | - | ||||||||||||||||||||||||
13 | static int asn1_string_canon(ASN1_STRING *out, const ASN1_STRING *in); | - | ||||||||||||||||||||||||
14 | static int i2d_name_canon(struct stack_st_STACK_OF_X509_NAME_ENTRY * intname, | - | ||||||||||||||||||||||||
15 | unsigned char **in); | - | ||||||||||||||||||||||||
16 | - | |||||||||||||||||||||||||
17 | static int x509_name_ex_print(BIO *out, ASN1_VALUE **pval, | - | ||||||||||||||||||||||||
18 | int indent, | - | ||||||||||||||||||||||||
19 | const char *fname, const ASN1_PCTX *pctx); | - | ||||||||||||||||||||||||
20 | - | |||||||||||||||||||||||||
21 | static const ASN1_TEMPLATE X509_NAME_ENTRY_seq_tt[] = { | - | ||||||||||||||||||||||||
22 | { (0), (0), | - | ||||||||||||||||||||||||
23 | __builtin_offsetof ( | - | ||||||||||||||||||||||||
24 | X509_NAME_ENTRY | - | ||||||||||||||||||||||||
25 | , | - | ||||||||||||||||||||||||
26 | object | - | ||||||||||||||||||||||||
27 | ) | - | ||||||||||||||||||||||||
28 | , "object", (&(ASN1_OBJECT_it)) }, | - | ||||||||||||||||||||||||
29 | { (0), (0), | - | ||||||||||||||||||||||||
30 | __builtin_offsetof ( | - | ||||||||||||||||||||||||
31 | X509_NAME_ENTRY | - | ||||||||||||||||||||||||
32 | , | - | ||||||||||||||||||||||||
33 | value | - | ||||||||||||||||||||||||
34 | ) | - | ||||||||||||||||||||||||
35 | , "value", (&(ASN1_PRINTABLE_it)) } | - | ||||||||||||||||||||||||
36 | } ; const ASN1_ITEM X509_NAME_ENTRY_it = { 0x1, 16, X509_NAME_ENTRY_seq_tt, sizeof(X509_NAME_ENTRY_seq_tt) / sizeof(ASN1_TEMPLATE), | - | ||||||||||||||||||||||||
37 | ((void *)0) | - | ||||||||||||||||||||||||
38 | , sizeof(X509_NAME_ENTRY), "X509_NAME_ENTRY" }; | - | ||||||||||||||||||||||||
39 | - | |||||||||||||||||||||||||
40 | X509_NAME_ENTRY *d2i_X509_NAME_ENTRY(X509_NAME_ENTRY **a, const unsigned char **in, long len) { return never executed: (X509_NAME_ENTRY *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(X509_NAME_ENTRY_it)));return (X509_NAME_ENTRY *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(X509_NAME_ENTRY_it))); never executed: } int i2d_X509_NAME_ENTRY(X509_NAME_ENTRY *a, unsigned char **out) { returnreturn (X509_NAME_ENTRY *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(X509_NAME_ENTRY_it))); 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: } X509_NAME_ENTRY *X509_NAME_ENTRY_new(void) { returnreturn ASN1_item_i2d((ASN1_VALUE *)a, out, (&(X509_NAME_ENTRY_it))); executed 120966 times by 1 test: (X509_NAME_ENTRY *)ASN1_item_new((&(X509_NAME_ENTRY_it)));return (X509_NAME_ENTRY *)ASN1_item_new((&(X509_NAME_ENTRY_it))); Executed by:
executed 120966 times by 1 test: } void X509_NAME_ENTRY_free(X509_NAME_ENTRY *a) { ASN1_item_free((ASN1_VALUE *)a, (&(X509_NAME_ENTRY_it))); }return (X509_NAME_ENTRY *)ASN1_item_new((&(X509_NAME_ENTRY_it))); Executed by:
executed 272317 times by 1 test: end of block Executed by:
| 0-272317 | ||||||||||||||||||||||||
41 | X509_NAME_ENTRY * X509_NAME_ENTRY_dup(X509_NAME_ENTRY *x) { return executed 19686 times by 1 test: ASN1_item_dup((&(X509_NAME_ENTRY_it)), x);return ASN1_item_dup((&(X509_NAME_ENTRY_it)), x); Executed by:
executed 19686 times by 1 test: }return ASN1_item_dup((&(X509_NAME_ENTRY_it)), x); Executed by:
| 19686 | ||||||||||||||||||||||||
42 | - | |||||||||||||||||||||||||
43 | - | |||||||||||||||||||||||||
44 | - | |||||||||||||||||||||||||
45 | - | |||||||||||||||||||||||||
46 | - | |||||||||||||||||||||||||
47 | - | |||||||||||||||||||||||||
48 | static const ASN1_TEMPLATE X509_NAME_ENTRIES_item_tt = | - | ||||||||||||||||||||||||
49 | { ((0x1 << 1)), (0), 0, "RDNS", (&(X509_NAME_ENTRY_it)) } | - | ||||||||||||||||||||||||
50 | ; static const ASN1_ITEM X509_NAME_ENTRIES_it = { 0x0, -1, &X509_NAME_ENTRIES_item_tt, 0, | - | ||||||||||||||||||||||||
51 | ((void *)0) | - | ||||||||||||||||||||||||
52 | , 0, "X509_NAME_ENTRIES" }; | - | ||||||||||||||||||||||||
53 | - | |||||||||||||||||||||||||
54 | static const ASN1_TEMPLATE X509_NAME_INTERNAL_item_tt = | - | ||||||||||||||||||||||||
55 | { ((0x2 << 1)), (0), 0, "Name", (&(X509_NAME_ENTRIES_it)) } | - | ||||||||||||||||||||||||
56 | ; static const ASN1_ITEM X509_NAME_INTERNAL_it = { 0x0, -1, &X509_NAME_INTERNAL_item_tt, 0, | - | ||||||||||||||||||||||||
57 | ((void *)0) | - | ||||||||||||||||||||||||
58 | , 0, "X509_NAME_INTERNAL" }; | - | ||||||||||||||||||||||||
59 | static const ASN1_EXTERN_FUNCS x509_name_ff = { | - | ||||||||||||||||||||||||
60 | - | |||||||||||||||||||||||||
61 | ((void *)0) | - | ||||||||||||||||||||||||
62 | , | - | ||||||||||||||||||||||||
63 | x509_name_ex_new, | - | ||||||||||||||||||||||||
64 | x509_name_ex_free, | - | ||||||||||||||||||||||||
65 | 0, | - | ||||||||||||||||||||||||
66 | x509_name_ex_d2i, | - | ||||||||||||||||||||||||
67 | x509_name_ex_i2d, | - | ||||||||||||||||||||||||
68 | x509_name_ex_print | - | ||||||||||||||||||||||||
69 | }; | - | ||||||||||||||||||||||||
70 | - | |||||||||||||||||||||||||
71 | const ASN1_ITEM X509_NAME_it = { 0x4, 16, | - | ||||||||||||||||||||||||
72 | ((void *)0) | - | ||||||||||||||||||||||||
73 | , 0, &x509_name_ff, 0, "X509_NAME" }; | - | ||||||||||||||||||||||||
74 | - | |||||||||||||||||||||||||
75 | X509_NAME *d2i_X509_NAME(X509_NAME **a, const unsigned char **in, long len) { return executed 50 times by 1 test: (X509_NAME *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(X509_NAME_it)));return (X509_NAME *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(X509_NAME_it))); Executed by:
executed 50 times by 1 test: } int i2d_X509_NAME(X509_NAME *a, unsigned char **out) { returnreturn (X509_NAME *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(X509_NAME_it))); Executed by:
executed 5217 times by 1 test: ASN1_item_i2d((ASN1_VALUE *)a, out, (&(X509_NAME_it)));return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(X509_NAME_it))); Executed by:
executed 5217 times by 1 test: } X509_NAME *X509_NAME_new(void) { returnreturn ASN1_item_i2d((ASN1_VALUE *)a, out, (&(X509_NAME_it))); Executed by:
executed 412 times by 1 test: (X509_NAME *)ASN1_item_new((&(X509_NAME_it)));return (X509_NAME *)ASN1_item_new((&(X509_NAME_it))); Executed by:
executed 412 times by 1 test: } void X509_NAME_free(X509_NAME *a) { ASN1_item_free((ASN1_VALUE *)a, (&(X509_NAME_it))); }return (X509_NAME *)ASN1_item_new((&(X509_NAME_it))); Executed by:
executed 25089 times by 1 test: end of block Executed by:
| 50-25089 | ||||||||||||||||||||||||
76 | - | |||||||||||||||||||||||||
77 | X509_NAME * X509_NAME_dup(X509_NAME *x) { return executed 7141 times by 1 test: ASN1_item_dup((&(X509_NAME_it)), x);return ASN1_item_dup((&(X509_NAME_it)), x); Executed by:
executed 7141 times by 1 test: }return ASN1_item_dup((&(X509_NAME_it)), x); Executed by:
| 7141 | ||||||||||||||||||||||||
78 | - | |||||||||||||||||||||||||
79 | static int x509_name_ex_new(ASN1_VALUE **val, const ASN1_ITEM *it) | - | ||||||||||||||||||||||||
80 | { | - | ||||||||||||||||||||||||
81 | X509_NAME *ret = CRYPTO_zalloc(sizeof(*ret), __FILE__, 92); | - | ||||||||||||||||||||||||
82 | - | |||||||||||||||||||||||||
83 | if (ret ==
| 0-274790 | ||||||||||||||||||||||||
84 | ((void *)0)
| 0-274790 | ||||||||||||||||||||||||
85 | ) | - | ||||||||||||||||||||||||
86 | goto never executed: memerr;goto memerr; never executed: goto memerr; | 0 | ||||||||||||||||||||||||
87 | if ((
| 0-274790 | ||||||||||||||||||||||||
88 | ((void *)0)
| 0-274790 | ||||||||||||||||||||||||
89 | ) | - | ||||||||||||||||||||||||
90 | goto never executed: memerr;goto memerr; never executed: goto memerr; | 0 | ||||||||||||||||||||||||
91 | if ((
| 0-274790 | ||||||||||||||||||||||||
92 | ((void *)0)
| 0-274790 | ||||||||||||||||||||||||
93 | ) | - | ||||||||||||||||||||||||
94 | goto never executed: memerr;goto memerr; never executed: goto memerr; | 0 | ||||||||||||||||||||||||
95 | ret->modified = 1; | - | ||||||||||||||||||||||||
96 | *val = (ASN1_VALUE *)ret; | - | ||||||||||||||||||||||||
97 | return executed 274790 times by 1 test: 1;return 1; Executed by:
executed 274790 times by 1 test: return 1; Executed by:
| 274790 | ||||||||||||||||||||||||
98 | - | |||||||||||||||||||||||||
99 | memerr: | - | ||||||||||||||||||||||||
100 | ERR_put_error(13,(171),((1|64)),__FILE__,105); | - | ||||||||||||||||||||||||
101 | if (ret
| 0 | ||||||||||||||||||||||||
102 | sk_X509_NAME_ENTRY_free(ret->entries); | - | ||||||||||||||||||||||||
103 | CRYPTO_free(ret, __FILE__, 108); | - | ||||||||||||||||||||||||
104 | } never executed: end of block | 0 | ||||||||||||||||||||||||
105 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
106 | } | - | ||||||||||||||||||||||||
107 | - | |||||||||||||||||||||||||
108 | static void x509_name_ex_free(ASN1_VALUE **pval, const ASN1_ITEM *it) | - | ||||||||||||||||||||||||
109 | { | - | ||||||||||||||||||||||||
110 | X509_NAME *a; | - | ||||||||||||||||||||||||
111 | - | |||||||||||||||||||||||||
112 | if (!pval
| 0-274790 | ||||||||||||||||||||||||
113 | return; never executed: return; | 0 | ||||||||||||||||||||||||
114 | a = (X509_NAME *)*pval; | - | ||||||||||||||||||||||||
115 | - | |||||||||||||||||||||||||
116 | BUF_MEM_free(a->bytes); | - | ||||||||||||||||||||||||
117 | sk_X509_NAME_ENTRY_pop_free(a->entries, X509_NAME_ENTRY_free); | - | ||||||||||||||||||||||||
118 | CRYPTO_free(a->canon_enc, __FILE__, 123); | - | ||||||||||||||||||||||||
119 | CRYPTO_free(a, __FILE__, 124); | - | ||||||||||||||||||||||||
120 | *pval = | - | ||||||||||||||||||||||||
121 | ((void *)0) | - | ||||||||||||||||||||||||
122 | ; | - | ||||||||||||||||||||||||
123 | } executed 274790 times by 1 test: end of block Executed by:
| 274790 | ||||||||||||||||||||||||
124 | - | |||||||||||||||||||||||||
125 | static void local_sk_X509_NAME_ENTRY_free(struct stack_st_X509_NAME_ENTRY *ne) | - | ||||||||||||||||||||||||
126 | { | - | ||||||||||||||||||||||||
127 | sk_X509_NAME_ENTRY_free(ne); | - | ||||||||||||||||||||||||
128 | } executed 97560 times by 1 test: end of block Executed by:
| 97560 | ||||||||||||||||||||||||
129 | - | |||||||||||||||||||||||||
130 | static void local_sk_X509_NAME_ENTRY_pop_free(struct stack_st_X509_NAME_ENTRY *ne) | - | ||||||||||||||||||||||||
131 | { | - | ||||||||||||||||||||||||
132 | sk_X509_NAME_ENTRY_pop_free(ne, X509_NAME_ENTRY_free); | - | ||||||||||||||||||||||||
133 | } executed 99013 times by 1 test: end of block Executed by:
| 99013 | ||||||||||||||||||||||||
134 | - | |||||||||||||||||||||||||
135 | static int x509_name_ex_d2i(ASN1_VALUE **val, | - | ||||||||||||||||||||||||
136 | const unsigned char **in, long len, | - | ||||||||||||||||||||||||
137 | const ASN1_ITEM *it, int tag, int aclass, | - | ||||||||||||||||||||||||
138 | char opt, ASN1_TLC *ctx) | - | ||||||||||||||||||||||||
139 | { | - | ||||||||||||||||||||||||
140 | const unsigned char *p = *in, *q; | - | ||||||||||||||||||||||||
141 | union { | - | ||||||||||||||||||||||||
142 | struct stack_st_STACK_OF_X509_NAME_ENTRY *s; | - | ||||||||||||||||||||||||
143 | ASN1_VALUE *a; | - | ||||||||||||||||||||||||
144 | } intname = { | - | ||||||||||||||||||||||||
145 | - | |||||||||||||||||||||||||
146 | ((void *)0) | - | ||||||||||||||||||||||||
147 | - | |||||||||||||||||||||||||
148 | }; | - | ||||||||||||||||||||||||
149 | union { | - | ||||||||||||||||||||||||
150 | X509_NAME *x; | - | ||||||||||||||||||||||||
151 | ASN1_VALUE *a; | - | ||||||||||||||||||||||||
152 | } nm = { | - | ||||||||||||||||||||||||
153 | - | |||||||||||||||||||||||||
154 | ((void *)0) | - | ||||||||||||||||||||||||
155 | - | |||||||||||||||||||||||||
156 | }; | - | ||||||||||||||||||||||||
157 | int i, j, ret; | - | ||||||||||||||||||||||||
158 | struct stack_st_X509_NAME_ENTRY *entries; | - | ||||||||||||||||||||||||
159 | X509_NAME_ENTRY *entry; | - | ||||||||||||||||||||||||
160 | if (len > (1024 * 1024)
| 0-138785 | ||||||||||||||||||||||||
161 | len = (1024 * 1024); never executed: len = (1024 * 1024); | 0 | ||||||||||||||||||||||||
162 | q = p; | - | ||||||||||||||||||||||||
163 | - | |||||||||||||||||||||||||
164 | - | |||||||||||||||||||||||||
165 | ret = ASN1_item_ex_d2i(&intname.a, | - | ||||||||||||||||||||||||
166 | &p, len, (&(X509_NAME_INTERNAL_it)), | - | ||||||||||||||||||||||||
167 | tag, aclass, opt, ctx); | - | ||||||||||||||||||||||||
168 | - | |||||||||||||||||||||||||
169 | if (ret <= 0
| 15104-123681 | ||||||||||||||||||||||||
170 | return executed 15104 times by 1 test: ret;return ret; Executed by:
executed 15104 times by 1 test: return ret; Executed by:
| 15104 | ||||||||||||||||||||||||
171 | - | |||||||||||||||||||||||||
172 | if (*
| 11555-112126 | ||||||||||||||||||||||||
173 | x509_name_ex_free(val, executed 112126 times by 1 test: x509_name_ex_free(val, ((void *)0) ); Executed by:
| 112126 | ||||||||||||||||||||||||
174 | ((void *)0) executed 112126 times by 1 test: x509_name_ex_free(val, ((void *)0) ); Executed by:
| 112126 | ||||||||||||||||||||||||
175 | ); executed 112126 times by 1 test: x509_name_ex_free(val, ((void *)0) ); Executed by:
| 112126 | ||||||||||||||||||||||||
176 | if (!x509_name_ex_new(&nm.a,
| 0-123681 | ||||||||||||||||||||||||
177 | ((void *)0)
| 0-123681 | ||||||||||||||||||||||||
178 | )
| 0-123681 | ||||||||||||||||||||||||
179 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
180 | - | |||||||||||||||||||||||||
181 | if (!BUF_MEM_grow(nm.x->bytes, p - q)
| 0-123681 | ||||||||||||||||||||||||
182 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
183 | memcpy(nm.x->bytes->data, q, p - q); | - | ||||||||||||||||||||||||
184 | - | |||||||||||||||||||||||||
185 | - | |||||||||||||||||||||||||
186 | for (i = 0; i < sk_STACK_OF_X509_NAME_ENTRY_num(intname.s)
| 79944-123681 | ||||||||||||||||||||||||
187 | entries = sk_STACK_OF_X509_NAME_ENTRY_value(intname.s, i); | - | ||||||||||||||||||||||||
188 | for (j = 0; j < sk_X509_NAME_ENTRY_num(entries)
| 79944-95547 | ||||||||||||||||||||||||
189 | entry = sk_X509_NAME_ENTRY_value(entries, j); | - | ||||||||||||||||||||||||
190 | entry->set = i; | - | ||||||||||||||||||||||||
191 | if (!sk_X509_NAME_ENTRY_push(nm.x->entries, entry)
| 0-95547 | ||||||||||||||||||||||||
192 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
193 | sk_X509_NAME_ENTRY_set(entries, j, | - | ||||||||||||||||||||||||
194 | ((void *)0) | - | ||||||||||||||||||||||||
195 | ); | - | ||||||||||||||||||||||||
196 | } executed 95547 times by 1 test: end of block Executed by:
| 95547 | ||||||||||||||||||||||||
197 | } executed 79944 times by 1 test: end of block Executed by:
| 79944 | ||||||||||||||||||||||||
198 | ret = x509_name_canon(nm.x); | - | ||||||||||||||||||||||||
199 | if (!ret
| 1163-122518 | ||||||||||||||||||||||||
200 | goto executed 1163 times by 1 test: err;goto err; Executed by:
executed 1163 times by 1 test: goto err; Executed by:
| 1163 | ||||||||||||||||||||||||
201 | sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname.s, | - | ||||||||||||||||||||||||
202 | local_sk_X509_NAME_ENTRY_free); | - | ||||||||||||||||||||||||
203 | nm.x->modified = 0; | - | ||||||||||||||||||||||||
204 | *val = nm.a; | - | ||||||||||||||||||||||||
205 | *in = p; | - | ||||||||||||||||||||||||
206 | return executed 122518 times by 1 test: ret;return ret; Executed by:
executed 122518 times by 1 test: return ret; Executed by:
| 122518 | ||||||||||||||||||||||||
207 | - | |||||||||||||||||||||||||
208 | err: | - | ||||||||||||||||||||||||
209 | if (nm.x !=
| 0-1163 | ||||||||||||||||||||||||
210 | ((void *)0)
| 0-1163 | ||||||||||||||||||||||||
211 | ) | - | ||||||||||||||||||||||||
212 | X509_NAME_free(nm.x); executed 1163 times by 1 test: X509_NAME_free(nm.x); Executed by:
| 1163 | ||||||||||||||||||||||||
213 | sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname.s, | - | ||||||||||||||||||||||||
214 | local_sk_X509_NAME_ENTRY_pop_free); | - | ||||||||||||||||||||||||
215 | ERR_put_error(13,(158),(58),__FILE__,206); | - | ||||||||||||||||||||||||
216 | return executed 1163 times by 1 test: 0;return 0; Executed by:
executed 1163 times by 1 test: return 0; Executed by:
| 1163 | ||||||||||||||||||||||||
217 | } | - | ||||||||||||||||||||||||
218 | - | |||||||||||||||||||||||||
219 | static int x509_name_ex_i2d(ASN1_VALUE **val, unsigned char **out, | - | ||||||||||||||||||||||||
220 | const ASN1_ITEM *it, int tag, int aclass) | - | ||||||||||||||||||||||||
221 | { | - | ||||||||||||||||||||||||
222 | int ret; | - | ||||||||||||||||||||||||
223 | X509_NAME *a = (X509_NAME *)*val; | - | ||||||||||||||||||||||||
224 | if (a->modified
| 4549-27804 | ||||||||||||||||||||||||
225 | ret = x509_name_encode(a); | - | ||||||||||||||||||||||||
226 | if (ret < 0
| 0-4549 | ||||||||||||||||||||||||
227 | return never executed: ret;return ret; never executed: return ret; | 0 | ||||||||||||||||||||||||
228 | ret = x509_name_canon(a); | - | ||||||||||||||||||||||||
229 | if (ret < 0
| 0-4549 | ||||||||||||||||||||||||
230 | return never executed: ret;return ret; never executed: return ret; | 0 | ||||||||||||||||||||||||
231 | } executed 4549 times by 1 test: end of block Executed by:
| 4549 | ||||||||||||||||||||||||
232 | ret = a->bytes->length; | - | ||||||||||||||||||||||||
233 | if (out !=
| 9110-23243 | ||||||||||||||||||||||||
234 | ((void *)0)
| 9110-23243 | ||||||||||||||||||||||||
235 | ) { | - | ||||||||||||||||||||||||
236 | memcpy(*out, a->bytes->data, ret); | - | ||||||||||||||||||||||||
237 | *out += ret; | - | ||||||||||||||||||||||||
238 | } executed 9110 times by 1 test: end of block Executed by:
| 9110 | ||||||||||||||||||||||||
239 | return executed 32353 times by 1 test: ret;return ret; Executed by:
executed 32353 times by 1 test: return ret; Executed by:
| 32353 | ||||||||||||||||||||||||
240 | } | - | ||||||||||||||||||||||||
241 | - | |||||||||||||||||||||||||
242 | static int x509_name_encode(X509_NAME *a) | - | ||||||||||||||||||||||||
243 | { | - | ||||||||||||||||||||||||
244 | union { | - | ||||||||||||||||||||||||
245 | struct stack_st_STACK_OF_X509_NAME_ENTRY *s; | - | ||||||||||||||||||||||||
246 | ASN1_VALUE *a; | - | ||||||||||||||||||||||||
247 | } intname = { | - | ||||||||||||||||||||||||
248 | - | |||||||||||||||||||||||||
249 | ((void *)0) | - | ||||||||||||||||||||||||
250 | - | |||||||||||||||||||||||||
251 | }; | - | ||||||||||||||||||||||||
252 | int len; | - | ||||||||||||||||||||||||
253 | unsigned char *p; | - | ||||||||||||||||||||||||
254 | struct stack_st_X509_NAME_ENTRY *entries = | - | ||||||||||||||||||||||||
255 | ((void *)0) | - | ||||||||||||||||||||||||
256 | ; | - | ||||||||||||||||||||||||
257 | X509_NAME_ENTRY *entry; | - | ||||||||||||||||||||||||
258 | int i, set = -1; | - | ||||||||||||||||||||||||
259 | intname.s = sk_STACK_OF_X509_NAME_ENTRY_new_null(); | - | ||||||||||||||||||||||||
260 | if (!intname.s
| 0-4549 | ||||||||||||||||||||||||
261 | goto never executed: memerr;goto memerr; never executed: goto memerr; | 0 | ||||||||||||||||||||||||
262 | for (i = 0; i < sk_X509_NAME_ENTRY_num(a->entries)
| 4549-25517 | ||||||||||||||||||||||||
263 | entry = sk_X509_NAME_ENTRY_value(a->entries, i); | - | ||||||||||||||||||||||||
264 | if (entry->set != set
| 3217-22300 | ||||||||||||||||||||||||
265 | entries = sk_X509_NAME_ENTRY_new_null(); | - | ||||||||||||||||||||||||
266 | if (!entries
| 0-22300 | ||||||||||||||||||||||||
267 | goto never executed: memerr;goto memerr; never executed: goto memerr; | 0 | ||||||||||||||||||||||||
268 | if (!sk_STACK_OF_X509_NAME_ENTRY_push(intname.s, entries)
| 0-22300 | ||||||||||||||||||||||||
269 | sk_X509_NAME_ENTRY_free(entries); | - | ||||||||||||||||||||||||
270 | goto never executed: memerr;goto memerr; never executed: goto memerr; | 0 | ||||||||||||||||||||||||
271 | } | - | ||||||||||||||||||||||||
272 | set = entry->set; | - | ||||||||||||||||||||||||
273 | } executed 22300 times by 1 test: end of block Executed by:
| 22300 | ||||||||||||||||||||||||
274 | if (!sk_X509_NAME_ENTRY_push(entries, entry)
| 0-25517 | ||||||||||||||||||||||||
275 | goto never executed: memerr;goto memerr; never executed: goto memerr; | 0 | ||||||||||||||||||||||||
276 | } executed 25517 times by 1 test: end of block Executed by:
| 25517 | ||||||||||||||||||||||||
277 | len = ASN1_item_ex_i2d(&intname.a, | - | ||||||||||||||||||||||||
278 | ((void *)0) | - | ||||||||||||||||||||||||
279 | , | - | ||||||||||||||||||||||||
280 | (&(X509_NAME_INTERNAL_it)), -1, -1); | - | ||||||||||||||||||||||||
281 | if (!BUF_MEM_grow(a->bytes, len)
| 0-4549 | ||||||||||||||||||||||||
282 | goto never executed: memerr;goto memerr; never executed: goto memerr; | 0 | ||||||||||||||||||||||||
283 | p = (unsigned char *)a->bytes->data; | - | ||||||||||||||||||||||||
284 | ASN1_item_ex_i2d(&intname.a, | - | ||||||||||||||||||||||||
285 | &p, (&(X509_NAME_INTERNAL_it)), -1, -1); | - | ||||||||||||||||||||||||
286 | sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname.s, | - | ||||||||||||||||||||||||
287 | local_sk_X509_NAME_ENTRY_free); | - | ||||||||||||||||||||||||
288 | a->modified = 0; | - | ||||||||||||||||||||||||
289 | return executed 4549 times by 1 test: len;return len; Executed by:
executed 4549 times by 1 test: return len; Executed by:
| 4549 | ||||||||||||||||||||||||
290 | memerr: | - | ||||||||||||||||||||||||
291 | sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname.s, | - | ||||||||||||||||||||||||
292 | local_sk_X509_NAME_ENTRY_free); | - | ||||||||||||||||||||||||
293 | ERR_put_error(13,(203),((1|64)),__FILE__,276); | - | ||||||||||||||||||||||||
294 | return never executed: -1;return -1; never executed: return -1; | 0 | ||||||||||||||||||||||||
295 | } | - | ||||||||||||||||||||||||
296 | - | |||||||||||||||||||||||||
297 | static int x509_name_ex_print(BIO *out, ASN1_VALUE **pval, | - | ||||||||||||||||||||||||
298 | int indent, | - | ||||||||||||||||||||||||
299 | const char *fname, const ASN1_PCTX *pctx) | - | ||||||||||||||||||||||||
300 | { | - | ||||||||||||||||||||||||
301 | if (X509_NAME_print_ex(out, (const X509_NAME *)*pval,
| 0-1163 | ||||||||||||||||||||||||
302 | indent, pctx->nm_flags) <= 0
| 0-1163 | ||||||||||||||||||||||||
303 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
304 | return executed 1163 times by 1 test: 2;return 2; Executed by:
executed 1163 times by 1 test: return 2; Executed by:
| 1163 | ||||||||||||||||||||||||
305 | } | - | ||||||||||||||||||||||||
306 | static int x509_name_canon(X509_NAME *a) | - | ||||||||||||||||||||||||
307 | { | - | ||||||||||||||||||||||||
308 | unsigned char *p; | - | ||||||||||||||||||||||||
309 | struct stack_st_STACK_OF_X509_NAME_ENTRY *intname; | - | ||||||||||||||||||||||||
310 | struct stack_st_X509_NAME_ENTRY *entries = | - | ||||||||||||||||||||||||
311 | ((void *)0) | - | ||||||||||||||||||||||||
312 | ; | - | ||||||||||||||||||||||||
313 | X509_NAME_ENTRY *entry, *tmpentry = | - | ||||||||||||||||||||||||
314 | ((void *)0) | - | ||||||||||||||||||||||||
315 | ; | - | ||||||||||||||||||||||||
316 | int i, set = -1, ret = 0, len; | - | ||||||||||||||||||||||||
317 | - | |||||||||||||||||||||||||
318 | CRYPTO_free(a->canon_enc, __FILE__, 308); | - | ||||||||||||||||||||||||
319 | a->canon_enc = | - | ||||||||||||||||||||||||
320 | ((void *)0) | - | ||||||||||||||||||||||||
321 | ; | - | ||||||||||||||||||||||||
322 | - | |||||||||||||||||||||||||
323 | if (sk_X509_NAME_ENTRY_num(a->entries) == 0
| 40774-87456 | ||||||||||||||||||||||||
324 | a->canon_enclen = 0; | - | ||||||||||||||||||||||||
325 | return executed 87456 times by 1 test: 1;return 1; Executed by:
executed 87456 times by 1 test: return 1; Executed by:
| 87456 | ||||||||||||||||||||||||
326 | } | - | ||||||||||||||||||||||||
327 | intname = sk_STACK_OF_X509_NAME_ENTRY_new_null(); | - | ||||||||||||||||||||||||
328 | if (intname ==
| 0-40774 | ||||||||||||||||||||||||
329 | ((void *)0)
| 0-40774 | ||||||||||||||||||||||||
330 | ) { | - | ||||||||||||||||||||||||
331 | ERR_put_error(11,(156),((1|64)),__FILE__,317); | - | ||||||||||||||||||||||||
332 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
333 | } | - | ||||||||||||||||||||||||
334 | for (i = 0; i < sk_X509_NAME_ENTRY_num(a->entries)
| 36118-120201 | ||||||||||||||||||||||||
335 | entry = sk_X509_NAME_ENTRY_value(a->entries, i); | - | ||||||||||||||||||||||||
336 | if (entry->set != set
| 25872-94329 | ||||||||||||||||||||||||
337 | entries = sk_X509_NAME_ENTRY_new_null(); | - | ||||||||||||||||||||||||
338 | if (entries ==
| 0-94329 | ||||||||||||||||||||||||
339 | ((void *)0)
| 0-94329 | ||||||||||||||||||||||||
340 | ) | - | ||||||||||||||||||||||||
341 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
342 | if (!sk_STACK_OF_X509_NAME_ENTRY_push(intname, entries)
| 0-94329 | ||||||||||||||||||||||||
343 | sk_X509_NAME_ENTRY_free(entries); | - | ||||||||||||||||||||||||
344 | ERR_put_error(11,(156),((1|64)),__FILE__,328); | - | ||||||||||||||||||||||||
345 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
346 | } | - | ||||||||||||||||||||||||
347 | set = entry->set; | - | ||||||||||||||||||||||||
348 | } executed 94329 times by 1 test: end of block Executed by:
| 94329 | ||||||||||||||||||||||||
349 | tmpentry = X509_NAME_ENTRY_new(); | - | ||||||||||||||||||||||||
350 | if (tmpentry ==
| 0-120201 | ||||||||||||||||||||||||
351 | ((void *)0)
| 0-120201 | ||||||||||||||||||||||||
352 | ) { | - | ||||||||||||||||||||||||
353 | ERR_put_error(11,(156),((1|64)),__FILE__,335); | - | ||||||||||||||||||||||||
354 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
355 | } | - | ||||||||||||||||||||||||
356 | tmpentry->object = OBJ_dup(entry->object); | - | ||||||||||||||||||||||||
357 | if (tmpentry->object ==
| 0-120201 | ||||||||||||||||||||||||
358 | ((void *)0)
| 0-120201 | ||||||||||||||||||||||||
359 | ) { | - | ||||||||||||||||||||||||
360 | ERR_put_error(11,(156),((1|64)),__FILE__,340); | - | ||||||||||||||||||||||||
361 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
362 | } | - | ||||||||||||||||||||||||
363 | if (!asn1_string_canon(tmpentry->value, entry->value)
| 4656-115545 | ||||||||||||||||||||||||
364 | goto executed 4656 times by 1 test: err;goto err; Executed by:
executed 4656 times by 1 test: goto err; Executed by:
| 4656 | ||||||||||||||||||||||||
365 | if (!sk_X509_NAME_ENTRY_push(entries, tmpentry)
| 0-115545 | ||||||||||||||||||||||||
366 | ERR_put_error(11,(156),((1|64)),__FILE__,346); | - | ||||||||||||||||||||||||
367 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
368 | } | - | ||||||||||||||||||||||||
369 | tmpentry = | - | ||||||||||||||||||||||||
370 | ((void *)0) | - | ||||||||||||||||||||||||
371 | ; | - | ||||||||||||||||||||||||
372 | } executed 115545 times by 1 test: end of block Executed by:
| 115545 | ||||||||||||||||||||||||
373 | - | |||||||||||||||||||||||||
374 | - | |||||||||||||||||||||||||
375 | len = i2d_name_canon(intname, | - | ||||||||||||||||||||||||
376 | ((void *)0) | - | ||||||||||||||||||||||||
377 | ); | - | ||||||||||||||||||||||||
378 | if (len < 0
| 0-36118 | ||||||||||||||||||||||||
379 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
380 | a->canon_enclen = len; | - | ||||||||||||||||||||||||
381 | - | |||||||||||||||||||||||||
382 | p = CRYPTO_malloc(a->canon_enclen, __FILE__, 358); | - | ||||||||||||||||||||||||
383 | if (p ==
| 0-36118 | ||||||||||||||||||||||||
384 | ((void *)0)
| 0-36118 | ||||||||||||||||||||||||
385 | ) { | - | ||||||||||||||||||||||||
386 | ERR_put_error(11,(156),((1|64)),__FILE__,360); | - | ||||||||||||||||||||||||
387 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
388 | } | - | ||||||||||||||||||||||||
389 | - | |||||||||||||||||||||||||
390 | a->canon_enc = p; | - | ||||||||||||||||||||||||
391 | - | |||||||||||||||||||||||||
392 | i2d_name_canon(intname, &p); | - | ||||||||||||||||||||||||
393 | - | |||||||||||||||||||||||||
394 | ret = 1; | - | ||||||||||||||||||||||||
395 | - | |||||||||||||||||||||||||
396 | err: code before this statement executed 36118 times by 1 test: err: Executed by:
| 36118 | ||||||||||||||||||||||||
397 | X509_NAME_ENTRY_free(tmpentry); | - | ||||||||||||||||||||||||
398 | sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname, | - | ||||||||||||||||||||||||
399 | local_sk_X509_NAME_ENTRY_pop_free); | - | ||||||||||||||||||||||||
400 | return executed 40774 times by 1 test: ret;return ret; Executed by:
executed 40774 times by 1 test: return ret; Executed by:
| 40774 | ||||||||||||||||||||||||
401 | } | - | ||||||||||||||||||||||||
402 | static int asn1_string_canon(ASN1_STRING *out, const ASN1_STRING *in) | - | ||||||||||||||||||||||||
403 | { | - | ||||||||||||||||||||||||
404 | unsigned char *to, *from; | - | ||||||||||||||||||||||||
405 | int len, i; | - | ||||||||||||||||||||||||
406 | - | |||||||||||||||||||||||||
407 | - | |||||||||||||||||||||||||
408 | if (!(ASN1_tag2bit(in->type) & (0x2000 | 0x0800 | 0x0100 | 0x0002 | 0x0004 | 0x0010 | 0x0040))
| 20492-99709 | ||||||||||||||||||||||||
409 | if (!ASN1_STRING_copy(out, in)
| 0-20492 | ||||||||||||||||||||||||
410 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
411 | return executed 20492 times by 1 test: 1;return 1; Executed by:
executed 20492 times by 1 test: return 1; Executed by:
| 20492 | ||||||||||||||||||||||||
412 | } | - | ||||||||||||||||||||||||
413 | - | |||||||||||||||||||||||||
414 | out->type = 12; | - | ||||||||||||||||||||||||
415 | out->length = ASN1_STRING_to_UTF8(&out->data, in); | - | ||||||||||||||||||||||||
416 | if (out->length == -1
| 4656-95053 | ||||||||||||||||||||||||
417 | return executed 4656 times by 1 test: 0;return 0; Executed by:
executed 4656 times by 1 test: return 0; Executed by:
| 4656 | ||||||||||||||||||||||||
418 | - | |||||||||||||||||||||||||
419 | to = out->data; | - | ||||||||||||||||||||||||
420 | from = to; | - | ||||||||||||||||||||||||
421 | - | |||||||||||||||||||||||||
422 | len = out->length; | - | ||||||||||||||||||||||||
423 | while (len > 0
| 2177-69703 | ||||||||||||||||||||||||
424 | from++; | - | ||||||||||||||||||||||||
425 | len--; | - | ||||||||||||||||||||||||
426 | } executed 2177 times by 1 test: end of block Executed by:
| 2177 | ||||||||||||||||||||||||
427 | - | |||||||||||||||||||||||||
428 | to = from + len; | - | ||||||||||||||||||||||||
429 | - | |||||||||||||||||||||||||
430 | - | |||||||||||||||||||||||||
431 | while (len > 0
| 1142-68668 | ||||||||||||||||||||||||
432 | to--; | - | ||||||||||||||||||||||||
433 | len--; | - | ||||||||||||||||||||||||
434 | } executed 1142 times by 1 test: end of block Executed by:
| 1142 | ||||||||||||||||||||||||
435 | - | |||||||||||||||||||||||||
436 | to = out->data; | - | ||||||||||||||||||||||||
437 | - | |||||||||||||||||||||||||
438 | i = 0; | - | ||||||||||||||||||||||||
439 | while (i < len
| 95053-867351 | ||||||||||||||||||||||||
440 | - | |||||||||||||||||||||||||
441 | if (!(((*from) & ~127) == 0)
| 212781-654570 | ||||||||||||||||||||||||
442 | *to++ = *from++; | - | ||||||||||||||||||||||||
443 | i++; | - | ||||||||||||||||||||||||
444 | } executed 212781 times by 1 test: end of block Executed by:
| 212781 | ||||||||||||||||||||||||
445 | - | |||||||||||||||||||||||||
446 | else if ((
| 54920-599650 | ||||||||||||||||||||||||
447 | - | |||||||||||||||||||||||||
448 | *to++ = ' '; | - | ||||||||||||||||||||||||
449 | - | |||||||||||||||||||||||||
450 | - | |||||||||||||||||||||||||
451 | - | |||||||||||||||||||||||||
452 | - | |||||||||||||||||||||||||
453 | - | |||||||||||||||||||||||||
454 | do { | - | ||||||||||||||||||||||||
455 | from++; | - | ||||||||||||||||||||||||
456 | i++; | - | ||||||||||||||||||||||||
457 | } executed 56267 times by 1 test: end of block Executed by:
| 56267 | ||||||||||||||||||||||||
458 | while ((
| 1347-54920 | ||||||||||||||||||||||||
459 | } executed 54920 times by 1 test: else {end of block Executed by:
| 54920 | ||||||||||||||||||||||||
460 | *to++ = ossl_tolower(*from); | - | ||||||||||||||||||||||||
461 | from++; | - | ||||||||||||||||||||||||
462 | i++; | - | ||||||||||||||||||||||||
463 | } executed 599650 times by 1 test: end of block Executed by:
| 599650 | ||||||||||||||||||||||||
464 | } | - | ||||||||||||||||||||||||
465 | - | |||||||||||||||||||||||||
466 | out->length = to - out->data; | - | ||||||||||||||||||||||||
467 | - | |||||||||||||||||||||||||
468 | return executed 95053 times by 1 test: 1;return 1; Executed by:
executed 95053 times by 1 test: return 1; Executed by:
| 95053 | ||||||||||||||||||||||||
469 | - | |||||||||||||||||||||||||
470 | } | - | ||||||||||||||||||||||||
471 | - | |||||||||||||||||||||||||
472 | static int i2d_name_canon(struct stack_st_STACK_OF_X509_NAME_ENTRY * _intname, | - | ||||||||||||||||||||||||
473 | unsigned char **in) | - | ||||||||||||||||||||||||
474 | { | - | ||||||||||||||||||||||||
475 | int i, len, ltmp; | - | ||||||||||||||||||||||||
476 | ASN1_VALUE *v; | - | ||||||||||||||||||||||||
477 | struct stack_st_ASN1_VALUE *intname = (struct stack_st_ASN1_VALUE *)_intname; | - | ||||||||||||||||||||||||
478 | - | |||||||||||||||||||||||||
479 | len = 0; | - | ||||||||||||||||||||||||
480 | for (i = 0; i < sk_ASN1_VALUE_num(intname)
| 72236-150480 | ||||||||||||||||||||||||
481 | v = sk_ASN1_VALUE_value(intname, i); | - | ||||||||||||||||||||||||
482 | ltmp = ASN1_item_ex_i2d(&v, in, | - | ||||||||||||||||||||||||
483 | (&(X509_NAME_ENTRIES_it)), -1, -1); | - | ||||||||||||||||||||||||
484 | if (ltmp < 0
| 0-150480 | ||||||||||||||||||||||||
485 | return never executed: ltmp;return ltmp; never executed: return ltmp; | 0 | ||||||||||||||||||||||||
486 | len += ltmp; | - | ||||||||||||||||||||||||
487 | } executed 150480 times by 1 test: end of block Executed by:
| 150480 | ||||||||||||||||||||||||
488 | return executed 72236 times by 1 test: len;return len; Executed by:
executed 72236 times by 1 test: return len; Executed by:
| 72236 | ||||||||||||||||||||||||
489 | } | - | ||||||||||||||||||||||||
490 | - | |||||||||||||||||||||||||
491 | int X509_NAME_set(X509_NAME **xn, X509_NAME *name) | - | ||||||||||||||||||||||||
492 | { | - | ||||||||||||||||||||||||
493 | if (*
| 0-561 | ||||||||||||||||||||||||
494 | return never executed: *xn != return *xn != ((void *)0) ; never executed: return *xn != ((void *)0) ; | 0 | ||||||||||||||||||||||||
495 | ((void *)0) never executed: return *xn != ((void *)0) ; | 0 | ||||||||||||||||||||||||
496 | ; never executed: return *xn != ((void *)0) ; | 0 | ||||||||||||||||||||||||
497 | if ((
| 0-561 | ||||||||||||||||||||||||
498 | ((void *)0)
| 0-561 | ||||||||||||||||||||||||
499 | ) | - | ||||||||||||||||||||||||
500 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
501 | X509_NAME_free(*xn); | - | ||||||||||||||||||||||||
502 | *xn = name; | - | ||||||||||||||||||||||||
503 | return executed 561 times by 1 test: 1;return 1; Executed by:
executed 561 times by 1 test: return 1; Executed by:
| 561 | ||||||||||||||||||||||||
504 | } | - | ||||||||||||||||||||||||
505 | - | |||||||||||||||||||||||||
506 | int X509_NAME_print(BIO *bp, const X509_NAME *name, int obase) | - | ||||||||||||||||||||||||
507 | { | - | ||||||||||||||||||||||||
508 | char *s, *c, *b; | - | ||||||||||||||||||||||||
509 | int l, i; | - | ||||||||||||||||||||||||
510 | - | |||||||||||||||||||||||||
511 | l = 80 - 2 - obase; | - | ||||||||||||||||||||||||
512 | - | |||||||||||||||||||||||||
513 | b = X509_NAME_oneline(name, | - | ||||||||||||||||||||||||
514 | ((void *)0) | - | ||||||||||||||||||||||||
515 | , 0); | - | ||||||||||||||||||||||||
516 | if (!b
| 0-5796 | ||||||||||||||||||||||||
517 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
518 | if (!*b
| 1749-4047 | ||||||||||||||||||||||||
519 | CRYPTO_free(b, __FILE__, 504); | - | ||||||||||||||||||||||||
520 | return executed 4047 times by 1 test: 1;return 1; Executed by:
executed 4047 times by 1 test: return 1; Executed by:
| 4047 | ||||||||||||||||||||||||
521 | } | - | ||||||||||||||||||||||||
522 | s = b + 1; | - | ||||||||||||||||||||||||
523 | - | |||||||||||||||||||||||||
524 | c = s; | - | ||||||||||||||||||||||||
525 | for (;;) { | - | ||||||||||||||||||||||||
526 | if (((*
| 15616-308618 | ||||||||||||||||||||||||
527 | ((
| 1348-11147 | ||||||||||||||||||||||||
528 | ((
| 620-2457 | ||||||||||||||||||||||||
529 | ))) || (*
| 1749-319300 | ||||||||||||||||||||||||
530 | { | - | ||||||||||||||||||||||||
531 | i = s - c; | - | ||||||||||||||||||||||||
532 | if (BIO_write(bp, c, i) != i
| 0-4934 | ||||||||||||||||||||||||
533 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
534 | c = s + 1; | - | ||||||||||||||||||||||||
535 | if (*
| 1749-3185 | ||||||||||||||||||||||||
536 | if (BIO_write(bp, ", ", 2) != 2
| 0-3185 | ||||||||||||||||||||||||
537 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
538 | } executed 3185 times by 1 test: end of block Executed by:
| 3185 | ||||||||||||||||||||||||
539 | l--; | - | ||||||||||||||||||||||||
540 | } executed 4934 times by 1 test: end of block Executed by:
| 4934 | ||||||||||||||||||||||||
541 | if (*
| 1749-322485 | ||||||||||||||||||||||||
542 | break; executed 1749 times by 1 test: break; Executed by:
| 1749 | ||||||||||||||||||||||||
543 | s++; | - | ||||||||||||||||||||||||
544 | l--; | - | ||||||||||||||||||||||||
545 | } executed 322485 times by 1 test: end of block Executed by:
| 322485 | ||||||||||||||||||||||||
546 | - | |||||||||||||||||||||||||
547 | CRYPTO_free(b, __FILE__, 532); | - | ||||||||||||||||||||||||
548 | return executed 1749 times by 1 test: 1;return 1; Executed by:
executed 1749 times by 1 test: return 1; Executed by:
| 1749 | ||||||||||||||||||||||||
549 | err: | - | ||||||||||||||||||||||||
550 | ERR_put_error(11,(117),(7),__FILE__,535); | - | ||||||||||||||||||||||||
551 | CRYPTO_free(b, __FILE__, 536); | - | ||||||||||||||||||||||||
552 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
553 | } | - | ||||||||||||||||||||||||
554 | - | |||||||||||||||||||||||||
555 | int X509_NAME_get0_der(X509_NAME *nm, const unsigned char **pder, | - | ||||||||||||||||||||||||
556 | size_t *pderlen) | - | ||||||||||||||||||||||||
557 | { | - | ||||||||||||||||||||||||
558 | - | |||||||||||||||||||||||||
559 | if (i2d_X509_NAME(nm,
| 0 | ||||||||||||||||||||||||
560 | ((void *)0)
| 0 | ||||||||||||||||||||||||
561 | ) <= 0
| 0 | ||||||||||||||||||||||||
562 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
563 | if (pder !=
| 0 | ||||||||||||||||||||||||
564 | ((void *)0)
| 0 | ||||||||||||||||||||||||
565 | ) | - | ||||||||||||||||||||||||
566 | * never executed: pder = (unsigned char *)nm->bytes->data;*pder = (unsigned char *)nm->bytes->data; never executed: *pder = (unsigned char *)nm->bytes->data; | 0 | ||||||||||||||||||||||||
567 | if (pderlen !=
| 0 | ||||||||||||||||||||||||
568 | ((void *)0)
| 0 | ||||||||||||||||||||||||
569 | ) | - | ||||||||||||||||||||||||
570 | * never executed: pderlen = nm->bytes->length;*pderlen = nm->bytes->length; never executed: *pderlen = nm->bytes->length; | 0 | ||||||||||||||||||||||||
571 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||||||||||||||||||||
572 | } | - | ||||||||||||||||||||||||
Switch to Source code | Preprocessed file |