| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/asn1/a_time.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | const ASN1_ITEM ASN1_TIME_it = { 0x5, 0x4000 | 0x8000, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | , 0, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | , sizeof(ASN1_STRING), "ASN1_TIME" }; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | ASN1_TIME *d2i_ASN1_TIME(ASN1_TIME **a, const unsigned char **in, long len) { return never executed: (ASN1_TIME *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(ASN1_TIME_it)));return (ASN1_TIME *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(ASN1_TIME_it)));never executed: } int i2d_ASN1_TIME(ASN1_TIME *a, unsigned char **out) { returnreturn (ASN1_TIME *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(ASN1_TIME_it)));never executed: ASN1_item_i2d((ASN1_VALUE *)a, out, (&(ASN1_TIME_it)));return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(ASN1_TIME_it)));never executed: } ASN1_TIME *ASN1_TIME_new(void) { returnreturn ASN1_item_i2d((ASN1_VALUE *)a, out, (&(ASN1_TIME_it)));executed 117 times by 1 test: (ASN1_TIME *)ASN1_item_new((&(ASN1_TIME_it)));return (ASN1_TIME *)ASN1_item_new((&(ASN1_TIME_it)));Executed by:
executed 117 times by 1 test: } void ASN1_TIME_free(ASN1_TIME *a) { ASN1_item_free((ASN1_VALUE *)a, (&(ASN1_TIME_it))); }return (ASN1_TIME *)ASN1_item_new((&(ASN1_TIME_it)));Executed by:
executed 8321 times by 1 test: end of blockExecuted by:
| 0-8321 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | static int is_utc(const int year) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | if (50 <= year
| 3-8344 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | return executed 8341 times by 1 test: 1;return 1;Executed by:
executed 8341 times by 1 test: return 1;Executed by:
| 8341 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | return executed 10 times by 1 test: 0;return 0;Executed by:
executed 10 times by 1 test: return 0;Executed by:
| 10 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | static int leap_year(const int year) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | if (year % 400 == 0
| 390-22368 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | return executed 3349 times by 1 test: 1;return 1;Executed by:
executed 3349 times by 1 test: return 1;Executed by:
| 3349 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | return executed 20491 times by 1 test: 0;return 0;Executed by:
executed 20491 times by 1 test: return 0;Executed by:
| 20491 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | static 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
| 13300-21900 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | tm->tm_yday += leap_year(y); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | m += 2; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | } executed 13300 times by 1 test: else {end of blockExecuted by:
| 13300 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | m += 14; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | y--; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | } executed 21900 times by 1 test: end of blockExecuted by:
| 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 blockExecuted by:
| 35200 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | int 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
| 18809-25351 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | if (d->flags & 0x100
| 20-25331 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | min_l = 13; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | strict = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | } executed 20 times by 1 test: end of blockExecuted by:
| 20 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | } executed 25351 times by 1 test: else if (d->type == 24end of blockExecuted by:
| 0-25351 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | end = 7; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | btz = 6; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | if (d->flags & 0x100
| 20-18789 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | min_l = 15; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | strict = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | } executed 20 times by 1 test: else {end of blockExecuted by:
| 20 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | min_l = 13; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | } executed 18789 times by 1 test: end of blockExecuted by:
| 18789 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | } else { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | return never executed: 0;return 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
| 6457-37703 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | goto executed 6457 times by 1 test: err;goto err;Executed by:
executed 6457 times by 1 test: goto err;Executed by:
| 6457 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | for (i = 0; i < end
| 27854-229866 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | if (!strict
| 151-229715 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | i++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | break; executed 5428 times by 1 test: break;Executed by:
| 5428 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | if (!(ossl_ctype_check((a[o]), 0x4))
| 977-223461 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | goto executed 977 times by 1 test: err;goto err;Executed by:
executed 977 times by 1 test: goto err;Executed by:
| 977 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | n = a[o] - '0'; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | if (++
| 486-222975 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | goto executed 486 times by 1 test: err;goto err;Executed by:
executed 486 times by 1 test: goto err;Executed by:
| 486 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | if (!(ossl_ctype_check((a[o]), 0x4))
| 848-222127 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | goto executed 848 times by 1 test: err;goto err;Executed by:
executed 848 times by 1 test: goto err;Executed by:
| 848 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | n = (n * 10) + a[o] - '0'; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | if (++
| 106-222021 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | goto executed 106 times by 1 test: err;goto err;Executed by:
executed 106 times by 1 test: goto err;Executed by:
| 106 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | i2 = (
| 95699-126322 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | if ((
| 531-221490 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | goto executed 1207 times by 1 test: err;goto err;Executed by:
executed 1207 times by 1 test: goto err;Executed by:
| 1207 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | switch (i2) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | case executed 15100 times by 1 test: 0:case 0:Executed by:
executed 15100 times by 1 test: case 0:Executed by:
| 15100 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | tmp.tm_year = n * 100 - 1900; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | break; executed 15100 times by 1 test: break;Executed by:
| 15100 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | case executed 37083 times by 1 test: 1:case 1:Executed by:
executed 37083 times by 1 test: case 1:Executed by:
| 37083 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | if (d->type == 23
| 14812-22271 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | tmp.tm_year = n < 50
executed 22271 times by 1 test: tmp.tm_year = n < 50 ? n + 100 : n;Executed by:
| 2878-22271 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | tmp.tm_year += n; executed 14812 times by 1 test: tmp.tm_year += n;Executed by:
| 14812 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | break; executed 37083 times by 1 test: break;Executed by:
| 37083 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | case executed 36351 times by 1 test: 2:case 2:Executed by:
executed 36351 times by 1 test: case 2:Executed by:
| 36351 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | tmp.tm_mon = n - 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | break; executed 36351 times by 1 test: break;Executed by:
| 36351 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | case executed 35997 times by 1 test: 3:case 3:Executed by:
executed 35997 times by 1 test: case 3:Executed by:
| 35997 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | if (tmp.tm_mon == 1
| 10540-25457 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | md = mdays[1] + leap_year(tmp.tm_year + 1900); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | } executed 10540 times by 1 test: else {end of blockExecuted by:
| 10540 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | md = mdays[tmp.tm_mon]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | } executed 25457 times by 1 test: end of blockExecuted by:
| 25457 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | if (n > md
| 797-35200 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | goto executed 797 times by 1 test: err;goto err;Executed by:
executed 797 times by 1 test: goto err;Executed by:
| 797 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | tmp.tm_mday = n; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | determine_days(&tmp); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | break; executed 35200 times by 1 test: break;Executed by:
| 35200 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | case executed 34371 times by 1 test: 4:case 4:Executed by:
executed 34371 times by 1 test: case 4:Executed by:
| 34371 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | tmp.tm_hour = n; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | break; executed 34371 times by 1 test: break;Executed by:
| 34371 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | case executed 34058 times by 1 test: 5:case 5:Executed by:
executed 34058 times by 1 test: case 5:Executed by:
| 34058 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | tmp.tm_min = n; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | break; executed 34058 times by 1 test: break;Executed by:
| 34058 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | case executed 27854 times by 1 test: 6:case 6:Executed by:
executed 27854 times by 1 test: case 6:Executed by:
| 27854 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | tmp.tm_sec = n; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | break; executed 27854 times by 1 test: break;Executed by:
| 27854 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | } executed 220017 times by 1 test: end of blockExecuted by:
| 220017 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | if (d->type == 24
| 5084-20348 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | if (strict
| 2-5082 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | goto executed 2 times by 1 test: err;goto err;Executed by:
executed 2 times by 1 test: goto err;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | if (++
| 215-4867 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | goto executed 215 times by 1 test: err;goto err;Executed by:
executed 215 times by 1 test: goto err;Executed by:
| 215 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | i = o; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | while ((
| 208-22748 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | o++; executed 18089 times by 1 test: o++;Executed by:
| 18089 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | if (i == o
| 400-4467 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | goto executed 400 times by 1 test: err;goto err;Executed by:
executed 400 times by 1 test: goto err;Executed by:
| 400 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | if (o == l
| 208-4259 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | goto executed 208 times by 1 test: err;goto err;Executed by:
executed 208 times by 1 test: goto err;Executed by:
| 208 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | } executed 4259 times by 1 test: end of blockExecuted by:
| 4259 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | if (a[o] == 'Z'
| 5109-27348 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | o++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | } executed 27348 times by 1 test: else if (!strictend of blockExecuted by:
| 4-27348 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | int offsign = a[o] == '-'
| 1286-3382 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | int offset = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | o++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | if (o + 4 != l
| 439-4229 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | goto executed 439 times by 1 test: err;goto err;Executed by:
executed 439 times by 1 test: goto err;Executed by:
| 439 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | for (i = end; i < end + 2
| 3259-7716 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | if (!(ossl_ctype_check((a[o]), 0x4))
| 329-7387 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | goto executed 329 times by 1 test: err;goto err;Executed by:
executed 329 times by 1 test: goto err;Executed by:
| 329 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | n = a[o] - '0'; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | o++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | if (!(ossl_ctype_check((a[o]), 0x4))
| 315-7072 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | goto executed 315 times by 1 test: err;goto err;Executed by:
executed 315 times by 1 test: goto err;Executed by:
| 315 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | n = (n * 10) + a[o] - '0'; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | i2 = (
| 2848-4224 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | if ((
| 0-7072 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | goto executed 326 times by 1 test: err;goto err;Executed by:
executed 326 times by 1 test: goto err;Executed by:
| 326 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | if (tm !=
| 48-6698 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | ((void *)0)
| 48-6698 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | ) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | if (i == end
| 3235-3463 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | offset = n * 3600; executed 3463 times by 1 test: offset = n * 3600;Executed by:
| 3463 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | else if (i == end + 1
| 0-3235 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | offset += n * 60; executed 3235 times by 1 test: offset += n * 60;Executed by:
| 3235 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | } executed 6698 times by 1 test: end of blockExecuted by:
| 6698 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | o++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | } executed 6746 times by 1 test: end of blockExecuted by:
| 6746 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | if (offset
| 217-2602 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | goto executed 217 times by 1 test: err;goto err;Executed by:
executed 217 times by 1 test: goto err;Executed by:
| 217 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | } executed 3042 times by 1 test: else {end of blockExecuted by:
| 3042 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | goto executed 441 times by 1 test: err;goto err;Executed by:
executed 441 times by 1 test: goto err;Executed by:
| 441 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | if (o == l
| 1011-29379 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | if (tm !=
| 1949-27430 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | ((void *)0)
| 1949-27430 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | * executed 27430 times by 1 test: tm = tmp;*tm = tmp;Executed by:
executed 27430 times by 1 test: *tm = tmp;Executed by:
| 27430 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | return executed 29379 times by 1 test: 1;return 1;Executed by:
executed 29379 times by 1 test: return 1;Executed by:
| 29379 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | err: code before this statement executed 1011 times by 1 test: err:Executed by:
| 1011 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | return executed 14781 times by 1 test: 0;return 0;Executed by:
executed 14781 times by 1 test: return 0;Executed by:
| 14781 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | ASN1_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
| 1822-8348 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | if (is_utc(ts->tm_year)
| 8-8340 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | type = 23; executed 8340 times by 1 test: type = 23;Executed by:
| 8340 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | type = 24; executed 8 times by 1 test: type = 24;Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | } else if (type == 23
| 0-1822 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | if (!is_utc(ts->tm_year)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | } never executed: else if (type != 24end of block
| 0-1822 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | if (s ==
| 1867-8303 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | ((void *)0)
| 1867-8303 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | tmps = ASN1_STRING_new(); executed 8303 times by 1 test: tmps = ASN1_STRING_new();Executed by:
| 8303 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | tmps = s; executed 1867 times by 1 test: tmps = s;Executed by:
| 1867 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | if (tmps ==
| 0-10170 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | ((void *)0)
| 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,
| 0-10170 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | ((void *)0)
| 0-10170 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | , len)
| 0-10170 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | tmps->type = type; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | p = (char*)tmps->data; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | if (type == 24
| 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:
| 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:
| 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:
| 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:
| 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:
| 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:
| 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:
| 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:
| 8340 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 292 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 293 | return executed 10170 times by 1 test: tmps;return tmps;Executed by:
executed 10170 times by 1 test: return tmps;Executed by:
| 10170 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 294 | err: | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | if (tmps != s
| 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 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 302 | ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 303 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 304 | return executed 111 times by 1 test: ASN1_TIME_adj(s, t, 0, 0);return ASN1_TIME_adj(s, t, 0, 0);Executed by:
executed 111 times by 1 test: return ASN1_TIME_adj(s, t, 0, 0);Executed by:
| 111 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 305 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 306 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 307 | ASN1_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 ==
| 0-8319 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 315 | ((void *)0)
| 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
| 0-8302 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 323 | if (!OPENSSL_gmtime_adj(ts, offset_day, offset_sec)
| 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 blockExecuted by:
| 17 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 328 | return executed 8319 times by 1 test: asn1_time_from_tm(s, ts, -1);return asn1_time_from_tm(s, ts, -1);Executed by:
executed 8319 times by 1 test: return asn1_time_from_tm(s, ts, -1);Executed by:
| 8319 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 329 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 330 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 331 | int ASN1_TIME_check(const ASN1_TIME *t) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 332 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 333 | if (t->type == 24
| 36-56 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 334 | return executed 56 times by 1 test: ASN1_GENERALIZEDTIME_check(t);return ASN1_GENERALIZEDTIME_check(t);Executed by:
executed 56 times by 1 test: return ASN1_GENERALIZEDTIME_check(t);Executed by:
| 56 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 335 | else if (t->type == 23
| 0-36 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 336 | return executed 36 times by 1 test: ASN1_UTCTIME_check(t);return ASN1_UTCTIME_check(t);Executed by:
executed 36 times by 1 test: return ASN1_UTCTIME_check(t);Executed by:
| 36 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 337 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 338 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 339 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 340 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 341 | ASN1_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)
| 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 !=
| 4-12 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 355 | ((void *)0)
| 4-12 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 356 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 357 | ret = *out; executed 4 times by 1 test: ret = *out;Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 358 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 359 | ret = asn1_time_from_tm(ret, &tm, 24); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 360 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 361 | if (out !=
| 4-12 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 362 | ((void *)0)
| 4-12 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 363 | && ret !=
| 0-4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 364 | ((void *)0)
| 0-4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 365 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 366 | * executed 4 times by 1 test: out = ret;*out = ret;Executed by:
executed 4 times by 1 test: *out = ret;Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 367 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 368 | return executed 16 times by 1 test: ret;return ret;Executed by:
executed 16 times by 1 test: return ret;Executed by:
| 16 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 369 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 370 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 371 | int ASN1_TIME_set_string(ASN1_TIME *s, const char *str) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 372 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 373 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 374 | if (ASN1_UTCTIME_set_string(s, str)
| 25-83 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 375 | return executed 25 times by 1 test: 1;return 1;Executed by:
executed 25 times by 1 test: return 1;Executed by:
| 25 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 376 | return executed 83 times by 1 test: ASN1_GENERALIZEDTIME_set_string(s, str);return ASN1_GENERALIZEDTIME_set_string(s, str);Executed by:
executed 83 times by 1 test: return ASN1_GENERALIZEDTIME_set_string(s, str);Executed by:
| 83 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 377 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 378 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 379 | int 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)
| 3-17 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 392 | t.type = 24; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 393 | if (!ASN1_TIME_check(&t)
| 5-12 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 394 | goto executed 12 times by 1 test: out;goto out;Executed by:
executed 12 times by 1 test: goto out;Executed by:
| 12 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 395 | } executed 5 times by 1 test: end of blockExecuted by:
| 5 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 396 | if (s !=
| 3-5 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 397 | ((void *)0)
| 3-5 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 398 | && t.type == 24
| 2-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 399 | if (!asn1_time_to_tm(&tm, &t)
| 0-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 400 | goto never executed: out;goto out;never executed: goto out; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 401 | if (is_utc(tm.tm_year)
| 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 ==
| 0-1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 410 | ((void *)0)
| 0-1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 411 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 412 | goto never executed: out;goto 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 blockExecuted by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 416 | } executed 3 times by 1 test: end of blockExecuted by:
| 3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 417 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 418 | if (s ==
| 3-5 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 419 | ((void *)0)
| 3-5 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 420 | || ASN1_STRING_copy((ASN1_STRING *)s, (ASN1_STRING *)&t)
| 0-5 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 421 | rv = 1; executed 8 times by 1 test: rv = 1;Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 422 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 423 | if (t.data != (unsigned char *)str
| 1-7 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 424 | CRYPTO_free(t.data, __FILE__, 428); executed 1 time by 1 test: CRYPTO_free(t.data, __FILE__, 428);Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 425 | out: code before this statement executed 8 times by 1 test: out:Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 426 | return executed 20 times by 1 test: rv;return rv;Executed by:
executed 20 times by 1 test: return rv;Executed by:
| 20 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 427 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 428 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 429 | int ASN1_TIME_to_tm(const ASN1_TIME *s, struct tm *tm) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 430 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 431 | if (s ==
| 0-16818 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 432 | ((void *)0)
| 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) !=
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 439 | ((void *)0)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 440 | ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 441 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 442 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 443 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 444 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 445 | return executed 16818 times by 1 test: asn1_time_to_tm(tm, s);return asn1_time_to_tm(tm, s);Executed by:
executed 16818 times by 1 test: return asn1_time_to_tm(tm, s);Executed by:
| 16818 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 446 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 447 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 448 | int 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)
| 53-8246 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 454 | return executed 53 times by 1 test: 0;return 0;Executed by:
executed 53 times by 1 test: return 0;Executed by:
| 53 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 455 | if (!ASN1_TIME_to_tm(to, &tm_to)
| 0-8246 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 456 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 457 | return executed 8246 times by 1 test: OPENSSL_gmtime_diff(pday, psec, &tm_from, &tm_to);return OPENSSL_gmtime_diff(pday, psec, &tm_from, &tm_to);Executed by:
executed 8246 times by 1 test: return OPENSSL_gmtime_diff(pday, psec, &tm_from, &tm_to);Executed by:
| 8246 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 458 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 459 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 460 | static const char _asn1_mon[12][4] = { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 461 | "Jan", "Feb", "Mar", "Apr", "May", "Jun", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 462 | "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 463 | }; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 464 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 465 | int 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)
| 10662-14056 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 472 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 473 | goto executed 14056 times by 1 test: err;goto err;Executed by:
executed 14056 times by 1 test: goto err;Executed by:
| 14056 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 474 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 475 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 476 | l = tm->length; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 477 | v = (char *)tm->data; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 478 | if (v[l - 1] == 'Z'
| 2894-7768 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 479 | gmt = 1; executed 7768 times by 1 test: gmt = 1;Executed by:
| 7768 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 480 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 481 | if (tm->type == 24
| 4479-6183 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 482 | char *f = | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 483 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 484 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 485 | int f_len = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 486 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 487 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 488 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 489 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 490 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 491 | if (tm->length > 15
| 910-3569 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 492 | f = &v[14]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 493 | f_len = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 494 | while (14 + f_len < l
| 0-14487 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 495 | ++ executed 12114 times by 1 test: f_len;++f_len;Executed by:
executed 12114 times by 1 test: ++f_len;Executed by:
| 12114 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 496 | } executed 2373 times by 1 test: end of blockExecuted by:
| 2373 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 497 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 498 | return executed 4479 times by 1 test: BIO_printf(bp, "%s %2d %02d:%02d:%02d%.*s %d%s",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:
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:
| 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:
| 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:
| 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:
| 4479 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 502 | } else { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 503 | return executed 6183 times by 1 test: BIO_printf(bp, "%s %2d %02d:%02d:%02d %d%s",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:
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:
| 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:
| 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:
| 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:
| 6183 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 507 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 508 | err: | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 509 | BIO_write(bp, "Bad time value", 14); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 510 | return executed 14056 times by 1 test: 0;return 0;Executed by:
executed 14056 times by 1 test: return 0;Executed by:
| 14056 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 511 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 512 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 513 | int 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)
| 0-179 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 519 | return never executed: -2;return -2;never executed: return -2; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 520 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 521 | if (!OPENSSL_gmtime(&t, &ttm)
| 0-179 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 522 | return never executed: -2;return -2;never executed: return -2; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 523 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 524 | if (!OPENSSL_gmtime_diff(&day, &sec, &ttm, &stm)
| 0-179 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 525 | return never executed: -2;return -2;never executed: return -2; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 526 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 527 | if (day > 0
| 4-155 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 528 | return executed 28 times by 1 test: 1;return 1;Executed by:
executed 28 times by 1 test: return 1;Executed by:
| 28 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 529 | if (day < 0
| 4-124 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 530 | return executed 31 times by 1 test: -1;return -1;Executed by:
executed 31 times by 1 test: return -1;Executed by:
| 31 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 531 | return executed 120 times by 1 test: 0;return 0;Executed by:
executed 120 times by 1 test: return 0;Executed by:
| 120 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 532 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 533 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 534 | int ASN1_TIME_normalize(ASN1_TIME *t) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 535 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 536 | struct tm tm; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 537 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 538 | if (!ASN1_TIME_to_tm(t, &tm)
| 0-29 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 539 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 540 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 541 | return executed 29 times by 1 test: asn1_time_from_tm(t, &tm, -1) != return asn1_time_from_tm(t, &tm, -1) != ((void *)0) ;Executed by:
executed 29 times by 1 test: return asn1_time_from_tm(t, &tm, -1) != ((void *)0) ;Executed by:
| 29 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 542 | ((void *)0) executed 29 times by 1 test: return asn1_time_from_tm(t, &tm, -1) != ((void *)0) ;Executed by:
| 29 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 543 | ; executed 29 times by 1 test: return asn1_time_from_tm(t, &tm, -1) != ((void *)0) ;Executed by:
| 29 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 544 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 545 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 546 | int 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)
| 0-55 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 551 | return never executed: -2;return -2;never executed: return -2; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 552 | if (day > 0
| 4-51 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 553 | return executed 8 times by 1 test: 1;return 1;Executed by:
executed 8 times by 1 test: return 1;Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 554 | if (day < 0
| 7-39 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 555 | return executed 15 times by 1 test: -1;return -1;Executed by:
executed 15 times by 1 test: return -1;Executed by:
| 15 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 556 | return executed 32 times by 1 test: 0;return 0;Executed by:
executed 32 times by 1 test: return 0;Executed by:
| 32 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 557 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |