Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/x509/x509_att.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||||||||
2 | - | |||||||||||||||||||||||||
3 | int X509at_get_attr_count(const struct stack_st_X509_ATTRIBUTE *x) | - | ||||||||||||||||||||||||
4 | { | - | ||||||||||||||||||||||||
5 | return executed 192 times by 1 test: sk_X509_ATTRIBUTE_num(x);return sk_X509_ATTRIBUTE_num(x); Executed by:
executed 192 times by 1 test: return sk_X509_ATTRIBUTE_num(x); Executed by:
| 192 | ||||||||||||||||||||||||
6 | } | - | ||||||||||||||||||||||||
7 | - | |||||||||||||||||||||||||
8 | int X509at_get_attr_by_NID(const struct stack_st_X509_ATTRIBUTE *x, int nid, | - | ||||||||||||||||||||||||
9 | int lastpos) | - | ||||||||||||||||||||||||
10 | { | - | ||||||||||||||||||||||||
11 | const ASN1_OBJECT *obj = OBJ_nid2obj(nid); | - | ||||||||||||||||||||||||
12 | - | |||||||||||||||||||||||||
13 | if (obj ==
| 0-119 | ||||||||||||||||||||||||
14 | ((void *)0)
| 0-119 | ||||||||||||||||||||||||
15 | ) | - | ||||||||||||||||||||||||
16 | return never executed: -2;return -2; never executed: return -2; | 0 | ||||||||||||||||||||||||
17 | return executed 119 times by 1 test: X509at_get_attr_by_OBJ(x, obj, lastpos);return X509at_get_attr_by_OBJ(x, obj, lastpos); Executed by:
executed 119 times by 1 test: return X509at_get_attr_by_OBJ(x, obj, lastpos); Executed by:
| 119 | ||||||||||||||||||||||||
18 | } | - | ||||||||||||||||||||||||
19 | - | |||||||||||||||||||||||||
20 | int X509at_get_attr_by_OBJ(const struct stack_st_X509_ATTRIBUTE *sk, | - | ||||||||||||||||||||||||
21 | const ASN1_OBJECT *obj, int lastpos) | - | ||||||||||||||||||||||||
22 | { | - | ||||||||||||||||||||||||
23 | int n; | - | ||||||||||||||||||||||||
24 | X509_ATTRIBUTE *ex; | - | ||||||||||||||||||||||||
25 | - | |||||||||||||||||||||||||
26 | if (sk ==
| 20-221 | ||||||||||||||||||||||||
27 | ((void *)0)
| 20-221 | ||||||||||||||||||||||||
28 | ) | - | ||||||||||||||||||||||||
29 | return executed 20 times by 1 test: -1;return -1; Executed by:
executed 20 times by 1 test: return -1; Executed by:
| 20 | ||||||||||||||||||||||||
30 | lastpos++; | - | ||||||||||||||||||||||||
31 | if (lastpos < 0
| 61-160 | ||||||||||||||||||||||||
32 | lastpos = 0; executed 61 times by 1 test: lastpos = 0; Executed by:
| 61 | ||||||||||||||||||||||||
33 | n = sk_X509_ATTRIBUTE_num(sk); | - | ||||||||||||||||||||||||
34 | for (; lastpos < n
| 137-510 | ||||||||||||||||||||||||
35 | ex = sk_X509_ATTRIBUTE_value(sk, lastpos); | - | ||||||||||||||||||||||||
36 | if (OBJ_cmp(ex->object, obj) == 0
| 84-426 | ||||||||||||||||||||||||
37 | return executed 84 times by 1 test: lastpos;return lastpos; Executed by:
executed 84 times by 1 test: return lastpos; Executed by:
| 84 | ||||||||||||||||||||||||
38 | } executed 426 times by 1 test: end of block Executed by:
| 426 | ||||||||||||||||||||||||
39 | return executed 137 times by 1 test: -1;return -1; Executed by:
executed 137 times by 1 test: return -1; Executed by:
| 137 | ||||||||||||||||||||||||
40 | } | - | ||||||||||||||||||||||||
41 | - | |||||||||||||||||||||||||
42 | X509_ATTRIBUTE *X509at_get_attr(const struct stack_st_X509_ATTRIBUTE *x, int loc) | - | ||||||||||||||||||||||||
43 | { | - | ||||||||||||||||||||||||
44 | if (x ==
| 20-104 | ||||||||||||||||||||||||
45 | ((void *)0)
| 20-104 | ||||||||||||||||||||||||
46 | || sk_X509_ATTRIBUTE_num(x) <= loc
| 0-104 | ||||||||||||||||||||||||
47 | return executed 39 times by 1 test: return ((void *)0) ; Executed by:
executed 39 times by 1 test: return ((void *)0) ; Executed by:
| 39 | ||||||||||||||||||||||||
48 | ((void *)0) executed 39 times by 1 test: return ((void *)0) ; Executed by:
| 39 | ||||||||||||||||||||||||
49 | ; executed 39 times by 1 test: return ((void *)0) ; Executed by:
| 39 | ||||||||||||||||||||||||
50 | - | |||||||||||||||||||||||||
51 | return executed 85 times by 1 test: sk_X509_ATTRIBUTE_value(x, loc);return sk_X509_ATTRIBUTE_value(x, loc); Executed by:
executed 85 times by 1 test: return sk_X509_ATTRIBUTE_value(x, loc); Executed by:
| 85 | ||||||||||||||||||||||||
52 | } | - | ||||||||||||||||||||||||
53 | - | |||||||||||||||||||||||||
54 | X509_ATTRIBUTE *X509at_delete_attr(struct stack_st_X509_ATTRIBUTE *x, int loc) | - | ||||||||||||||||||||||||
55 | { | - | ||||||||||||||||||||||||
56 | X509_ATTRIBUTE *ret; | - | ||||||||||||||||||||||||
57 | - | |||||||||||||||||||||||||
58 | if (x ==
| 0 | ||||||||||||||||||||||||
59 | ((void *)0)
| 0 | ||||||||||||||||||||||||
60 | || sk_X509_ATTRIBUTE_num(x) <= loc
| 0 | ||||||||||||||||||||||||
61 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
62 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
63 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
64 | ret = sk_X509_ATTRIBUTE_delete(x, loc); | - | ||||||||||||||||||||||||
65 | return never executed: ret;return ret; never executed: return ret; | 0 | ||||||||||||||||||||||||
66 | } | - | ||||||||||||||||||||||||
67 | - | |||||||||||||||||||||||||
68 | struct stack_st_X509_ATTRIBUTE *X509at_add1_attr(struct stack_st_X509_ATTRIBUTE **x, | - | ||||||||||||||||||||||||
69 | X509_ATTRIBUTE *attr) | - | ||||||||||||||||||||||||
70 | { | - | ||||||||||||||||||||||||
71 | X509_ATTRIBUTE *new_attr = | - | ||||||||||||||||||||||||
72 | ((void *)0) | - | ||||||||||||||||||||||||
73 | ; | - | ||||||||||||||||||||||||
74 | struct stack_st_X509_ATTRIBUTE *sk = | - | ||||||||||||||||||||||||
75 | ((void *)0) | - | ||||||||||||||||||||||||
76 | ; | - | ||||||||||||||||||||||||
77 | - | |||||||||||||||||||||||||
78 | if (x ==
| 0-209 | ||||||||||||||||||||||||
79 | ((void *)0)
| 0-209 | ||||||||||||||||||||||||
80 | ) { | - | ||||||||||||||||||||||||
81 | ERR_put_error(11,(135),((3|64)),__FILE__,80); | - | ||||||||||||||||||||||||
82 | goto never executed: err2;goto err2; never executed: goto err2; | 0 | ||||||||||||||||||||||||
83 | } | - | ||||||||||||||||||||||||
84 | - | |||||||||||||||||||||||||
85 | if (*
| 0-209 | ||||||||||||||||||||||||
86 | ((void *)0)
| 0-209 | ||||||||||||||||||||||||
87 | ) { | - | ||||||||||||||||||||||||
88 | if ((
| 0 | ||||||||||||||||||||||||
89 | ((void *)0)
| 0 | ||||||||||||||||||||||||
90 | ) | - | ||||||||||||||||||||||||
91 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
92 | } never executed: elseend of block | 0 | ||||||||||||||||||||||||
93 | sk = *x; executed 209 times by 1 test: sk = *x; Executed by:
| 209 | ||||||||||||||||||||||||
94 | - | |||||||||||||||||||||||||
95 | if ((
| 0-209 | ||||||||||||||||||||||||
96 | ((void *)0)
| 0-209 | ||||||||||||||||||||||||
97 | ) | - | ||||||||||||||||||||||||
98 | goto never executed: err2;goto err2; never executed: goto err2; | 0 | ||||||||||||||||||||||||
99 | if (!sk_X509_ATTRIBUTE_push(sk, new_attr)
| 0-209 | ||||||||||||||||||||||||
100 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
101 | if (*
| 0-209 | ||||||||||||||||||||||||
102 | ((void *)0)
| 0-209 | ||||||||||||||||||||||||
103 | ) | - | ||||||||||||||||||||||||
104 | * never executed: x = sk;*x = sk; never executed: *x = sk; | 0 | ||||||||||||||||||||||||
105 | return executed 209 times by 1 test: sk;return sk; Executed by:
executed 209 times by 1 test: return sk; Executed by:
| 209 | ||||||||||||||||||||||||
106 | err: | - | ||||||||||||||||||||||||
107 | ERR_put_error(11,(135),((1|64)),__FILE__,98); | - | ||||||||||||||||||||||||
108 | err2: code before this statement never executed: err2: | 0 | ||||||||||||||||||||||||
109 | X509_ATTRIBUTE_free(new_attr); | - | ||||||||||||||||||||||||
110 | sk_X509_ATTRIBUTE_free(sk); | - | ||||||||||||||||||||||||
111 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
112 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
113 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
114 | } | - | ||||||||||||||||||||||||
115 | - | |||||||||||||||||||||||||
116 | struct stack_st_X509_ATTRIBUTE *X509at_add1_attr_by_OBJ(struct stack_st_X509_ATTRIBUTE | - | ||||||||||||||||||||||||
117 | **x, const ASN1_OBJECT *obj, | - | ||||||||||||||||||||||||
118 | int type, | - | ||||||||||||||||||||||||
119 | const unsigned char *bytes, | - | ||||||||||||||||||||||||
120 | int len) | - | ||||||||||||||||||||||||
121 | { | - | ||||||||||||||||||||||||
122 | X509_ATTRIBUTE *attr; | - | ||||||||||||||||||||||||
123 | struct stack_st_X509_ATTRIBUTE *ret; | - | ||||||||||||||||||||||||
124 | attr = X509_ATTRIBUTE_create_by_OBJ( | - | ||||||||||||||||||||||||
125 | ((void *)0) | - | ||||||||||||||||||||||||
126 | , obj, type, bytes, len); | - | ||||||||||||||||||||||||
127 | if (!attr
| 0 | ||||||||||||||||||||||||
128 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
129 | ret = X509at_add1_attr(x, attr); | - | ||||||||||||||||||||||||
130 | X509_ATTRIBUTE_free(attr); | - | ||||||||||||||||||||||||
131 | return never executed: ret;return ret; never executed: return ret; | 0 | ||||||||||||||||||||||||
132 | } | - | ||||||||||||||||||||||||
133 | - | |||||||||||||||||||||||||
134 | struct stack_st_X509_ATTRIBUTE *X509at_add1_attr_by_NID(struct stack_st_X509_ATTRIBUTE | - | ||||||||||||||||||||||||
135 | **x, int nid, int type, | - | ||||||||||||||||||||||||
136 | const unsigned char *bytes, | - | ||||||||||||||||||||||||
137 | int len) | - | ||||||||||||||||||||||||
138 | { | - | ||||||||||||||||||||||||
139 | X509_ATTRIBUTE *attr; | - | ||||||||||||||||||||||||
140 | struct stack_st_X509_ATTRIBUTE *ret; | - | ||||||||||||||||||||||||
141 | attr = X509_ATTRIBUTE_create_by_NID( | - | ||||||||||||||||||||||||
142 | ((void *)0) | - | ||||||||||||||||||||||||
143 | , nid, type, bytes, len); | - | ||||||||||||||||||||||||
144 | if (!attr
| 0-209 | ||||||||||||||||||||||||
145 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
146 | ret = X509at_add1_attr(x, attr); | - | ||||||||||||||||||||||||
147 | X509_ATTRIBUTE_free(attr); | - | ||||||||||||||||||||||||
148 | return executed 209 times by 1 test: ret;return ret; Executed by:
executed 209 times by 1 test: return ret; Executed by:
| 209 | ||||||||||||||||||||||||
149 | } | - | ||||||||||||||||||||||||
150 | - | |||||||||||||||||||||||||
151 | struct stack_st_X509_ATTRIBUTE *X509at_add1_attr_by_txt(struct stack_st_X509_ATTRIBUTE | - | ||||||||||||||||||||||||
152 | **x, const char *attrname, | - | ||||||||||||||||||||||||
153 | int type, | - | ||||||||||||||||||||||||
154 | const unsigned char *bytes, | - | ||||||||||||||||||||||||
155 | int len) | - | ||||||||||||||||||||||||
156 | { | - | ||||||||||||||||||||||||
157 | X509_ATTRIBUTE *attr; | - | ||||||||||||||||||||||||
158 | struct stack_st_X509_ATTRIBUTE *ret; | - | ||||||||||||||||||||||||
159 | attr = X509_ATTRIBUTE_create_by_txt( | - | ||||||||||||||||||||||||
160 | ((void *)0) | - | ||||||||||||||||||||||||
161 | , attrname, type, bytes, len); | - | ||||||||||||||||||||||||
162 | if (!attr
| 0 | ||||||||||||||||||||||||
163 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
164 | ret = X509at_add1_attr(x, attr); | - | ||||||||||||||||||||||||
165 | X509_ATTRIBUTE_free(attr); | - | ||||||||||||||||||||||||
166 | return never executed: ret;return ret; never executed: return ret; | 0 | ||||||||||||||||||||||||
167 | } | - | ||||||||||||||||||||||||
168 | - | |||||||||||||||||||||||||
169 | void *X509at_get0_data_by_OBJ(struct stack_st_X509_ATTRIBUTE *x, | - | ||||||||||||||||||||||||
170 | const ASN1_OBJECT *obj, int lastpos, int type) | - | ||||||||||||||||||||||||
171 | { | - | ||||||||||||||||||||||||
172 | int i; | - | ||||||||||||||||||||||||
173 | X509_ATTRIBUTE *at; | - | ||||||||||||||||||||||||
174 | i = X509at_get_attr_by_OBJ(x, obj, lastpos); | - | ||||||||||||||||||||||||
175 | if (i == -1
| 0-61 | ||||||||||||||||||||||||
176 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
177 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
178 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
179 | if ((
| 0-61 | ||||||||||||||||||||||||
180 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
181 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
182 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
183 | at = X509at_get_attr(x, i); | - | ||||||||||||||||||||||||
184 | if (lastpos <= -3
| 0-61 | ||||||||||||||||||||||||
185 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
186 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
187 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
188 | return executed 61 times by 1 test: X509_ATTRIBUTE_get0_data(at, 0, type, return X509_ATTRIBUTE_get0_data(at, 0, type, ((void *)0) ); Executed by:
executed 61 times by 1 test: return X509_ATTRIBUTE_get0_data(at, 0, type, ((void *)0) ); Executed by:
| 61 | ||||||||||||||||||||||||
189 | ((void *)0) executed 61 times by 1 test: return X509_ATTRIBUTE_get0_data(at, 0, type, ((void *)0) ); Executed by:
| 61 | ||||||||||||||||||||||||
190 | ); executed 61 times by 1 test: return X509_ATTRIBUTE_get0_data(at, 0, type, ((void *)0) ); Executed by:
| 61 | ||||||||||||||||||||||||
191 | } | - | ||||||||||||||||||||||||
192 | - | |||||||||||||||||||||||||
193 | X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid, | - | ||||||||||||||||||||||||
194 | int atrtype, const void *data, | - | ||||||||||||||||||||||||
195 | int len) | - | ||||||||||||||||||||||||
196 | { | - | ||||||||||||||||||||||||
197 | ASN1_OBJECT *obj; | - | ||||||||||||||||||||||||
198 | X509_ATTRIBUTE *ret; | - | ||||||||||||||||||||||||
199 | - | |||||||||||||||||||||||||
200 | obj = OBJ_nid2obj(nid); | - | ||||||||||||||||||||||||
201 | if (obj ==
| 0-209 | ||||||||||||||||||||||||
202 | ((void *)0)
| 0-209 | ||||||||||||||||||||||||
203 | ) { | - | ||||||||||||||||||||||||
204 | ERR_put_error(11,(136),(109),__FILE__,177); | - | ||||||||||||||||||||||||
205 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
206 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
207 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
208 | } | - | ||||||||||||||||||||||||
209 | ret = X509_ATTRIBUTE_create_by_OBJ(attr, obj, atrtype, data, len); | - | ||||||||||||||||||||||||
210 | if (ret ==
| 0-209 | ||||||||||||||||||||||||
211 | ((void *)0)
| 0-209 | ||||||||||||||||||||||||
212 | ) | - | ||||||||||||||||||||||||
213 | ASN1_OBJECT_free(obj); never executed: ASN1_OBJECT_free(obj); | 0 | ||||||||||||||||||||||||
214 | return executed 209 times by 1 test: ret;return ret; Executed by:
executed 209 times by 1 test: return ret; Executed by:
| 209 | ||||||||||||||||||||||||
215 | } | - | ||||||||||||||||||||||||
216 | - | |||||||||||||||||||||||||
217 | X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr, | - | ||||||||||||||||||||||||
218 | const ASN1_OBJECT *obj, | - | ||||||||||||||||||||||||
219 | int atrtype, const void *data, | - | ||||||||||||||||||||||||
220 | int len) | - | ||||||||||||||||||||||||
221 | { | - | ||||||||||||||||||||||||
222 | X509_ATTRIBUTE *ret; | - | ||||||||||||||||||||||||
223 | - | |||||||||||||||||||||||||
224 | if ((
| 0-209 | ||||||||||||||||||||||||
225 | ((void *)0)
| 0-209 | ||||||||||||||||||||||||
226 | )
| 0-209 | ||||||||||||||||||||||||
227 | ((void *)0)
| 0 | ||||||||||||||||||||||||
228 | )
| 0 | ||||||||||||||||||||||||
229 | if ((
| 0-209 | ||||||||||||||||||||||||
230 | ((void *)0)
| 0-209 | ||||||||||||||||||||||||
231 | ) { | - | ||||||||||||||||||||||||
232 | ERR_put_error(11,(137),((1|64)),__FILE__,196) | - | ||||||||||||||||||||||||
233 | ; | - | ||||||||||||||||||||||||
234 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
235 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
236 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
237 | } | - | ||||||||||||||||||||||||
238 | } executed 209 times by 1 test: elseend of block Executed by:
| 209 | ||||||||||||||||||||||||
239 | ret = *attr; never executed: ret = *attr; | 0 | ||||||||||||||||||||||||
240 | - | |||||||||||||||||||||||||
241 | if (!X509_ATTRIBUTE_set1_object(ret, obj)
| 0-209 | ||||||||||||||||||||||||
242 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
243 | if (!X509_ATTRIBUTE_set1_data(ret, atrtype, data, len)
| 0-209 | ||||||||||||||||||||||||
244 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
245 | - | |||||||||||||||||||||||||
246 | if ((
| 0-209 | ||||||||||||||||||||||||
247 | ((void *)0)
| 0-209 | ||||||||||||||||||||||||
248 | )
| 0-209 | ||||||||||||||||||||||||
249 | ((void *)0)
| 0 | ||||||||||||||||||||||||
250 | )
| 0 | ||||||||||||||||||||||||
251 | * never executed: attr = ret;*attr = ret; never executed: *attr = ret; | 0 | ||||||||||||||||||||||||
252 | return executed 209 times by 1 test: ret;return ret; Executed by:
executed 209 times by 1 test: return ret; Executed by:
| 209 | ||||||||||||||||||||||||
253 | err: | - | ||||||||||||||||||||||||
254 | if ((
| 0 | ||||||||||||||||||||||||
255 | ((void *)0)
| 0 | ||||||||||||||||||||||||
256 | )
| 0 | ||||||||||||||||||||||||
257 | X509_ATTRIBUTE_free(ret); never executed: X509_ATTRIBUTE_free(ret); | 0 | ||||||||||||||||||||||||
258 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
259 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
260 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
261 | } | - | ||||||||||||||||||||||||
262 | - | |||||||||||||||||||||||||
263 | X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr, | - | ||||||||||||||||||||||||
264 | const char *atrname, int type, | - | ||||||||||||||||||||||||
265 | const unsigned char *bytes, | - | ||||||||||||||||||||||||
266 | int len) | - | ||||||||||||||||||||||||
267 | { | - | ||||||||||||||||||||||||
268 | ASN1_OBJECT *obj; | - | ||||||||||||||||||||||||
269 | X509_ATTRIBUTE *nattr; | - | ||||||||||||||||||||||||
270 | - | |||||||||||||||||||||||||
271 | obj = OBJ_txt2obj(atrname, 0); | - | ||||||||||||||||||||||||
272 | if (obj ==
| 0 | ||||||||||||||||||||||||
273 | ((void *)0)
| 0 | ||||||||||||||||||||||||
274 | ) { | - | ||||||||||||||||||||||||
275 | ERR_put_error(11,(140),(119),__FILE__,227) | - | ||||||||||||||||||||||||
276 | ; | - | ||||||||||||||||||||||||
277 | ERR_add_error_data(2, "name=", atrname); | - | ||||||||||||||||||||||||
278 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
279 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
280 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
281 | } | - | ||||||||||||||||||||||||
282 | nattr = X509_ATTRIBUTE_create_by_OBJ(attr, obj, type, bytes, len); | - | ||||||||||||||||||||||||
283 | ASN1_OBJECT_free(obj); | - | ||||||||||||||||||||||||
284 | return never executed: nattr;return nattr; never executed: return nattr; | 0 | ||||||||||||||||||||||||
285 | } | - | ||||||||||||||||||||||||
286 | - | |||||||||||||||||||||||||
287 | int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj) | - | ||||||||||||||||||||||||
288 | { | - | ||||||||||||||||||||||||
289 | if ((
| 0-209 | ||||||||||||||||||||||||
290 | ((void *)0)
| 0-209 | ||||||||||||||||||||||||
291 | )
| 0-209 | ||||||||||||||||||||||||
292 | ((void *)0)
| 0-209 | ||||||||||||||||||||||||
293 | )
| 0-209 | ||||||||||||||||||||||||
294 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
295 | ASN1_OBJECT_free(attr->object); | - | ||||||||||||||||||||||||
296 | attr->object = OBJ_dup(obj); | - | ||||||||||||||||||||||||
297 | return executed 209 times by 1 test: attr->object != return attr->object != ((void *)0) ; Executed by:
executed 209 times by 1 test: return attr->object != ((void *)0) ; Executed by:
| 209 | ||||||||||||||||||||||||
298 | ((void *)0) executed 209 times by 1 test: return attr->object != ((void *)0) ; Executed by:
| 209 | ||||||||||||||||||||||||
299 | ; executed 209 times by 1 test: return attr->object != ((void *)0) ; Executed by:
| 209 | ||||||||||||||||||||||||
300 | } | - | ||||||||||||||||||||||||
301 | - | |||||||||||||||||||||||||
302 | int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, | - | ||||||||||||||||||||||||
303 | const void *data, int len) | - | ||||||||||||||||||||||||
304 | { | - | ||||||||||||||||||||||||
305 | ASN1_TYPE *ttmp = | - | ||||||||||||||||||||||||
306 | ((void *)0) | - | ||||||||||||||||||||||||
307 | ; | - | ||||||||||||||||||||||||
308 | ASN1_STRING *stmp = | - | ||||||||||||||||||||||||
309 | ((void *)0) | - | ||||||||||||||||||||||||
310 | ; | - | ||||||||||||||||||||||||
311 | int atype = 0; | - | ||||||||||||||||||||||||
312 | if (!attr
| 0-209 | ||||||||||||||||||||||||
313 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
314 | if (attrtype & 0x1000
| 0-209 | ||||||||||||||||||||||||
315 | stmp = ASN1_STRING_set_by_NID( | - | ||||||||||||||||||||||||
316 | ((void *)0) | - | ||||||||||||||||||||||||
317 | , data, len, attrtype, | - | ||||||||||||||||||||||||
318 | OBJ_obj2nid(attr->object)); | - | ||||||||||||||||||||||||
319 | if (!stmp
| 0 | ||||||||||||||||||||||||
320 | ERR_put_error(11,(138),(13),__FILE__,257); | - | ||||||||||||||||||||||||
321 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
322 | } | - | ||||||||||||||||||||||||
323 | atype = stmp->type; | - | ||||||||||||||||||||||||
324 | } never executed: else if (len != -1end of block
| 0-105 | ||||||||||||||||||||||||
325 | if ((
| 0-105 | ||||||||||||||||||||||||
326 | ((void *)0)
| 0-105 | ||||||||||||||||||||||||
327 | ) | - | ||||||||||||||||||||||||
328 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
329 | if (!ASN1_STRING_set(stmp, data, len)
| 0-105 | ||||||||||||||||||||||||
330 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
331 | atype = attrtype; | - | ||||||||||||||||||||||||
332 | } executed 105 times by 1 test: end of block Executed by:
| 105 | ||||||||||||||||||||||||
333 | - | |||||||||||||||||||||||||
334 | - | |||||||||||||||||||||||||
335 | - | |||||||||||||||||||||||||
336 | - | |||||||||||||||||||||||||
337 | - | |||||||||||||||||||||||||
338 | if (attrtype == 0
| 0-209 | ||||||||||||||||||||||||
339 | ASN1_STRING_free(stmp); | - | ||||||||||||||||||||||||
340 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||||||||||||||||||||
341 | } | - | ||||||||||||||||||||||||
342 | if ((
| 0-209 | ||||||||||||||||||||||||
343 | ((void *)0)
| 0-209 | ||||||||||||||||||||||||
344 | ) | - | ||||||||||||||||||||||||
345 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
346 | if ((
| 0-105 | ||||||||||||||||||||||||
347 | if (!ASN1_TYPE_set1(ttmp, attrtype, data)
| 0-104 | ||||||||||||||||||||||||
348 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
349 | } executed 104 times by 1 test: else {end of block Executed by:
| 104 | ||||||||||||||||||||||||
350 | ASN1_TYPE_set(ttmp, atype, stmp); | - | ||||||||||||||||||||||||
351 | stmp = | - | ||||||||||||||||||||||||
352 | ((void *)0) | - | ||||||||||||||||||||||||
353 | ; | - | ||||||||||||||||||||||||
354 | } executed 105 times by 1 test: end of block Executed by:
| 105 | ||||||||||||||||||||||||
355 | if (!sk_ASN1_TYPE_push(attr->set, ttmp)
| 0-209 | ||||||||||||||||||||||||
356 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
357 | return executed 209 times by 1 test: 1;return 1; Executed by:
executed 209 times by 1 test: return 1; Executed by:
| 209 | ||||||||||||||||||||||||
358 | err: | - | ||||||||||||||||||||||||
359 | ERR_put_error(11,(138),((1|64)),__FILE__,290); | - | ||||||||||||||||||||||||
360 | ASN1_TYPE_free(ttmp); | - | ||||||||||||||||||||||||
361 | ASN1_STRING_free(stmp); | - | ||||||||||||||||||||||||
362 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
363 | } | - | ||||||||||||||||||||||||
364 | - | |||||||||||||||||||||||||
365 | int X509_ATTRIBUTE_count(const X509_ATTRIBUTE *attr) | - | ||||||||||||||||||||||||
366 | { | - | ||||||||||||||||||||||||
367 | if (attr ==
| 0-61 | ||||||||||||||||||||||||
368 | ((void *)0)
| 0-61 | ||||||||||||||||||||||||
369 | ) | - | ||||||||||||||||||||||||
370 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
371 | return executed 61 times by 1 test: sk_ASN1_TYPE_num(attr->set);return sk_ASN1_TYPE_num(attr->set); Executed by:
executed 61 times by 1 test: return sk_ASN1_TYPE_num(attr->set); Executed by:
| 61 | ||||||||||||||||||||||||
372 | } | - | ||||||||||||||||||||||||
373 | - | |||||||||||||||||||||||||
374 | ASN1_OBJECT *X509_ATTRIBUTE_get0_object(X509_ATTRIBUTE *attr) | - | ||||||||||||||||||||||||
375 | { | - | ||||||||||||||||||||||||
376 | if (attr ==
| 0-118 | ||||||||||||||||||||||||
377 | ((void *)0)
| 0-118 | ||||||||||||||||||||||||
378 | ) | - | ||||||||||||||||||||||||
379 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
380 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
381 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
382 | return executed 118 times by 1 test: attr->object;return attr->object; Executed by:
executed 118 times by 1 test: return attr->object; Executed by:
| 118 | ||||||||||||||||||||||||
383 | } | - | ||||||||||||||||||||||||
384 | - | |||||||||||||||||||||||||
385 | void *X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr, int idx, | - | ||||||||||||||||||||||||
386 | int atrtype, void *data) | - | ||||||||||||||||||||||||
387 | { | - | ||||||||||||||||||||||||
388 | ASN1_TYPE *ttmp; | - | ||||||||||||||||||||||||
389 | ttmp = X509_ATTRIBUTE_get0_type(attr, idx); | - | ||||||||||||||||||||||||
390 | if (!ttmp
| 0-61 | ||||||||||||||||||||||||
391 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
392 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
393 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
394 | if (atrtype != ASN1_TYPE_get(ttmp)
| 0-61 | ||||||||||||||||||||||||
395 | ERR_put_error(11,(139),(122),__FILE__,318); | - | ||||||||||||||||||||||||
396 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
397 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
398 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
399 | } | - | ||||||||||||||||||||||||
400 | return executed 61 times by 1 test: ttmp->value.ptr;return ttmp->value.ptr; Executed by:
executed 61 times by 1 test: return ttmp->value.ptr; Executed by:
| 61 | ||||||||||||||||||||||||
401 | } | - | ||||||||||||||||||||||||
402 | - | |||||||||||||||||||||||||
403 | ASN1_TYPE *X509_ATTRIBUTE_get0_type(X509_ATTRIBUTE *attr, int idx) | - | ||||||||||||||||||||||||
404 | { | - | ||||||||||||||||||||||||
405 | if (attr ==
| 39-84 | ||||||||||||||||||||||||
406 | ((void *)0)
| 39-84 | ||||||||||||||||||||||||
407 | ) | - | ||||||||||||||||||||||||
408 | return executed 39 times by 1 test: return ((void *)0) ; Executed by:
executed 39 times by 1 test: return ((void *)0) ; Executed by:
| 39 | ||||||||||||||||||||||||
409 | ((void *)0) executed 39 times by 1 test: return ((void *)0) ; Executed by:
| 39 | ||||||||||||||||||||||||
410 | ; executed 39 times by 1 test: return ((void *)0) ; Executed by:
| 39 | ||||||||||||||||||||||||
411 | return executed 84 times by 1 test: sk_ASN1_TYPE_value(attr->set, idx);return sk_ASN1_TYPE_value(attr->set, idx); Executed by:
executed 84 times by 1 test: return sk_ASN1_TYPE_value(attr->set, idx); Executed by:
| 84 | ||||||||||||||||||||||||
412 | } | - | ||||||||||||||||||||||||
Switch to Source code | Preprocessed file |