OpenCoverage

a_type.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/asn1/a_type.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2int ASN1_TYPE_get(const ASN1_TYPE *a)-
3{-
4 if ((
(a->value.ptr != ((void *)0) )Description
TRUEevaluated 61 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
a->value.ptr !=
(a->value.ptr != ((void *)0) )Description
TRUEevaluated 61 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
7-61
5 ((void *)0)
(a->value.ptr != ((void *)0) )Description
TRUEevaluated 61 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
7-61
6 )
(a->value.ptr != ((void *)0) )Description
TRUEevaluated 61 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| (
(a->type == 5)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
a->type == 5)
(a->type == 5)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
3-61
7 return
executed 65 times by 1 test: return a->type;
Executed by:
  • libcrypto.so.1.1
a->type;
executed 65 times by 1 test: return a->type;
Executed by:
  • libcrypto.so.1.1
65
8 else-
9 return
executed 3 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 3 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
3
10}-
11-
12void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value)-
13{-
14 if (a->value.ptr !=
a->value.ptr != ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 232438 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-232438
15 ((void *)0)
a->value.ptr != ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 232438 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-232438
16 ) {-
17 ASN1_TYPE **tmp_a = &a;-
18 asn1_primitive_free((ASN1_VALUE **)tmp_a, -
19 ((void *)0)-
20 , 0);-
21 }
never executed: end of block
0
22 a->type = type;-
23 if (type == 1
type == 1Description
TRUEevaluated 1086 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 231352 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
1086-231352
24 a->value.boolean = value
valueDescription
TRUEnever evaluated
FALSEevaluated 1086 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? 0xff : 0;
executed 1086 times by 1 test: a->value.boolean = value ? 0xff : 0;
Executed by:
  • libcrypto.so.1.1
0-1086
25 else-
26 a->value.ptr = value;
executed 231352 times by 1 test: a->value.ptr = value;
Executed by:
  • libcrypto.so.1.1
231352
27}-
28-
29int ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value)-
30{-
31 if (!value
!valueDescription
TRUEnever evaluated
FALSEevaluated 104 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| (
(type == 1)Description
TRUEnever evaluated
FALSEevaluated 104 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
type == 1)
(type == 1)Description
TRUEnever evaluated
FALSEevaluated 104 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-104
32 void *p = (void *)value;-
33 ASN1_TYPE_set(a, type, p);-
34 }
never executed: end of block
else if (type == 6
type == 6Description
TRUEevaluated 50 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 54 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-54
35 ASN1_OBJECT *odup;-
36 odup = OBJ_dup(value);-
37 if (!odup
!odupDescription
TRUEnever evaluated
FALSEevaluated 50 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-50
38 return
never executed: return 0;
0;
never executed: return 0;
0
39 ASN1_TYPE_set(a, type, odup);-
40 }
executed 50 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
50
41 ASN1_STRING *sdup;-
42 sdup = ASN1_STRING_dup(value);-
43 if (!sdup
!sdupDescription
TRUEnever evaluated
FALSEevaluated 54 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-54
44 return
never executed: return 0;
0;
never executed: return 0;
0
45 ASN1_TYPE_set(a, type, sdup);-
46 }
executed 54 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
54
47 return
executed 104 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 104 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
104
48}-
49-
50-
51int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b)-
52{-
53 int result = -1;-
54-
55 if (!a
!aDescription
TRUEnever evaluated
FALSEevaluated 1258 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| !b
!bDescription
TRUEnever evaluated
FALSEevaluated 1258 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| a->type != b->type
a->type != b->typeDescription
TRUEnever evaluated
FALSEevaluated 1258 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1258
56 return
never executed: return -1;
-1;
never executed: return -1;
0
57-
58 switch (a->type) {-
59 case
never executed: case 6:
6:
never executed: case 6:
0
60 result = OBJ_cmp(a->value.object, b->value.object);-
61 break;
never executed: break;
0
62 case
never executed: case 1:
1:
never executed: case 1:
0
63 result = a->value.boolean - b->value.boolean;-
64 break;
never executed: break;
0
65 case
executed 1255 times by 1 test: case 5:
Executed by:
  • libcrypto.so.1.1
5:
executed 1255 times by 1 test: case 5:
Executed by:
  • libcrypto.so.1.1
1255
66 result = 0;-
67 break;
executed 1255 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
1255
68 case
never executed: case 2:
2:
never executed: case 2:
0
69 case
never executed: case 10:
10:
never executed: case 10:
0
70 case
never executed: case 3:
3:
never executed: case 3:
0
71 case
never executed: case 4:
4:
never executed: case 4:
0
72 case
executed 3 times by 1 test: case 16:
Executed by:
  • libcrypto.so.1.1
16:
executed 3 times by 1 test: case 16:
Executed by:
  • libcrypto.so.1.1
3
73 case
never executed: case 17:
17:
never executed: case 17:
0
74 case
never executed: case 18:
18:
never executed: case 18:
0
75 case
never executed: case 19:
19:
never executed: case 19:
0
76 case
never executed: case 20:
20:
never executed: case 20:
0
77 case
never executed: case 21:
21:
never executed: case 21:
0
78 case
never executed: case 22:
22:
never executed: case 22:
0
79 case
never executed: case 23:
23:
never executed: case 23:
0
80 case
never executed: case 24:
24:
never executed: case 24:
0
81 case
never executed: case 25:
25:
never executed: case 25:
0
82 case
never executed: case 26:
26:
never executed: case 26:
0
83 case
never executed: case 27:
27:
never executed: case 27:
0
84 case
never executed: case 28:
28:
never executed: case 28:
0
85 case
never executed: case 30:
30:
never executed: case 30:
0
86 case
never executed: case 12:
12:
never executed: case 12:
0
87 case
never executed: case -3:
-3:
never executed: case -3:
0
88 default
never executed: default:
:
never executed: default:
0
89 result = ASN1_STRING_cmp((ASN1_STRING *)a->value.ptr,-
90 (ASN1_STRING *)b->value.ptr);-
91 break;
executed 3 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
3
92 }-
93-
94 return
executed 1258 times by 1 test: return result;
Executed by:
  • libcrypto.so.1.1
result;
executed 1258 times by 1 test: return result;
Executed by:
  • libcrypto.so.1.1
1258
95}-
96-
97ASN1_TYPE *ASN1_TYPE_pack_sequence(const ASN1_ITEM *it, void *s, ASN1_TYPE **t)-
98{-
99 ASN1_OCTET_STRING *oct;-
100 ASN1_TYPE *rt;-
101-
102 oct = ASN1_item_pack(s, it, -
103 ((void *)0)-
104 );-
105 if (oct ==
oct == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2
106 ((void *)0)
oct == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2
107 )-
108 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
109 ((void *)0)
never executed: return ((void *)0) ;
0
110 ;
never executed: return ((void *)0) ;
0
111-
112 if (t
tDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& *
*tDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
t
*tDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-2
113 rt = *t;-
114 }
executed 2 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
2
115 rt = ASN1_TYPE_new();-
116 if (rt ==
rt == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
117 ((void *)0)
rt == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
118 ) {-
119 ASN1_OCTET_STRING_free(oct);-
120 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
121 ((void *)0)
never executed: return ((void *)0) ;
0
122 ;
never executed: return ((void *)0) ;
0
123 }-
124 if (t
tDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
125 *
never executed: *t = rt;
t = rt;
never executed: *t = rt;
0
126 }
never executed: end of block
0
127 ASN1_TYPE_set(rt, 16, oct);-
128 return
executed 2 times by 1 test: return rt;
Executed by:
  • libcrypto.so.1.1
rt;
executed 2 times by 1 test: return rt;
Executed by:
  • libcrypto.so.1.1
2
129}-
130-
131void *ASN1_TYPE_unpack_sequence(const ASN1_ITEM *it, const ASN1_TYPE *t)-
132{-
133 if (t ==
t == ((void *)0)Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 306 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
7-306
134 ((void *)0)
t == ((void *)0)Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 306 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
7-306
135 || t->type != 16
t->type != 16Description
TRUEevaluated 56 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 250 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| t->value.sequence ==
t->value.seque...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 250 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-250
136 ((void *)0)
t->value.seque...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 250 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-250
137 )-
138 return
executed 63 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
executed 63 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
63
139 ((void *)0)
executed 63 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
63
140 ;
executed 63 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
63
141 return
executed 250 times by 1 test: return ASN1_item_unpack(t->value.sequence, it);
Executed by:
  • libcrypto.so.1.1
ASN1_item_unpack(t->value.sequence, it);
executed 250 times by 1 test: return ASN1_item_unpack(t->value.sequence, it);
Executed by:
  • libcrypto.so.1.1
250
142}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2