OpenCoverage

a_time.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/asn1/a_time.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2const ASN1_ITEM ASN1_TIME_it = { 0x5, 0x4000 | 0x8000, -
3((void *)0)-
4, 0, -
5((void *)0)-
6, sizeof(ASN1_STRING), "ASN1_TIME" };-
7-
8ASN1_TIME *d2i_ASN1_TIME(ASN1_TIME **a, const unsigned char **in, long len) { return
never executed: return (ASN1_TIME *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(ASN1_TIME_it)));
(ASN1_TIME *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(ASN1_TIME_it)));
never executed: return (ASN1_TIME *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(ASN1_TIME_it)));
} int i2d_ASN1_TIME(ASN1_TIME *a, unsigned char **out) { return
never executed: return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(ASN1_TIME_it)));
ASN1_item_i2d((ASN1_VALUE *)a, out, (&(ASN1_TIME_it)));
never executed: return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(ASN1_TIME_it)));
} ASN1_TIME *ASN1_TIME_new(void) { return
executed 117 times by 1 test: return (ASN1_TIME *)ASN1_item_new((&(ASN1_TIME_it)));
Executed by:
  • libcrypto.so.1.1
(ASN1_TIME *)ASN1_item_new((&(ASN1_TIME_it)));
executed 117 times by 1 test: return (ASN1_TIME *)ASN1_item_new((&(ASN1_TIME_it)));
Executed by:
  • libcrypto.so.1.1
} void ASN1_TIME_free(ASN1_TIME *a) { ASN1_item_free((ASN1_VALUE *)a, (&(ASN1_TIME_it))); }
executed 8321 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
0-8321
9-
10static int is_utc(const int year)-
11{-
12 if (50 <= year
50 <= yearDescription
TRUEevaluated 8344 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& year <= 149
year <= 149Description
TRUEevaluated 8341 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
3-8344
13 return
executed 8341 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 8341 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
8341
14 return
executed 10 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 10 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
10
15}-
16-
17static int leap_year(const int year)-
18{-
19 if (year % 400 == 0
year % 400 == 0Description
TRUEevaluated 1472 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 22368 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| (year % 100 != 0
year % 100 != 0Description
TRUEevaluated 21978 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 390 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& year % 4 == 0
year % 4 == 0Description
TRUEevaluated 1877 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 20101 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
))
390-22368
20 return
executed 3349 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 3349 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
3349
21 return
executed 20491 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 20491 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
20491
22}-
23-
24-
25-
26-
27-
28-
29-
30static void determine_days(struct tm *tm)-
31{-
32 static const int ydays[12] = {-
33 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334-
34 };-
35 int y = tm->tm_year + 1900;-
36 int m = tm->tm_mon;-
37 int d = tm->tm_mday;-
38 int c;-
39-
40 tm->tm_yday = ydays[m] + d - 1;-
41 if (m >= 2
m >= 2Description
TRUEevaluated 13300 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 21900 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
13300-21900
42-
43 tm->tm_yday += leap_year(y);-
44 m += 2;-
45 }
executed 13300 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
13300
46-
47 m += 14;-
48 y--;-
49 }
executed 21900 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
21900
50 c = y / 100;-
51 y %= 100;-
52-
53 tm->tm_wday = (d + (13 * m) / 5 + y + y / 4 + c / 4 + 5 * c + 6) % 7;-
54}
executed 35200 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
35200
55-
56int asn1_time_to_tm(struct tm *tm, const ASN1_TIME *d)-
57{-
58 static const int min[9] = { 0, 0, 1, 1, 0, 0, 0, 0, 0 };-
59 static const int max[9] = { 99, 99, 12, 31, 23, 59, 59, 12, 59 };-
60 static const int mdays[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };-
61 char *a;-
62 int n, i, i2, l, o, min_l = 11, strict = 0, end = 6, btz = 5, md;-
63 struct tm tmp;-
64 if (d->type == 23
d->type == 23Description
TRUEevaluated 25351 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 18809 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
18809-25351
65 if (d->flags & 0x100
d->flags & 0x100Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 25331 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
20-25331
66 min_l = 13;-
67 strict = 1;-
68 }
executed 20 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
20
69 }
executed 25351 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else if (d->type == 24
d->type == 24Description
TRUEevaluated 18809 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-25351
70 end = 7;-
71 btz = 6;-
72 if (d->flags & 0x100
d->flags & 0x100Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 18789 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
20-18789
73 min_l = 15;-
74 strict = 1;-
75 }
executed 20 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
20
76 min_l = 13;-
77 }
executed 18789 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
18789
78 } else {-
79 return
never executed: return 0;
0;
never executed: return 0;
0
80 }-
81-
82 l = d->length;-
83 a = (char *)d->data;-
84 o = 0;-
85 memset(&tmp, 0, sizeof(tmp));-
86-
87-
88-
89-
90-
91-
92-
93 if (l < min_l
l < min_lDescription
TRUEevaluated 6457 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 37703 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
6457-37703
94 goto
executed 6457 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 6457 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
6457
95 for (i = 0; i < end
i < endDescription
TRUEevaluated 229866 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 27854 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
27854-229866
96 if (!strict
!strictDescription
TRUEevaluated 229715 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 151 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& (
(i == btz)Description
TRUEevaluated 34041 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 195674 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
i == btz)
(i == btz)Description
TRUEevaluated 34041 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 195674 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& ((
(a[o] == 'Z')Description
TRUEevaluated 1521 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 32520 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
a[o] == 'Z')
(a[o] == 'Z')Description
TRUEevaluated 1521 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 32520 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| (
(a[o] == '+')Description
TRUEevaluated 723 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 31797 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
a[o] == '+')
(a[o] == '+')Description
TRUEevaluated 723 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 31797 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| (
(a[o] == '-')Description
TRUEevaluated 3184 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 28613 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
a[o] == '-')
(a[o] == '-')Description
TRUEevaluated 3184 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 28613 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)) {
151-229715
97 i++;-
98 break;
executed 5428 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
5428
99 }-
100 if (!(ossl_ctype_check((a[o]), 0x4))
!(ossl_ctype_c...((a[o]), 0x4))Description
TRUEevaluated 977 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 223461 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
977-223461
101 goto
executed 977 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 977 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
977
102 n = a[o] - '0';-
103-
104 if (++
++o == lDescription
TRUEevaluated 486 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 222975 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
o == l
++o == lDescription
TRUEevaluated 486 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 222975 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
486-222975
105 goto
executed 486 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 486 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
486
106-
107 if (!(ossl_ctype_check((a[o]), 0x4))
!(ossl_ctype_c...((a[o]), 0x4))Description
TRUEevaluated 848 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 222127 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
848-222127
108 goto
executed 848 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 848 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
848
109 n = (n * 10) + a[o] - '0';-
110-
111 if (++
++o == lDescription
TRUEevaluated 106 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 222021 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
o == l
++o == lDescription
TRUEevaluated 106 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 222021 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
106-222021
112 goto
executed 106 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 106 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
106
113-
114 i2 = (
(d->type == 23)Description
TRUEevaluated 126322 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 95699 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
d->type == 23)
(d->type == 23)Description
TRUEevaluated 126322 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 95699 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? i + 1 : i;
95699-126322
115-
116 if ((
(n < min[i2])Description
TRUEevaluated 531 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 221490 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
n < min[i2])
(n < min[i2])Description
TRUEevaluated 531 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 221490 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| (
(n > max[i2])Description
TRUEevaluated 676 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 220814 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
n > max[i2])
(n > max[i2])Description
TRUEevaluated 676 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 220814 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
531-221490
117 goto
executed 1207 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 1207 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
1207
118 switch (i2) {-
119 case
executed 15100 times by 1 test: case 0:
Executed by:
  • libcrypto.so.1.1
0:
executed 15100 times by 1 test: case 0:
Executed by:
  • libcrypto.so.1.1
15100
120-
121 tmp.tm_year = n * 100 - 1900;-
122 break;
executed 15100 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
15100
123 case
executed 37083 times by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
1:
executed 37083 times by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
37083
124 if (d->type == 23
d->type == 23Description
TRUEevaluated 22271 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 14812 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
14812-22271
125 tmp.tm_year = n < 50
n < 50Description
TRUEevaluated 19393 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2878 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? n + 100 : n;
executed 22271 times by 1 test: tmp.tm_year = n < 50 ? n + 100 : n;
Executed by:
  • libcrypto.so.1.1
2878-22271
126 else-
127 tmp.tm_year += n;
executed 14812 times by 1 test: tmp.tm_year += n;
Executed by:
  • libcrypto.so.1.1
14812
128 break;
executed 37083 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
37083
129 case
executed 36351 times by 1 test: case 2:
Executed by:
  • libcrypto.so.1.1
2:
executed 36351 times by 1 test: case 2:
Executed by:
  • libcrypto.so.1.1
36351
130 tmp.tm_mon = n - 1;-
131 break;
executed 36351 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
36351
132 case
executed 35997 times by 1 test: case 3:
Executed by:
  • libcrypto.so.1.1
3:
executed 35997 times by 1 test: case 3:
Executed by:
  • libcrypto.so.1.1
35997
133-
134 if (tmp.tm_mon == 1
tmp.tm_mon == 1Description
TRUEevaluated 10540 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 25457 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
10540-25457
135-
136 md = mdays[1] + leap_year(tmp.tm_year + 1900);-
137 }
executed 10540 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
10540
138 md = mdays[tmp.tm_mon];-
139 }
executed 25457 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
25457
140 if (n > md
n > mdDescription
TRUEevaluated 797 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 35200 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
797-35200
141 goto
executed 797 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 797 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
797
142 tmp.tm_mday = n;-
143 determine_days(&tmp);-
144 break;
executed 35200 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
35200
145 case
executed 34371 times by 1 test: case 4:
Executed by:
  • libcrypto.so.1.1
4:
executed 34371 times by 1 test: case 4:
Executed by:
  • libcrypto.so.1.1
34371
146 tmp.tm_hour = n;-
147 break;
executed 34371 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
34371
148 case
executed 34058 times by 1 test: case 5:
Executed by:
  • libcrypto.so.1.1
5:
executed 34058 times by 1 test: case 5:
Executed by:
  • libcrypto.so.1.1
34058
149 tmp.tm_min = n;-
150 break;
executed 34058 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
34058
151 case
executed 27854 times by 1 test: case 6:
Executed by:
  • libcrypto.so.1.1
6:
executed 27854 times by 1 test: case 6:
Executed by:
  • libcrypto.so.1.1
27854
152 tmp.tm_sec = n;-
153 break;
executed 27854 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
27854
154 }-
155 }
executed 220017 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
220017
156-
157-
158-
159-
160-
161 if (d->type == 24
d->type == 24Description
TRUEevaluated 12934 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 20348 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& a[o] == '.'
a[o] == '.'Description
TRUEevaluated 5084 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7850 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
5084-20348
162 if (strict
strictDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5082 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
2-5082
163-
164 goto
executed 2 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 2 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
2
165 if (++
++o == lDescription
TRUEevaluated 215 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4867 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
o == l
++o == lDescription
TRUEevaluated 215 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4867 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
215-4867
166 goto
executed 215 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 215 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
215
167 i = o;-
168 while ((
(o < l)Description
TRUEevaluated 22748 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 208 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
o < l)
(o < l)Description
TRUEevaluated 22748 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 208 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& (
(ossl_ctype_ch...((a[o]), 0x4))Description
TRUEevaluated 18089 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4659 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
ossl_ctype_check((a[o]), 0x4))
(ossl_ctype_ch...((a[o]), 0x4))Description
TRUEevaluated 18089 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4659 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
208-22748
169 o++;
executed 18089 times by 1 test: o++;
Executed by:
  • libcrypto.so.1.1
18089
170-
171 if (i == o
i == oDescription
TRUEevaluated 400 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4467 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
400-4467
172 goto
executed 400 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 400 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
400
173-
174 if (o == l
o == lDescription
TRUEevaluated 208 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4259 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
208-4259
175 goto
executed 208 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 208 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
208
176 }
executed 4259 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
4259
177-
178-
179-
180-
181-
182-
183 if (a[o] == 'Z'
a[o] == 'Z'Description
TRUEevaluated 27348 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5109 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
5109-27348
184 o++;-
185 }
executed 27348 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else if (!strict
!strictDescription
TRUEevaluated 5105 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& ((
(a[o] == '+')Description
TRUEevaluated 1286 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3819 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
a[o] == '+')
(a[o] == '+')Description
TRUEevaluated 1286 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3819 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| (
(a[o] == '-')Description
TRUEevaluated 3382 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 437 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
a[o] == '-')
(a[o] == '-')Description
TRUEevaluated 3382 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 437 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)) {
4-27348
186 int offsign = a[o] == '-'
a[o] == '-'Description
TRUEevaluated 3382 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1286 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? 1 : -1;
1286-3382
187 int offset = 0;-
188-
189 o++;-
190-
191-
192-
193-
194-
195-
196 if (o + 4 != l
o + 4 != lDescription
TRUEevaluated 439 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4229 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
439-4229
197 goto
executed 439 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 439 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
439
198 for (i = end; i < end + 2
i < end + 2Description
TRUEevaluated 7716 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3259 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
3259-7716
199 if (!(ossl_ctype_check((a[o]), 0x4))
!(ossl_ctype_c...((a[o]), 0x4))Description
TRUEevaluated 329 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7387 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
329-7387
200 goto
executed 329 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 329 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
329
201 n = a[o] - '0';-
202 o++;-
203 if (!(ossl_ctype_check((a[o]), 0x4))
!(ossl_ctype_c...((a[o]), 0x4))Description
TRUEevaluated 315 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7072 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
315-7072
204 goto
executed 315 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 315 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
315
205 n = (n * 10) + a[o] - '0';-
206 i2 = (
(d->type == 23)Description
TRUEevaluated 2848 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4224 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
d->type == 23)
(d->type == 23)Description
TRUEevaluated 2848 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4224 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? i + 1 : i;
2848-4224
207 if ((
(n < min[i2])Description
TRUEnever evaluated
FALSEevaluated 7072 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
n < min[i2])
(n < min[i2])Description
TRUEnever evaluated
FALSEevaluated 7072 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| (
(n > max[i2])Description
TRUEevaluated 326 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 6746 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
n > max[i2])
(n > max[i2])Description
TRUEevaluated 326 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 6746 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-7072
208 goto
executed 326 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 326 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
326
209-
210 if (tm !=
tm != ((void *)0)Description
TRUEevaluated 6698 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 48 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
48-6698
211 ((void *)0)
tm != ((void *)0)Description
TRUEevaluated 6698 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 48 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
48-6698
212 ) {-
213 if (i == end
i == endDescription
TRUEevaluated 3463 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3235 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
3235-3463
214 offset = n * 3600;
executed 3463 times by 1 test: offset = n * 3600;
Executed by:
  • libcrypto.so.1.1
3463
215 else if (i == end + 1
i == end + 1Description
TRUEevaluated 3235 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-3235
216 offset += n * 60;
executed 3235 times by 1 test: offset += n * 60;
Executed by:
  • libcrypto.so.1.1
3235
217 }
executed 6698 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
6698
218 o++;-
219 }
executed 6746 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
6746
220 if (offset
offsetDescription
TRUEevaluated 2602 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 657 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& !OPENSSL_gmtime_adj(&tmp, 0, offset * offsign)
!OPENSSL_gmtim...set * offsign)Description
TRUEevaluated 217 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2385 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
217-2602
221 goto
executed 217 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 217 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
217
222 }
executed 3042 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
3042
223-
224 goto
executed 441 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 441 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
441
225 }-
226 if (o == l
o == lDescription
TRUEevaluated 29379 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1011 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
1011-29379
227-
228 if (tm !=
tm != ((void *)0)Description
TRUEevaluated 27430 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1949 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1949-27430
229 ((void *)0)
tm != ((void *)0)Description
TRUEevaluated 27430 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1949 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1949-27430
230 )-
231 *
executed 27430 times by 1 test: *tm = tmp;
Executed by:
  • libcrypto.so.1.1
tm = tmp;
executed 27430 times by 1 test: *tm = tmp;
Executed by:
  • libcrypto.so.1.1
27430
232 return
executed 29379 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 29379 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
29379
233 }-
234 err:
code before this statement executed 1011 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
1011
235 return
executed 14781 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 14781 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
14781
236}-
237-
238ASN1_TIME *asn1_time_from_tm(ASN1_TIME *s, struct tm *ts, int type)-
239{-
240 char* p;-
241 ASN1_TIME *tmps = -
242 ((void *)0)-
243 ;-
244 const size_t len = 20;-
245-
246 if (type == -1
type == -1Description
TRUEevaluated 8348 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1822 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
1822-8348
247 if (is_utc(ts->tm_year)
is_utc(ts->tm_year)Description
TRUEevaluated 8340 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
8-8340
248 type = 23;
executed 8340 times by 1 test: type = 23;
Executed by:
  • libcrypto.so.1.1
8340
249 else-
250 type = 24;
executed 8 times by 1 test: type = 24;
Executed by:
  • libcrypto.so.1.1
8
251 } else if (type == 23
type == 23Description
TRUEnever evaluated
FALSEevaluated 1822 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-1822
252 if (!is_utc(ts->tm_year)
!is_utc(ts->tm_year)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
253 goto
never executed: goto err;
err;
never executed: goto err;
0
254 }
never executed: end of block
else if (type != 24
type != 24Description
TRUEnever evaluated
FALSEevaluated 1822 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-1822
255 goto
never executed: goto err;
err;
never executed: goto err;
0
256 }-
257-
258 if (s ==
s == ((void *)0)Description
TRUEevaluated 8303 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1867 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1867-8303
259 ((void *)0)
s == ((void *)0)Description
TRUEevaluated 8303 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1867 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1867-8303
260 )-
261 tmps = ASN1_STRING_new();
executed 8303 times by 1 test: tmps = ASN1_STRING_new();
Executed by:
  • libcrypto.so.1.1
8303
262 else-
263 tmps = s;
executed 1867 times by 1 test: tmps = s;
Executed by:
  • libcrypto.so.1.1
1867
264 if (tmps ==
tmps == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 10170 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-10170
265 ((void *)0)
tmps == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 10170 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-10170
266 )-
267 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
268 ((void *)0)
never executed: return ((void *)0) ;
0
269 ;
never executed: return ((void *)0) ;
0
270-
271 if (!ASN1_STRING_set(tmps,
!ASN1_STRING_s...id *)0) , len)Description
TRUEnever evaluated
FALSEevaluated 10170 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-10170
272 ((void *)0)
!ASN1_STRING_s...id *)0) , len)Description
TRUEnever evaluated
FALSEevaluated 10170 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-10170
273 , len)
!ASN1_STRING_s...id *)0) , len)Description
TRUEnever evaluated
FALSEevaluated 10170 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-10170
274 goto
never executed: goto err;
err;
never executed: goto err;
0
275-
276 tmps->type = type;-
277 p = (char*)tmps->data;-
278-
279 if (type == 24
type == 24Description
TRUEevaluated 1830 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 8340 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
1830-8340
280 tmps->length = BIO_snprintf(p, len, "%04d%02d%02d%02d%02d%02dZ",
executed 1830 times by 1 test: tmps->length = BIO_snprintf(p, len, "%04d%02d%02d%02d%02d%02dZ", ts->tm_year + 1900, ts->tm_mon + 1, ts->tm_mday, ts->tm_hour, ts->tm_min, ts->tm_sec);
Executed by:
  • libcrypto.so.1.1
1830
281 ts->tm_year + 1900, ts->tm_mon + 1,
executed 1830 times by 1 test: tmps->length = BIO_snprintf(p, len, "%04d%02d%02d%02d%02d%02dZ", ts->tm_year + 1900, ts->tm_mon + 1, ts->tm_mday, ts->tm_hour, ts->tm_min, ts->tm_sec);
Executed by:
  • libcrypto.so.1.1
1830
282 ts->tm_mday, ts->tm_hour, ts->tm_min,
executed 1830 times by 1 test: tmps->length = BIO_snprintf(p, len, "%04d%02d%02d%02d%02d%02dZ", ts->tm_year + 1900, ts->tm_mon + 1, ts->tm_mday, ts->tm_hour, ts->tm_min, ts->tm_sec);
Executed by:
  • libcrypto.so.1.1
1830
283 ts->tm_sec);
executed 1830 times by 1 test: tmps->length = BIO_snprintf(p, len, "%04d%02d%02d%02d%02d%02dZ", ts->tm_year + 1900, ts->tm_mon + 1, ts->tm_mday, ts->tm_hour, ts->tm_min, ts->tm_sec);
Executed by:
  • libcrypto.so.1.1
1830
284 else-
285 tmps->length = BIO_snprintf(p, len, "%02d%02d%02d%02d%02d%02dZ",
executed 8340 times by 1 test: tmps->length = BIO_snprintf(p, len, "%02d%02d%02d%02d%02d%02dZ", ts->tm_year % 100, ts->tm_mon + 1, ts->tm_mday, ts->tm_hour, ts->tm_min, ts->tm_sec);
Executed by:
  • libcrypto.so.1.1
8340
286 ts->tm_year % 100, ts->tm_mon + 1,
executed 8340 times by 1 test: tmps->length = BIO_snprintf(p, len, "%02d%02d%02d%02d%02d%02dZ", ts->tm_year % 100, ts->tm_mon + 1, ts->tm_mday, ts->tm_hour, ts->tm_min, ts->tm_sec);
Executed by:
  • libcrypto.so.1.1
8340
287 ts->tm_mday, ts->tm_hour, ts->tm_min,
executed 8340 times by 1 test: tmps->length = BIO_snprintf(p, len, "%02d%02d%02d%02d%02d%02dZ", ts->tm_year % 100, ts->tm_mon + 1, ts->tm_mday, ts->tm_hour, ts->tm_min, ts->tm_sec);
Executed by:
  • libcrypto.so.1.1
8340
288 ts->tm_sec);
executed 8340 times by 1 test: tmps->length = BIO_snprintf(p, len, "%02d%02d%02d%02d%02d%02dZ", ts->tm_year % 100, ts->tm_mon + 1, ts->tm_mday, ts->tm_hour, ts->tm_min, ts->tm_sec);
Executed by:
  • libcrypto.so.1.1
8340
289-
290-
291-
292-
293 return
executed 10170 times by 1 test: return tmps;
Executed by:
  • libcrypto.so.1.1
tmps;
executed 10170 times by 1 test: return tmps;
Executed by:
  • libcrypto.so.1.1
10170
294 err:-
295 if (tmps != s
tmps != sDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
296 ASN1_STRING_free(tmps);
never executed: ASN1_STRING_free(tmps);
0
297 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
298 ((void *)0)
never executed: return ((void *)0) ;
0
299 ;
never executed: return ((void *)0) ;
0
300}-
301-
302ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t)-
303{-
304 return
executed 111 times by 1 test: return ASN1_TIME_adj(s, t, 0, 0);
Executed by:
  • libcrypto.so.1.1
ASN1_TIME_adj(s, t, 0, 0);
executed 111 times by 1 test: return ASN1_TIME_adj(s, t, 0, 0);
Executed by:
  • libcrypto.so.1.1
111
305}-
306-
307ASN1_TIME *ASN1_TIME_adj(ASN1_TIME *s, time_t t,-
308 int offset_day, long offset_sec)-
309{-
310 struct tm *ts;-
311 struct tm data;-
312-
313 ts = OPENSSL_gmtime(&t, &data);-
314 if (ts ==
ts == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 8319 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-8319
315 ((void *)0)
ts == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 8319 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-8319
316 ) {-
317 ERR_put_error(13,(217),(173),__FILE__,326);-
318 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
319 ((void *)0)
never executed: return ((void *)0) ;
0
320 ;
never executed: return ((void *)0) ;
0
321 }-
322 if (offset_day
offset_dayDescription
TRUEevaluated 17 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 8302 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| offset_sec
offset_secDescription
TRUEnever evaluated
FALSEevaluated 8302 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-8302
323 if (!OPENSSL_gmtime_adj(ts, offset_day, offset_sec)
!OPENSSL_gmtim...y, offset_sec)Description
TRUEnever evaluated
FALSEevaluated 17 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-17
324 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
325 ((void *)0)
never executed: return ((void *)0) ;
0
326 ;
never executed: return ((void *)0) ;
0
327 }
executed 17 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
17
328 return
executed 8319 times by 1 test: return asn1_time_from_tm(s, ts, -1);
Executed by:
  • libcrypto.so.1.1
asn1_time_from_tm(s, ts, -1);
executed 8319 times by 1 test: return asn1_time_from_tm(s, ts, -1);
Executed by:
  • libcrypto.so.1.1
8319
329}-
330-
331int ASN1_TIME_check(const ASN1_TIME *t)-
332{-
333 if (t->type == 24
t->type == 24Description
TRUEevaluated 56 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 36 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
36-56
334 return
executed 56 times by 1 test: return ASN1_GENERALIZEDTIME_check(t);
Executed by:
  • libcrypto.so.1.1
ASN1_GENERALIZEDTIME_check(t);
executed 56 times by 1 test: return ASN1_GENERALIZEDTIME_check(t);
Executed by:
  • libcrypto.so.1.1
56
335 else if (t->type == 23
t->type == 23Description
TRUEevaluated 36 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-36
336 return
executed 36 times by 1 test: return ASN1_UTCTIME_check(t);
Executed by:
  • libcrypto.so.1.1
ASN1_UTCTIME_check(t);
executed 36 times by 1 test: return ASN1_UTCTIME_check(t);
Executed by:
  • libcrypto.so.1.1
36
337 return
never executed: return 0;
0;
never executed: return 0;
0
338}-
339-
340-
341ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(const ASN1_TIME *t,-
342 ASN1_GENERALIZEDTIME **out)-
343{-
344 ASN1_GENERALIZEDTIME *ret = -
345 ((void *)0)-
346 ;-
347 struct tm tm;-
348-
349 if (!ASN1_TIME_to_tm(t, &tm)
!ASN1_TIME_to_tm(t, &tm)Description
TRUEnever evaluated
FALSEevaluated 16 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-16
350 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
351 ((void *)0)
never executed: return ((void *)0) ;
0
352 ;
never executed: return ((void *)0) ;
0
353-
354 if (out !=
out != ((void *)0)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
4-12
355 ((void *)0)
out != ((void *)0)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
4-12
356 )-
357 ret = *out;
executed 4 times by 1 test: ret = *out;
Executed by:
  • libcrypto.so.1.1
4
358-
359 ret = asn1_time_from_tm(ret, &tm, 24);-
360-
361 if (out !=
out != ((void *)0)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
4-12
362 ((void *)0)
out != ((void *)0)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
4-12
363 && ret !=
ret != ((void *)0)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-4
364 ((void *)0)
ret != ((void *)0)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-4
365 )-
366 *
executed 4 times by 1 test: *out = ret;
Executed by:
  • libcrypto.so.1.1
out = ret;
executed 4 times by 1 test: *out = ret;
Executed by:
  • libcrypto.so.1.1
4
367-
368 return
executed 16 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 16 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
16
369}-
370-
371int ASN1_TIME_set_string(ASN1_TIME *s, const char *str)-
372{-
373-
374 if (ASN1_UTCTIME_set_string(s, str)
ASN1_UTCTIME_s...string(s, str)Description
TRUEevaluated 25 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 83 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
25-83
375 return
executed 25 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 25 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
25
376 return
executed 83 times by 1 test: return ASN1_GENERALIZEDTIME_set_string(s, str);
Executed by:
  • libcrypto.so.1.1
ASN1_GENERALIZEDTIME_set_string(s, str);
executed 83 times by 1 test: return ASN1_GENERALIZEDTIME_set_string(s, str);
Executed by:
  • libcrypto.so.1.1
83
377}-
378-
379int ASN1_TIME_set_string_X509(ASN1_TIME *s, const char *str)-
380{-
381 ASN1_TIME t;-
382 struct tm tm;-
383 int rv = 0;-
384-
385 t.length = strlen(str);-
386 t.data = (unsigned char *)str;-
387 t.flags = 0x100;-
388-
389 t.type = 23;-
390-
391 if (!ASN1_TIME_check(&t)
!ASN1_TIME_check(&t)Description
TRUEevaluated 17 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
3-17
392 t.type = 24;-
393 if (!ASN1_TIME_check(&t)
!ASN1_TIME_check(&t)Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
5-12
394 goto
executed 12 times by 1 test: goto out;
Executed by:
  • libcrypto.so.1.1
out;
executed 12 times by 1 test: goto out;
Executed by:
  • libcrypto.so.1.1
12
395 }
executed 5 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
5
396 if (s !=
s != ((void *)0)Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
3-5
397 ((void *)0)
s != ((void *)0)Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
3-5
398 && t.type == 24
t.type == 24Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
2-3
399 if (!asn1_time_to_tm(&tm, &t)
!asn1_time_to_tm(&tm, &t)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-3
400 goto
never executed: goto out;
out;
never executed: goto out;
0
401 if (is_utc(tm.tm_year)
is_utc(tm.tm_year)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
1-2
402 t.length -= 2;-
403-
404-
405-
406-
407-
408 t.data = CRYPTO_zalloc(t.length + 1, __FILE__, 416);-
409 if (t.data ==
t.data == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1
410 ((void *)0)
t.data == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1
411 )-
412 goto
never executed: goto out;
out;
never executed: goto out;
0
413 memcpy(t.data, str + 2, t.length);-
414 t.type = 23;-
415 }
executed 1 time by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1
416 }
executed 3 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
3
417-
418 if (s ==
s == ((void *)0)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
3-5
419 ((void *)0)
s == ((void *)0)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
3-5
420 || ASN1_STRING_copy((ASN1_STRING *)s, (ASN1_STRING *)&t)
ASN1_STRING_co...1_STRING *)&t)Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-5
421 rv = 1;
executed 8 times by 1 test: rv = 1;
Executed by:
  • libcrypto.so.1.1
8
422-
423 if (t.data != (unsigned char *)str
t.data != (unsigned char *)strDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
1-7
424 CRYPTO_free(t.data, __FILE__, 428);
executed 1 time by 1 test: CRYPTO_free(t.data, __FILE__, 428);
Executed by:
  • libcrypto.so.1.1
1
425out:
code before this statement executed 8 times by 1 test: out:
Executed by:
  • libcrypto.so.1.1
8
426 return
executed 20 times by 1 test: return rv;
Executed by:
  • libcrypto.so.1.1
rv;
executed 20 times by 1 test: return rv;
Executed by:
  • libcrypto.so.1.1
20
427}-
428-
429int ASN1_TIME_to_tm(const ASN1_TIME *s, struct tm *tm)-
430{-
431 if (s ==
s == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 16818 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-16818
432 ((void *)0)
s == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 16818 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-16818
433 ) {-
434 time_t now_t;-
435-
436 time(&now_t);-
437 memset(tm, 0, sizeof(*tm));-
438 if (OPENSSL_gmtime(&now_t, tm) !=
OPENSSL_gmtime...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
439 ((void *)0)
OPENSSL_gmtime...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
440 )-
441 return
never executed: return 1;
1;
never executed: return 1;
0
442 return
never executed: return 0;
0;
never executed: return 0;
0
443 }-
444-
445 return
executed 16818 times by 1 test: return asn1_time_to_tm(tm, s);
Executed by:
  • libcrypto.so.1.1
asn1_time_to_tm(tm, s);
executed 16818 times by 1 test: return asn1_time_to_tm(tm, s);
Executed by:
  • libcrypto.so.1.1
16818
446}-
447-
448int ASN1_TIME_diff(int *pday, int *psec,-
449 const ASN1_TIME *from, const ASN1_TIME *to)-
450{-
451 struct tm tm_from, tm_to;-
452-
453 if (!ASN1_TIME_to_tm(from, &tm_from)
!ASN1_TIME_to_...rom, &tm_from)Description
TRUEevaluated 53 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 8246 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
53-8246
454 return
executed 53 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 53 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
53
455 if (!ASN1_TIME_to_tm(to, &tm_to)
!ASN1_TIME_to_tm(to, &tm_to)Description
TRUEnever evaluated
FALSEevaluated 8246 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-8246
456 return
never executed: return 0;
0;
never executed: return 0;
0
457 return
executed 8246 times by 1 test: return OPENSSL_gmtime_diff(pday, psec, &tm_from, &tm_to);
Executed by:
  • libcrypto.so.1.1
OPENSSL_gmtime_diff(pday, psec, &tm_from, &tm_to);
executed 8246 times by 1 test: return OPENSSL_gmtime_diff(pday, psec, &tm_from, &tm_to);
Executed by:
  • libcrypto.so.1.1
8246
458}-
459-
460static const char _asn1_mon[12][4] = {-
461 "Jan", "Feb", "Mar", "Apr", "May", "Jun",-
462 "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"-
463};-
464-
465int ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm)-
466{-
467 char *v;-
468 int gmt = 0, l;-
469 struct tm stm;-
470-
471 if (!asn1_time_to_tm(&stm, tm)
!asn1_time_to_tm(&stm, tm)Description
TRUEevaluated 14056 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 10662 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
10662-14056
472-
473 goto
executed 14056 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
err;
executed 14056 times by 1 test: goto err;
Executed by:
  • libcrypto.so.1.1
14056
474 }-
475-
476 l = tm->length;-
477 v = (char *)tm->data;-
478 if (v[l - 1] == 'Z'
v[l - 1] == 'Z'Description
TRUEevaluated 7768 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2894 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
2894-7768
479 gmt = 1;
executed 7768 times by 1 test: gmt = 1;
Executed by:
  • libcrypto.so.1.1
7768
480-
481 if (tm->type == 24
tm->type == 24Description
TRUEevaluated 4479 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 6183 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
4479-6183
482 char *f = -
483 ((void *)0)-
484 ;-
485 int f_len = 0;-
486-
487-
488-
489-
490-
491 if (tm->length > 15
tm->length > 15Description
TRUEevaluated 3569 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 910 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& v[14] == '.'
v[14] == '.'Description
TRUEevaluated 2373 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1196 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
910-3569
492 f = &v[14];-
493 f_len = 1;-
494 while (14 + f_len < l
14 + f_len < lDescription
TRUEevaluated 14487 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& (
(ossl_ctype_ch...f_len]), 0x4))Description
TRUEevaluated 12114 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2373 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
ossl_ctype_check((f[f_len]), 0x4))
(ossl_ctype_ch...f_len]), 0x4))Description
TRUEevaluated 12114 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2373 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-14487
495 ++
executed 12114 times by 1 test: ++f_len;
Executed by:
  • libcrypto.so.1.1
f_len;
executed 12114 times by 1 test: ++f_len;
Executed by:
  • libcrypto.so.1.1
12114
496 }
executed 2373 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
2373
497-
498 return
executed 4479 times by 1 test: return BIO_printf(bp, "%s %2d %02d:%02d:%02d%.*s %d%s", _asn1_mon[stm.tm_mon], stm.tm_mday, stm.tm_hour, stm.tm_min, stm.tm_sec, f_len, f, stm.tm_year + 1900, (gmt ? " GMT" : "")) > 0;
Executed by:
  • libcrypto.so.1.1
BIO_printf(bp, "%s %2d %02d:%02d:%02d%.*s %d%s",
executed 4479 times by 1 test: return BIO_printf(bp, "%s %2d %02d:%02d:%02d%.*s %d%s", _asn1_mon[stm.tm_mon], stm.tm_mday, stm.tm_hour, stm.tm_min, stm.tm_sec, f_len, f, stm.tm_year + 1900, (gmt ? " GMT" : "")) > 0;
Executed by:
  • libcrypto.so.1.1
4479
499 _asn1_mon[stm.tm_mon], stm.tm_mday, stm.tm_hour,
executed 4479 times by 1 test: return BIO_printf(bp, "%s %2d %02d:%02d:%02d%.*s %d%s", _asn1_mon[stm.tm_mon], stm.tm_mday, stm.tm_hour, stm.tm_min, stm.tm_sec, f_len, f, stm.tm_year + 1900, (gmt ? " GMT" : "")) > 0;
Executed by:
  • libcrypto.so.1.1
4479
500 stm.tm_min, stm.tm_sec, f_len, f, stm.tm_year + 1900,
executed 4479 times by 1 test: return BIO_printf(bp, "%s %2d %02d:%02d:%02d%.*s %d%s", _asn1_mon[stm.tm_mon], stm.tm_mday, stm.tm_hour, stm.tm_min, stm.tm_sec, f_len, f, stm.tm_year + 1900, (gmt ? " GMT" : "")) > 0;
Executed by:
  • libcrypto.so.1.1
4479
501 (gmt ? " GMT" : "")) > 0;
executed 4479 times by 1 test: return BIO_printf(bp, "%s %2d %02d:%02d:%02d%.*s %d%s", _asn1_mon[stm.tm_mon], stm.tm_mday, stm.tm_hour, stm.tm_min, stm.tm_sec, f_len, f, stm.tm_year + 1900, (gmt ? " GMT" : "")) > 0;
Executed by:
  • libcrypto.so.1.1
4479
502 } else {-
503 return
executed 6183 times by 1 test: return BIO_printf(bp, "%s %2d %02d:%02d:%02d %d%s", _asn1_mon[stm.tm_mon], stm.tm_mday, stm.tm_hour, stm.tm_min, stm.tm_sec, stm.tm_year + 1900, (gmt ? " GMT" : "")) > 0;
Executed by:
  • libcrypto.so.1.1
BIO_printf(bp, "%s %2d %02d:%02d:%02d %d%s",
executed 6183 times by 1 test: return BIO_printf(bp, "%s %2d %02d:%02d:%02d %d%s", _asn1_mon[stm.tm_mon], stm.tm_mday, stm.tm_hour, stm.tm_min, stm.tm_sec, stm.tm_year + 1900, (gmt ? " GMT" : "")) > 0;
Executed by:
  • libcrypto.so.1.1
6183
504 _asn1_mon[stm.tm_mon], stm.tm_mday, stm.tm_hour,
executed 6183 times by 1 test: return BIO_printf(bp, "%s %2d %02d:%02d:%02d %d%s", _asn1_mon[stm.tm_mon], stm.tm_mday, stm.tm_hour, stm.tm_min, stm.tm_sec, stm.tm_year + 1900, (gmt ? " GMT" : "")) > 0;
Executed by:
  • libcrypto.so.1.1
6183
505 stm.tm_min, stm.tm_sec, stm.tm_year + 1900,
executed 6183 times by 1 test: return BIO_printf(bp, "%s %2d %02d:%02d:%02d %d%s", _asn1_mon[stm.tm_mon], stm.tm_mday, stm.tm_hour, stm.tm_min, stm.tm_sec, stm.tm_year + 1900, (gmt ? " GMT" : "")) > 0;
Executed by:
  • libcrypto.so.1.1
6183
506 (gmt ? " GMT" : "")) > 0;
executed 6183 times by 1 test: return BIO_printf(bp, "%s %2d %02d:%02d:%02d %d%s", _asn1_mon[stm.tm_mon], stm.tm_mday, stm.tm_hour, stm.tm_min, stm.tm_sec, stm.tm_year + 1900, (gmt ? " GMT" : "")) > 0;
Executed by:
  • libcrypto.so.1.1
6183
507 }-
508 err:-
509 BIO_write(bp, "Bad time value", 14);-
510 return
executed 14056 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 14056 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
14056
511}-
512-
513int ASN1_TIME_cmp_time_t(const ASN1_TIME *s, time_t t)-
514{-
515 struct tm stm, ttm;-
516 int day, sec;-
517-
518 if (!ASN1_TIME_to_tm(s, &stm)
!ASN1_TIME_to_tm(s, &stm)Description
TRUEnever evaluated
FALSEevaluated 179 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-179
519 return
never executed: return -2;
-2;
never executed: return -2;
0
520-
521 if (!OPENSSL_gmtime(&t, &ttm)
!OPENSSL_gmtime(&t, &ttm)Description
TRUEnever evaluated
FALSEevaluated 179 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-179
522 return
never executed: return -2;
-2;
never executed: return -2;
0
523-
524 if (!OPENSSL_gmtime_diff(&day, &sec, &ttm, &stm)
!OPENSSL_gmtim...c, &ttm, &stm)Description
TRUEnever evaluated
FALSEevaluated 179 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-179
525 return
never executed: return -2;
-2;
never executed: return -2;
0
526-
527 if (day > 0
day > 0Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 155 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| sec > 0
sec > 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 151 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
4-155
528 return
executed 28 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 28 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
28
529 if (day < 0
day < 0Description
TRUEevaluated 27 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 124 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| sec < 0
sec < 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 120 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
4-124
530 return
executed 31 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
-1;
executed 31 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
31
531 return
executed 120 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 120 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
120
532}-
533-
534int ASN1_TIME_normalize(ASN1_TIME *t)-
535{-
536 struct tm tm;-
537-
538 if (!ASN1_TIME_to_tm(t, &tm)
!ASN1_TIME_to_tm(t, &tm)Description
TRUEnever evaluated
FALSEevaluated 29 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-29
539 return
never executed: return 0;
0;
never executed: return 0;
0
540-
541 return
executed 29 times by 1 test: return asn1_time_from_tm(t, &tm, -1) != ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
asn1_time_from_tm(t, &tm, -1) !=
executed 29 times by 1 test: return asn1_time_from_tm(t, &tm, -1) != ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
29
542 ((void *)0)
executed 29 times by 1 test: return asn1_time_from_tm(t, &tm, -1) != ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
29
543 ;
executed 29 times by 1 test: return asn1_time_from_tm(t, &tm, -1) != ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
29
544}-
545-
546int ASN1_TIME_compare(const ASN1_TIME *a, const ASN1_TIME *b)-
547{-
548 int day, sec;-
549-
550 if (!ASN1_TIME_diff(&day, &sec, b, a)
!ASN1_TIME_dif...y, &sec, b, a)Description
TRUEnever evaluated
FALSEevaluated 55 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-55
551 return
never executed: return -2;
-2;
never executed: return -2;
0
552 if (day > 0
day > 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 51 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| sec > 0
sec > 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 47 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
4-51
553 return
executed 8 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 8 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
8
554 if (day < 0
day < 0Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 39 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| sec < 0
sec < 0Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 32 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
7-39
555 return
executed 15 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
-1;
executed 15 times by 1 test: return -1;
Executed by:
  • libcrypto.so.1.1
15
556 return
executed 32 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 32 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
32
557}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2