OpenCoverage

x509_att.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/x509/x509_att.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3int X509at_get_attr_count(const struct stack_st_X509_ATTRIBUTE *x)-
4{-
5 return
executed 192 times by 1 test: return sk_X509_ATTRIBUTE_num(x);
Executed by:
  • libcrypto.so.1.1
sk_X509_ATTRIBUTE_num(x);
executed 192 times by 1 test: return sk_X509_ATTRIBUTE_num(x);
Executed by:
  • libcrypto.so.1.1
192
6}-
7-
8int 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 ==
obj == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 119 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-119
14 ((void *)0)
obj == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 119 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-119
15 )-
16 return
never executed: return -2;
-2;
never executed: return -2;
0
17 return
executed 119 times by 1 test: return X509at_get_attr_by_OBJ(x, obj, lastpos);
Executed by:
  • libcrypto.so.1.1
X509at_get_attr_by_OBJ(x, obj, lastpos);
executed 119 times by 1 test: return X509at_get_attr_by_OBJ(x, obj, lastpos);
Executed by:
  • libcrypto.so.1.1
119
18}-
19-
20int 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 ==
sk == ((void *)0)Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 221 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
20-221
27 ((void *)0)
sk == ((void *)0)Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 221 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
20-221
28 )-
29 return
executed 20 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
-1;
executed 20 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
20
30 lastpos++;-
31 if (lastpos < 0
lastpos < 0Description
TRUEevaluated 61 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 160 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
61-160
32 lastpos = 0;
executed 61 times by 1 test: lastpos = 0;
Executed by:
  • libcrypto.so.1.1
61
33 n = sk_X509_ATTRIBUTE_num(sk);-
34 for (; lastpos < n
lastpos < nDescription
TRUEevaluated 510 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 137 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; lastpos++) {
137-510
35 ex = sk_X509_ATTRIBUTE_value(sk, lastpos);-
36 if (OBJ_cmp(ex->object, obj) == 0
OBJ_cmp(ex->object, obj) == 0Description
TRUEevaluated 84 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 426 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
84-426
37 return
executed 84 times by 1 test: return lastpos;
Executed by:
  • libcrypto.so.1.1
lastpos;
executed 84 times by 1 test: return lastpos;
Executed by:
  • libcrypto.so.1.1
84
38 }
executed 426 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
426
39 return
executed 137 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
-1;
executed 137 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
137
40}-
41-
42X509_ATTRIBUTE *X509at_get_attr(const struct stack_st_X509_ATTRIBUTE *x, int loc)-
43{-
44 if (x ==
x == ((void *)0)Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 104 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
20-104
45 ((void *)0)
x == ((void *)0)Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 104 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
20-104
46 || sk_X509_ATTRIBUTE_num(x) <= loc
sk_X509_ATTRIB..._num(x) <= locDescription
TRUEnever evaluated
FALSEevaluated 104 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| loc < 0
loc < 0Description
TRUEevaluated 19 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 85 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-104
47 return
executed 39 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
executed 39 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
39
48 ((void *)0)
executed 39 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
39
49 ;
executed 39 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
39
50-
51 return
executed 85 times by 1 test: return sk_X509_ATTRIBUTE_value(x, loc);
Executed by:
  • libcrypto.so.1.1
sk_X509_ATTRIBUTE_value(x, loc);
executed 85 times by 1 test: return sk_X509_ATTRIBUTE_value(x, loc);
Executed by:
  • libcrypto.so.1.1
85
52}-
53-
54X509_ATTRIBUTE *X509at_delete_attr(struct stack_st_X509_ATTRIBUTE *x, int loc)-
55{-
56 X509_ATTRIBUTE *ret;-
57-
58 if (x ==
x == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
59 ((void *)0)
x == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
60 || sk_X509_ATTRIBUTE_num(x) <= loc
sk_X509_ATTRIB..._num(x) <= locDescription
TRUEnever evaluated
FALSEnever evaluated
|| loc < 0
loc < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
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: return ret;
ret;
never executed: return ret;
0
66}-
67-
68struct 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 ==
x == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-209
79 ((void *)0)
x == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-209
80 ) {-
81 ERR_put_error(11,(135),((3|64)),__FILE__,80);-
82 goto
never executed: goto err2;
err2;
never executed: goto err2;
0
83 }-
84-
85 if (*
*x == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
x ==
*x == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-209
86 ((void *)0)
*x == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-209
87 ) {-
88 if ((
(sk = sk_X509_...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
sk = sk_X509_ATTRIBUTE_new_null()) ==
(sk = sk_X509_...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
89 ((void *)0)
(sk = sk_X509_...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
90 )-
91 goto
never executed: goto err;
err;
never executed: goto err;
0
92 }
never executed: end of block
else
0
93 sk = *x;
executed 209 times by 1 test: sk = *x;
Executed by:
  • libcrypto.so.1.1
209
94-
95 if ((
(new_attr = X5...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
new_attr = X509_ATTRIBUTE_dup(attr)) ==
(new_attr = X5...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-209
96 ((void *)0)
(new_attr = X5...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-209
97 )-
98 goto
never executed: goto err2;
err2;
never executed: goto err2;
0
99 if (!sk_X509_ATTRIBUTE_push(sk, new_attr)
!sk_X509_ATTRI...(sk, new_attr)Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-209
100 goto
never executed: goto err;
err;
never executed: goto err;
0
101 if (*
*x == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
x ==
*x == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-209
102 ((void *)0)
*x == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-209
103 )-
104 *
never executed: *x = sk;
x = sk;
never executed: *x = sk;
0
105 return
executed 209 times by 1 test: return sk;
Executed by:
  • libcrypto.so.1.1
sk;
executed 209 times by 1 test: return sk;
Executed by:
  • libcrypto.so.1.1
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-
116struct 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
!attrDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
128 return
never executed: return 0;
0;
never executed: return 0;
0
129 ret = X509at_add1_attr(x, attr);-
130 X509_ATTRIBUTE_free(attr);-
131 return
never executed: return ret;
ret;
never executed: return ret;
0
132}-
133-
134struct 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
!attrDescription
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-209
145 return
never executed: return 0;
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: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 209 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
209
149}-
150-
151struct 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
!attrDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
163 return
never executed: return 0;
0;
never executed: return 0;
0
164 ret = X509at_add1_attr(x, attr);-
165 X509_ATTRIBUTE_free(attr);-
166 return
never executed: return ret;
ret;
never executed: return ret;
0
167}-
168-
169void *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
i == -1Description
TRUEnever evaluated
FALSEevaluated 61 times by 1 test
Evaluated by:
  • libcrypto.so.1.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 ((
(lastpos <= -2)Description
TRUEevaluated 61 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
lastpos <= -2)
(lastpos <= -2)Description
TRUEevaluated 61 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& (
(X509at_get_at...obj, i) != -1)Description
TRUEnever evaluated
FALSEevaluated 61 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
X509at_get_attr_by_OBJ(x, obj, i) != -1)
(X509at_get_at...obj, i) != -1)Description
TRUEnever evaluated
FALSEevaluated 61 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
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
lastpos <= -3Description
TRUEevaluated 61 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& (
(X509_ATTRIBUT...ount(at) != 1)Description
TRUEnever evaluated
FALSEevaluated 61 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
X509_ATTRIBUTE_count(at) != 1)
(X509_ATTRIBUT...ount(at) != 1)Description
TRUEnever evaluated
FALSEevaluated 61 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
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: return X509_ATTRIBUTE_get0_data(at, 0, type, ((void *)0) );
Executed by:
  • libcrypto.so.1.1
X509_ATTRIBUTE_get0_data(at, 0, type,
executed 61 times by 1 test: return X509_ATTRIBUTE_get0_data(at, 0, type, ((void *)0) );
Executed by:
  • libcrypto.so.1.1
61
189 ((void *)0)
executed 61 times by 1 test: return X509_ATTRIBUTE_get0_data(at, 0, type, ((void *)0) );
Executed by:
  • libcrypto.so.1.1
61
190 );
executed 61 times by 1 test: return X509_ATTRIBUTE_get0_data(at, 0, type, ((void *)0) );
Executed by:
  • libcrypto.so.1.1
61
191}-
192-
193X509_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 ==
obj == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-209
202 ((void *)0)
obj == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
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 ==
ret == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-209
211 ((void *)0)
ret == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-209
212 )-
213 ASN1_OBJECT_free(obj);
never executed: ASN1_OBJECT_free(obj);
0
214 return
executed 209 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 209 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
209
215}-
216-
217X509_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 ((
(attr == ((void *)0) )Description
TRUEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
attr ==
(attr == ((void *)0) )Description
TRUEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-209
225 ((void *)0)
(attr == ((void *)0) )Description
TRUEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-209
226 )
(attr == ((void *)0) )Description
TRUEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
|| (*
(*attr == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
attr ==
(*attr == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
0-209
227 ((void *)0)
(*attr == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
0
228 )
(*attr == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
229 if ((
(ret = X509_AT...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
ret = X509_ATTRIBUTE_new()) ==
(ret = X509_AT...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-209
230 ((void *)0)
(ret = X509_AT...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
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: end of block
Executed by:
  • libcrypto.so.1.1
else
209
239 ret = *attr;
never executed: ret = *attr;
0
240-
241 if (!X509_ATTRIBUTE_set1_object(ret, obj)
!X509_ATTRIBUT...ject(ret, obj)Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-209
242 goto
never executed: goto err;
err;
never executed: goto err;
0
243 if (!X509_ATTRIBUTE_set1_data(ret, atrtype, data, len)
!X509_ATTRIBUT...pe, data, len)Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-209
244 goto
never executed: goto err;
err;
never executed: goto err;
0
245-
246 if ((
(attr != ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
attr !=
(attr != ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-209
247 ((void *)0)
(attr != ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-209
248 )
(attr != ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& (*
(*attr == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
attr ==
(*attr == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
0-209
249 ((void *)0)
(*attr == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
0
250 )
(*attr == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
)
0
251 *
never executed: *attr = ret;
attr = ret;
never executed: *attr = ret;
0
252 return
executed 209 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 209 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
209
253 err:-
254 if ((
(attr == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
attr ==
(attr == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
0
255 ((void *)0)
(attr == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
0
256 )
(attr == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
|| (
(ret != *attr)Description
TRUEnever evaluated
FALSEnever evaluated
ret != *attr)
(ret != *attr)Description
TRUEnever evaluated
FALSEnever evaluated
)
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-
263X509_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 ==
obj == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
273 ((void *)0)
obj == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
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: return nattr;
nattr;
never executed: return nattr;
0
285}-
286-
287int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj)-
288{-
289 if ((
(attr == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
attr ==
(attr == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-209
290 ((void *)0)
(attr == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-209
291 )
(attr == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| (
(obj == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
obj ==
(obj == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-209
292 ((void *)0)
(obj == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-209
293 )
(obj == ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-209
294 return
never executed: return 0;
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: return attr->object != ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
attr->object !=
executed 209 times by 1 test: return attr->object != ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
209
298 ((void *)0)
executed 209 times by 1 test: return attr->object != ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
209
299 ;
executed 209 times by 1 test: return attr->object != ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
209
300}-
301-
302int 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
!attrDescription
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-209
313 return
never executed: return 0;
0;
never executed: return 0;
0
314 if (attrtype & 0x1000
attrtype & 0x1000Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-209
315 stmp = ASN1_STRING_set_by_NID(-
316 ((void *)0)-
317 , data, len, attrtype,-
318 OBJ_obj2nid(attr->object));-
319 if (!stmp
!stmpDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
320 ERR_put_error(11,(138),(13),__FILE__,257);-
321 return
never executed: return 0;
0;
never executed: return 0;
0
322 }-
323 atype = stmp->type;-
324 }
never executed: end of block
else if (len != -1
len != -1Description
TRUEevaluated 105 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 104 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-105
325 if ((
(stmp = ASN1_S...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 105 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
stmp = ASN1_STRING_type_new(attrtype)) ==
(stmp = ASN1_S...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 105 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-105
326 ((void *)0)
(stmp = ASN1_S...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 105 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-105
327 )-
328 goto
never executed: goto err;
err;
never executed: goto err;
0
329 if (!ASN1_STRING_set(stmp, data, len)
!ASN1_STRING_s...mp, data, len)Description
TRUEnever evaluated
FALSEevaluated 105 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-105
330 goto
never executed: goto err;
err;
never executed: goto err;
0
331 atype = attrtype;-
332 }
executed 105 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
105
333-
334-
335-
336-
337-
338 if (attrtype == 0
attrtype == 0Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-209
339 ASN1_STRING_free(stmp);-
340 return
never executed: return 1;
1;
never executed: return 1;
0
341 }-
342 if ((
(ttmp = ASN1_T...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
ttmp = ASN1_TYPE_new()) ==
(ttmp = ASN1_T...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-209
343 ((void *)0)
(ttmp = ASN1_T...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-209
344 )-
345 goto
never executed: goto err;
err;
never executed: goto err;
0
346 if ((
(len == -1)Description
TRUEevaluated 104 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 105 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
len == -1)
(len == -1)Description
TRUEevaluated 104 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 105 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& !(attrtype & 0x1000)
!(attrtype & 0x1000)Description
TRUEevaluated 104 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-105
347 if (!ASN1_TYPE_set1(ttmp, attrtype, data)
!ASN1_TYPE_set...ttrtype, data)Description
TRUEnever evaluated
FALSEevaluated 104 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-104
348 goto
never executed: goto err;
err;
never executed: goto err;
0
349 }
executed 104 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
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:
  • libcrypto.so.1.1
105
355 if (!sk_ASN1_TYPE_push(attr->set, ttmp)
!sk_ASN1_TYPE_...tr->set, ttmp)Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-209
356 goto
never executed: goto err;
err;
never executed: goto err;
0
357 return
executed 209 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 209 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
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: return 0;
0;
never executed: return 0;
0
363}-
364-
365int X509_ATTRIBUTE_count(const X509_ATTRIBUTE *attr)-
366{-
367 if (attr ==
attr == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 61 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-61
368 ((void *)0)
attr == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 61 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-61
369 )-
370 return
never executed: return 0;
0;
never executed: return 0;
0
371 return
executed 61 times by 1 test: return sk_ASN1_TYPE_num(attr->set);
Executed by:
  • libcrypto.so.1.1
sk_ASN1_TYPE_num(attr->set);
executed 61 times by 1 test: return sk_ASN1_TYPE_num(attr->set);
Executed by:
  • libcrypto.so.1.1
61
372}-
373-
374ASN1_OBJECT *X509_ATTRIBUTE_get0_object(X509_ATTRIBUTE *attr)-
375{-
376 if (attr ==
attr == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 118 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-118
377 ((void *)0)
attr == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 118 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
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: return attr->object;
Executed by:
  • libcrypto.so.1.1
attr->object;
executed 118 times by 1 test: return attr->object;
Executed by:
  • libcrypto.so.1.1
118
383}-
384-
385void *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
!ttmpDescription
TRUEnever evaluated
FALSEevaluated 61 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
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)
atrtype != ASN1_TYPE_get(ttmp)Description
TRUEnever evaluated
FALSEevaluated 61 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
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: return ttmp->value.ptr;
Executed by:
  • libcrypto.so.1.1
ttmp->value.ptr;
executed 61 times by 1 test: return ttmp->value.ptr;
Executed by:
  • libcrypto.so.1.1
61
401}-
402-
403ASN1_TYPE *X509_ATTRIBUTE_get0_type(X509_ATTRIBUTE *attr, int idx)-
404{-
405 if (attr ==
attr == ((void *)0)Description
TRUEevaluated 39 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 84 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
39-84
406 ((void *)0)
attr == ((void *)0)Description
TRUEevaluated 39 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 84 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
39-84
407 )-
408 return
executed 39 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
executed 39 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
39
409 ((void *)0)
executed 39 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
39
410 ;
executed 39 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
39
411 return
executed 84 times by 1 test: return sk_ASN1_TYPE_value(attr->set, idx);
Executed by:
  • libcrypto.so.1.1
sk_ASN1_TYPE_value(attr->set, idx);
executed 84 times by 1 test: return sk_ASN1_TYPE_value(attr->set, idx);
Executed by:
  • libcrypto.so.1.1
84
412}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2