OpenCoverage

x509_att.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/x509/x509_att.c
Source codeSwitch to Preprocessed file
LineSourceCount
1/*-
2 * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.-
3 *-
4 * Licensed under the OpenSSL license (the "License"). You may not use-
5 * this file except in compliance with the License. You can obtain a copy-
6 * in the file LICENSE in the source distribution or at-
7 * https://www.openssl.org/source/license.html-
8 */-
9-
10#include <stdio.h>-
11#include "internal/cryptlib.h"-
12#include <openssl/safestack.h>-
13#include <openssl/asn1.h>-
14#include <openssl/objects.h>-
15#include <openssl/evp.h>-
16#include <openssl/x509.h>-
17#include <openssl/x509v3.h>-
18#include "x509_lcl.h"-
19-
20int X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x)-
21{-
22 return sk_X509_ATTRIBUTE_num(x);
executed 192 times by 1 test: return sk_X509_ATTRIBUTE_num(x);
Executed by:
  • libcrypto.so.1.1
192
23}-
24-
25int X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, int nid,-
26 int lastpos)-
27{-
28 const ASN1_OBJECT *obj = OBJ_nid2obj(nid);-
29-
30 if (obj == NULL)
obj == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 119 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-119
31 return -2;
never executed: return -2;
0
32 return 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
33}-
34-
35int X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk,-
36 const ASN1_OBJECT *obj, int lastpos)-
37{-
38 int n;-
39 X509_ATTRIBUTE *ex;-
40-
41 if (sk == NULL)
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
42 return -1;
executed 20 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
20
43 lastpos++;-
44 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
45 lastpos = 0;
executed 61 times by 1 test: lastpos = 0;
Executed by:
  • libcrypto.so.1.1
61
46 n = sk_X509_ATTRIBUTE_num(sk);-
47 for (; lastpos < n; lastpos++) {
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
137-510
48 ex = sk_X509_ATTRIBUTE_value(sk, lastpos);-
49 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
50 return lastpos;
executed 84 times by 1 test: return lastpos;
Executed by:
  • libcrypto.so.1.1
84
51 }
executed 426 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
426
52 return -1;
executed 137 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
137
53}-
54-
55X509_ATTRIBUTE *X509at_get_attr(const STACK_OF(X509_ATTRIBUTE) *x, int loc)-
56{-
57 if (x == NULL || sk_X509_ATTRIBUTE_num(x) <= loc || loc < 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
sk_X509_ATTRIB..._num(x) <= locDescription
TRUEnever evaluated
FALSEevaluated 104 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
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
58 return NULL;
executed 39 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
39
59-
60 return 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
61}-
62-
63X509_ATTRIBUTE *X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x, int loc)-
64{-
65 X509_ATTRIBUTE *ret;-
66-
67 if (x == NULL || sk_X509_ATTRIBUTE_num(x) <= loc || loc < 0)
x == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
sk_X509_ATTRIB..._num(x) <= locDescription
TRUEnever evaluated
FALSEnever evaluated
loc < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
68 return NULL;
never executed: return ((void *)0) ;
0
69 ret = sk_X509_ATTRIBUTE_delete(x, loc);-
70 return ret;
never executed: return ret;
0
71}-
72-
73STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x,-
74 X509_ATTRIBUTE *attr)-
75{-
76 X509_ATTRIBUTE *new_attr = NULL;-
77 STACK_OF(X509_ATTRIBUTE) *sk = NULL;-
78-
79 if (x == NULL) {
x == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-209
80 X509err(X509_F_X509AT_ADD1_ATTR, ERR_R_PASSED_NULL_PARAMETER);-
81 goto err2;
never executed: goto err2;
0
82 }-
83-
84 if (*x == NULL) {
*x == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-209
85 if ((sk = sk_X509_ATTRIBUTE_new_null()) == NULL)
(sk = sk_X509_...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
86 goto err;
never executed: goto err;
0
87 } else
never executed: end of block
0
88 sk = *x;
executed 209 times by 1 test: sk = *x;
Executed by:
  • libcrypto.so.1.1
209
89-
90 if ((new_attr = X509_ATTRIBUTE_dup(attr)) == NULL)
(new_attr = X5...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-209
91 goto err2;
never executed: goto err2;
0
92 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
93 goto err;
never executed: goto err;
0
94 if (*x == NULL)
*x == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-209
95 *x = sk;
never executed: *x = sk;
0
96 return sk;
executed 209 times by 1 test: return sk;
Executed by:
  • libcrypto.so.1.1
209
97 err:-
98 X509err(X509_F_X509AT_ADD1_ATTR, ERR_R_MALLOC_FAILURE);-
99 err2:
code before this statement never executed: err2:
0
100 X509_ATTRIBUTE_free(new_attr);-
101 sk_X509_ATTRIBUTE_free(sk);-
102 return NULL;
never executed: return ((void *)0) ;
0
103}-
104-
105STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE)-
106 **x, const ASN1_OBJECT *obj,-
107 int type,-
108 const unsigned char *bytes,-
109 int len)-
110{-
111 X509_ATTRIBUTE *attr;-
112 STACK_OF(X509_ATTRIBUTE) *ret;-
113 attr = X509_ATTRIBUTE_create_by_OBJ(NULL, obj, type, bytes, len);-
114 if (!attr)
!attrDescription
TRUEnever evaluated
FALSEnever evaluated
0
115 return 0;
never executed: return 0;
0
116 ret = X509at_add1_attr(x, attr);-
117 X509_ATTRIBUTE_free(attr);-
118 return ret;
never executed: return ret;
0
119}-
120-
121STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE)-
122 **x, int nid, int type,-
123 const unsigned char *bytes,-
124 int len)-
125{-
126 X509_ATTRIBUTE *attr;-
127 STACK_OF(X509_ATTRIBUTE) *ret;-
128 attr = X509_ATTRIBUTE_create_by_NID(NULL, nid, type, bytes, len);-
129 if (!attr)
!attrDescription
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-209
130 return 0;
never executed: return 0;
0
131 ret = X509at_add1_attr(x, attr);-
132 X509_ATTRIBUTE_free(attr);-
133 return ret;
executed 209 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
209
134}-
135-
136STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE)-
137 **x, const char *attrname,-
138 int type,-
139 const unsigned char *bytes,-
140 int len)-
141{-
142 X509_ATTRIBUTE *attr;-
143 STACK_OF(X509_ATTRIBUTE) *ret;-
144 attr = X509_ATTRIBUTE_create_by_txt(NULL, attrname, type, bytes, len);-
145 if (!attr)
!attrDescription
TRUEnever evaluated
FALSEnever evaluated
0
146 return 0;
never executed: return 0;
0
147 ret = X509at_add1_attr(x, attr);-
148 X509_ATTRIBUTE_free(attr);-
149 return ret;
never executed: return ret;
0
150}-
151-
152void *X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x,-
153 const ASN1_OBJECT *obj, int lastpos, int type)-
154{-
155 int i;-
156 X509_ATTRIBUTE *at;-
157 i = X509at_get_attr_by_OBJ(x, obj, lastpos);-
158 if (i == -1)
i == -1Description
TRUEnever evaluated
FALSEevaluated 61 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-61
159 return NULL;
never executed: return ((void *)0) ;
0
160 if ((lastpos <= -2) && (X509at_get_attr_by_OBJ(x, obj, i) != -1))
(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
0-61
161 return NULL;
never executed: return ((void *)0) ;
0
162 at = X509at_get_attr(x, i);-
163 if (lastpos <= -3 && (X509_ATTRIBUTE_count(at) != 1))
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
0-61
164 return NULL;
never executed: return ((void *)0) ;
0
165 return X509_ATTRIBUTE_get0_data(at, 0, type, NULL);
executed 61 times by 1 test: return X509_ATTRIBUTE_get0_data(at, 0, type, ((void *)0) );
Executed by:
  • libcrypto.so.1.1
61
166}-
167-
168X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid,-
169 int atrtype, const void *data,-
170 int len)-
171{-
172 ASN1_OBJECT *obj;-
173 X509_ATTRIBUTE *ret;-
174-
175 obj = OBJ_nid2obj(nid);-
176 if (obj == NULL) {
obj == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-209
177 X509err(X509_F_X509_ATTRIBUTE_CREATE_BY_NID, X509_R_UNKNOWN_NID);-
178 return NULL;
never executed: return ((void *)0) ;
0
179 }-
180 ret = X509_ATTRIBUTE_create_by_OBJ(attr, obj, atrtype, data, len);-
181 if (ret == NULL)
ret == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-209
182 ASN1_OBJECT_free(obj);
never executed: ASN1_OBJECT_free(obj);
0
183 return ret;
executed 209 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
209
184}-
185-
186X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr,-
187 const ASN1_OBJECT *obj,-
188 int atrtype, const void *data,-
189 int len)-
190{-
191 X509_ATTRIBUTE *ret;-
192-
193 if ((attr == NULL) || (*attr == NULL)) {
(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
0-209
194 if ((ret = X509_ATTRIBUTE_new()) == NULL) {
(ret = X509_AT...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-209
195 X509err(X509_F_X509_ATTRIBUTE_CREATE_BY_OBJ,-
196 ERR_R_MALLOC_FAILURE);-
197 return NULL;
never executed: return ((void *)0) ;
0
198 }-
199 } else
executed 209 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
209
200 ret = *attr;
never executed: ret = *attr;
0
201-
202 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
203 goto err;
never executed: goto err;
0
204 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
205 goto err;
never executed: goto err;
0
206-
207 if ((attr != NULL) && (*attr == NULL))
(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
0-209
208 *attr = ret;
never executed: *attr = ret;
0
209 return ret;
executed 209 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
209
210 err:-
211 if ((attr == NULL) || (ret != *attr))
(attr == ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
(ret != *attr)Description
TRUEnever evaluated
FALSEnever evaluated
0
212 X509_ATTRIBUTE_free(ret);
never executed: X509_ATTRIBUTE_free(ret);
0
213 return NULL;
never executed: return ((void *)0) ;
0
214}-
215-
216X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr,-
217 const char *atrname, int type,-
218 const unsigned char *bytes,-
219 int len)-
220{-
221 ASN1_OBJECT *obj;-
222 X509_ATTRIBUTE *nattr;-
223-
224 obj = OBJ_txt2obj(atrname, 0);-
225 if (obj == NULL) {
obj == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
226 X509err(X509_F_X509_ATTRIBUTE_CREATE_BY_TXT,-
227 X509_R_INVALID_FIELD_NAME);-
228 ERR_add_error_data(2, "name=", atrname);-
229 return NULL;
never executed: return ((void *)0) ;
0
230 }-
231 nattr = X509_ATTRIBUTE_create_by_OBJ(attr, obj, type, bytes, len);-
232 ASN1_OBJECT_free(obj);-
233 return nattr;
never executed: return nattr;
0
234}-
235-
236int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj)-
237{-
238 if ((attr == NULL) || (obj == NULL))
(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
0-209
239 return 0;
never executed: return 0;
0
240 ASN1_OBJECT_free(attr->object);-
241 attr->object = OBJ_dup(obj);-
242 return attr->object != NULL;
executed 209 times by 1 test: return attr->object != ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
209
243}-
244-
245int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype,-
246 const void *data, int len)-
247{-
248 ASN1_TYPE *ttmp = NULL;-
249 ASN1_STRING *stmp = NULL;-
250 int atype = 0;-
251 if (!attr)
!attrDescription
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-209
252 return 0;
never executed: return 0;
0
253 if (attrtype & MBSTRING_FLAG) {
attrtype & 0x1000Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-209
254 stmp = ASN1_STRING_set_by_NID(NULL, data, len, attrtype,-
255 OBJ_obj2nid(attr->object));-
256 if (!stmp) {
!stmpDescription
TRUEnever evaluated
FALSEnever evaluated
0
257 X509err(X509_F_X509_ATTRIBUTE_SET1_DATA, ERR_R_ASN1_LIB);-
258 return 0;
never executed: return 0;
0
259 }-
260 atype = stmp->type;-
261 } else if (len != -1) {
never executed: end of block
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
262 if ((stmp = ASN1_STRING_type_new(attrtype)) == NULL)
(stmp = ASN1_S...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 105 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-105
263 goto err;
never executed: goto err;
0
264 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
265 goto err;
never executed: goto err;
0
266 atype = attrtype;-
267 }
executed 105 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
105
268 /*-
269 * This is a bit naughty because the attribute should really have at-
270 * least one value but some types use and zero length SET and require-
271 * this.-
272 */-
273 if (attrtype == 0) {
attrtype == 0Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-209
274 ASN1_STRING_free(stmp);-
275 return 1;
never executed: return 1;
0
276 }-
277 if ((ttmp = ASN1_TYPE_new()) == NULL)
(ttmp = ASN1_T...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 209 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-209
278 goto err;
never executed: goto err;
0
279 if ((len == -1) && !(attrtype & MBSTRING_FLAG)) {
(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)Description
TRUEevaluated 104 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-105
280 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
281 goto err;
never executed: goto err;
0
282 } else {
executed 104 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
104
283 ASN1_TYPE_set(ttmp, atype, stmp);-
284 stmp = NULL;-
285 }
executed 105 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
105
286 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
287 goto err;
never executed: goto err;
0
288 return 1;
executed 209 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
209
289 err:-
290 X509err(X509_F_X509_ATTRIBUTE_SET1_DATA, ERR_R_MALLOC_FAILURE);-
291 ASN1_TYPE_free(ttmp);-
292 ASN1_STRING_free(stmp);-
293 return 0;
never executed: return 0;
0
294}-
295-
296int X509_ATTRIBUTE_count(const X509_ATTRIBUTE *attr)-
297{-
298 if (attr == NULL)
attr == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 61 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-61
299 return 0;
never executed: return 0;
0
300 return 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
301}-
302-
303ASN1_OBJECT *X509_ATTRIBUTE_get0_object(X509_ATTRIBUTE *attr)-
304{-
305 if (attr == NULL)
attr == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 118 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-118
306 return NULL;
never executed: return ((void *)0) ;
0
307 return attr->object;
executed 118 times by 1 test: return attr->object;
Executed by:
  • libcrypto.so.1.1
118
308}-
309-
310void *X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr, int idx,-
311 int atrtype, void *data)-
312{-
313 ASN1_TYPE *ttmp;-
314 ttmp = X509_ATTRIBUTE_get0_type(attr, idx);-
315 if (!ttmp)
!ttmpDescription
TRUEnever evaluated
FALSEevaluated 61 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-61
316 return NULL;
never executed: return ((void *)0) ;
0
317 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
318 X509err(X509_F_X509_ATTRIBUTE_GET0_DATA, X509_R_WRONG_TYPE);-
319 return NULL;
never executed: return ((void *)0) ;
0
320 }-
321 return ttmp->value.ptr;
executed 61 times by 1 test: return ttmp->value.ptr;
Executed by:
  • libcrypto.so.1.1
61
322}-
323-
324ASN1_TYPE *X509_ATTRIBUTE_get0_type(X509_ATTRIBUTE *attr, int idx)-
325{-
326 if (attr == NULL)
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
327 return NULL;
executed 39 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
39
328 return 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
329}-
Source codeSwitch to Preprocessed file

Generated by Squish Coco 4.2.2