| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/x509/x_crl.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||
| 2 | static int X509_REVOKED_cmp(const X509_REVOKED *const *a, | - | ||||||||||||||||||
| 3 | const X509_REVOKED *const *b); | - | ||||||||||||||||||
| 4 | static void setup_idp(X509_CRL *crl, ISSUING_DIST_POINT *idp); | - | ||||||||||||||||||
| 5 | - | |||||||||||||||||||
| 6 | static const ASN1_TEMPLATE X509_REVOKED_seq_tt[] = { | - | ||||||||||||||||||
| 7 | { ((0x1 << 12)), (0), | - | ||||||||||||||||||
| 8 | __builtin_offsetof ( | - | ||||||||||||||||||
| 9 | X509_REVOKED | - | ||||||||||||||||||
| 10 | , | - | ||||||||||||||||||
| 11 | serialNumber | - | ||||||||||||||||||
| 12 | ) | - | ||||||||||||||||||
| 13 | , "serialNumber", (&(ASN1_INTEGER_it)) }, | - | ||||||||||||||||||
| 14 | { (0), (0), | - | ||||||||||||||||||
| 15 | __builtin_offsetof ( | - | ||||||||||||||||||
| 16 | X509_REVOKED | - | ||||||||||||||||||
| 17 | , | - | ||||||||||||||||||
| 18 | revocationDate | - | ||||||||||||||||||
| 19 | ) | - | ||||||||||||||||||
| 20 | , "revocationDate", (&(ASN1_TIME_it)) }, | - | ||||||||||||||||||
| 21 | { ((0x2 << 1)|(0x1)), (0), | - | ||||||||||||||||||
| 22 | __builtin_offsetof ( | - | ||||||||||||||||||
| 23 | X509_REVOKED | - | ||||||||||||||||||
| 24 | , | - | ||||||||||||||||||
| 25 | extensions | - | ||||||||||||||||||
| 26 | ) | - | ||||||||||||||||||
| 27 | , "extensions", (&(X509_EXTENSION_it)) } | - | ||||||||||||||||||
| 28 | } ; const ASN1_ITEM X509_REVOKED_it = { 0x1, 16, X509_REVOKED_seq_tt, sizeof(X509_REVOKED_seq_tt) / sizeof(ASN1_TEMPLATE), | - | ||||||||||||||||||
| 29 | ((void *)0) | - | ||||||||||||||||||
| 30 | , sizeof(X509_REVOKED), "X509_REVOKED" }; | - | ||||||||||||||||||
| 31 | - | |||||||||||||||||||
| 32 | static int def_crl_verify(X509_CRL *crl, EVP_PKEY *r); | - | ||||||||||||||||||
| 33 | static int def_crl_lookup(X509_CRL *crl, | - | ||||||||||||||||||
| 34 | X509_REVOKED **ret, ASN1_INTEGER *serial, | - | ||||||||||||||||||
| 35 | X509_NAME *issuer); | - | ||||||||||||||||||
| 36 | - | |||||||||||||||||||
| 37 | static X509_CRL_METHOD int_crl_meth = { | - | ||||||||||||||||||
| 38 | 0, | - | ||||||||||||||||||
| 39 | 0, 0, | - | ||||||||||||||||||
| 40 | def_crl_lookup, | - | ||||||||||||||||||
| 41 | def_crl_verify | - | ||||||||||||||||||
| 42 | }; | - | ||||||||||||||||||
| 43 | - | |||||||||||||||||||
| 44 | static const X509_CRL_METHOD *default_crl_method = &int_crl_meth; | - | ||||||||||||||||||
| 45 | - | |||||||||||||||||||
| 46 | - | |||||||||||||||||||
| 47 | - | |||||||||||||||||||
| 48 | - | |||||||||||||||||||
| 49 | - | |||||||||||||||||||
| 50 | - | |||||||||||||||||||
| 51 | static int crl_inf_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, | - | ||||||||||||||||||
| 52 | void *exarg) | - | ||||||||||||||||||
| 53 | { | - | ||||||||||||||||||
| 54 | X509_CRL_INFO *a = (X509_CRL_INFO *)*pval; | - | ||||||||||||||||||
| 55 | - | |||||||||||||||||||
| 56 | if (!a
| 2962-233918 | ||||||||||||||||||
| 57 | return executed 231300 times by 1 test: 1;return 1;Executed by:
executed 231300 times by 1 test: return 1;Executed by:
| 231300 | ||||||||||||||||||
| 58 | switch (operation) { | - | ||||||||||||||||||
| 59 | - | |||||||||||||||||||
| 60 | - | |||||||||||||||||||
| 61 | - | |||||||||||||||||||
| 62 | - | |||||||||||||||||||
| 63 | case executed 2745 times by 1 test: 5:case 5:Executed by:
executed 2745 times by 1 test: case 5:Executed by:
| 2745 | ||||||||||||||||||
| 64 | (void)sk_X509_REVOKED_set_cmp_func(a->revoked, X509_REVOKED_cmp); | - | ||||||||||||||||||
| 65 | break; executed 2745 times by 1 test: break;Executed by:
| 2745 | ||||||||||||||||||
| 66 | } | - | ||||||||||||||||||
| 67 | return executed 5580 times by 1 test: 1;return 1;Executed by:
executed 5580 times by 1 test: return 1;Executed by:
| 5580 | ||||||||||||||||||
| 68 | } | - | ||||||||||||||||||
| 69 | - | |||||||||||||||||||
| 70 | - | |||||||||||||||||||
| 71 | static const ASN1_AUX X509_CRL_INFO_aux = { | - | ||||||||||||||||||
| 72 | ((void *)0) | - | ||||||||||||||||||
| 73 | , 2, 0, 0, crl_inf_cb, | - | ||||||||||||||||||
| 74 | __builtin_offsetof ( | - | ||||||||||||||||||
| 75 | X509_CRL_INFO | - | ||||||||||||||||||
| 76 | , | - | ||||||||||||||||||
| 77 | enc | - | ||||||||||||||||||
| 78 | ) | - | ||||||||||||||||||
| 79 | }; static const ASN1_TEMPLATE X509_CRL_INFO_seq_tt[] = { | - | ||||||||||||||||||
| 80 | { ((0x1)), (0), | - | ||||||||||||||||||
| 81 | __builtin_offsetof ( | - | ||||||||||||||||||
| 82 | X509_CRL_INFO | - | ||||||||||||||||||
| 83 | , | - | ||||||||||||||||||
| 84 | version | - | ||||||||||||||||||
| 85 | ) | - | ||||||||||||||||||
| 86 | , "version", (&(ASN1_INTEGER_it)) }, | - | ||||||||||||||||||
| 87 | { ((0x1 << 12)), (0), | - | ||||||||||||||||||
| 88 | __builtin_offsetof ( | - | ||||||||||||||||||
| 89 | X509_CRL_INFO | - | ||||||||||||||||||
| 90 | , | - | ||||||||||||||||||
| 91 | sig_alg | - | ||||||||||||||||||
| 92 | ) | - | ||||||||||||||||||
| 93 | , "sig_alg", (&(X509_ALGOR_it)) }, | - | ||||||||||||||||||
| 94 | { (0), (0), | - | ||||||||||||||||||
| 95 | __builtin_offsetof ( | - | ||||||||||||||||||
| 96 | X509_CRL_INFO | - | ||||||||||||||||||
| 97 | , | - | ||||||||||||||||||
| 98 | issuer | - | ||||||||||||||||||
| 99 | ) | - | ||||||||||||||||||
| 100 | , "issuer", (&(X509_NAME_it)) }, | - | ||||||||||||||||||
| 101 | { (0), (0), | - | ||||||||||||||||||
| 102 | __builtin_offsetof ( | - | ||||||||||||||||||
| 103 | X509_CRL_INFO | - | ||||||||||||||||||
| 104 | , | - | ||||||||||||||||||
| 105 | lastUpdate | - | ||||||||||||||||||
| 106 | ) | - | ||||||||||||||||||
| 107 | , "lastUpdate", (&(ASN1_TIME_it)) }, | - | ||||||||||||||||||
| 108 | { ((0x1)), (0), | - | ||||||||||||||||||
| 109 | __builtin_offsetof ( | - | ||||||||||||||||||
| 110 | X509_CRL_INFO | - | ||||||||||||||||||
| 111 | , | - | ||||||||||||||||||
| 112 | nextUpdate | - | ||||||||||||||||||
| 113 | ) | - | ||||||||||||||||||
| 114 | , "nextUpdate", (&(ASN1_TIME_it)) }, | - | ||||||||||||||||||
| 115 | { ((0x2 << 1)|(0x1)), (0), | - | ||||||||||||||||||
| 116 | __builtin_offsetof ( | - | ||||||||||||||||||
| 117 | X509_CRL_INFO | - | ||||||||||||||||||
| 118 | , | - | ||||||||||||||||||
| 119 | revoked | - | ||||||||||||||||||
| 120 | ) | - | ||||||||||||||||||
| 121 | , "revoked", (&(X509_REVOKED_it)) }, | - | ||||||||||||||||||
| 122 | { (((0x2 << 3)|(0x2<<6)) | ((0x2 << 1)|(0x1))), (0), | - | ||||||||||||||||||
| 123 | __builtin_offsetof ( | - | ||||||||||||||||||
| 124 | X509_CRL_INFO | - | ||||||||||||||||||
| 125 | , | - | ||||||||||||||||||
| 126 | extensions | - | ||||||||||||||||||
| 127 | ) | - | ||||||||||||||||||
| 128 | , "extensions", (&(X509_EXTENSION_it)) } | - | ||||||||||||||||||
| 129 | } ; const ASN1_ITEM X509_CRL_INFO_it = { 0x1, 16, X509_CRL_INFO_seq_tt, sizeof(X509_CRL_INFO_seq_tt) / sizeof(ASN1_TEMPLATE), &X509_CRL_INFO_aux, sizeof(X509_CRL_INFO), "X509_CRL_INFO" }; | - | ||||||||||||||||||
| 130 | - | |||||||||||||||||||
| 131 | - | |||||||||||||||||||
| 132 | - | |||||||||||||||||||
| 133 | - | |||||||||||||||||||
| 134 | - | |||||||||||||||||||
| 135 | - | |||||||||||||||||||
| 136 | static int crl_set_issuers(X509_CRL *crl) | - | ||||||||||||||||||
| 137 | { | - | ||||||||||||||||||
| 138 | - | |||||||||||||||||||
| 139 | int i, j; | - | ||||||||||||||||||
| 140 | GENERAL_NAMES *gens, *gtmp; | - | ||||||||||||||||||
| 141 | struct stack_st_X509_REVOKED *revoked; | - | ||||||||||||||||||
| 142 | - | |||||||||||||||||||
| 143 | revoked = X509_CRL_get_REVOKED(crl); | - | ||||||||||||||||||
| 144 | - | |||||||||||||||||||
| 145 | gens = | - | ||||||||||||||||||
| 146 | ((void *)0) | - | ||||||||||||||||||
| 147 | ; | - | ||||||||||||||||||
| 148 | for (i = 0; i < sk_X509_REVOKED_num(revoked)
| 14717-32581 | ||||||||||||||||||
| 149 | X509_REVOKED *rev = sk_X509_REVOKED_value(revoked, i); | - | ||||||||||||||||||
| 150 | struct stack_st_X509_EXTENSION *exts; | - | ||||||||||||||||||
| 151 | ASN1_ENUMERATED *reason; | - | ||||||||||||||||||
| 152 | X509_EXTENSION *ext; | - | ||||||||||||||||||
| 153 | gtmp = X509_REVOKED_get_ext_d2i(rev, | - | ||||||||||||||||||
| 154 | 771, &j, | - | ||||||||||||||||||
| 155 | ((void *)0) | - | ||||||||||||||||||
| 156 | ); | - | ||||||||||||||||||
| 157 | if (!gtmp
| 977-13740 | ||||||||||||||||||
| 158 | crl->flags |= 0x80; | - | ||||||||||||||||||
| 159 | return executed 1281 times by 1 test: 1;return 1;Executed by:
executed 1281 times by 1 test: return 1;Executed by:
| 1281 | ||||||||||||||||||
| 160 | } | - | ||||||||||||||||||
| 161 | - | |||||||||||||||||||
| 162 | if (gtmp
| 977-12459 | ||||||||||||||||||
| 163 | gens = gtmp; | - | ||||||||||||||||||
| 164 | if (!crl->issuers
| 163-814 | ||||||||||||||||||
| 165 | crl->issuers = sk_GENERAL_NAMES_new_null(); | - | ||||||||||||||||||
| 166 | if (!crl->issuers
| 0-163 | ||||||||||||||||||
| 167 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 168 | } executed 163 times by 1 test: end of blockExecuted by:
| 163 | ||||||||||||||||||
| 169 | if (!sk_GENERAL_NAMES_push(crl->issuers, gtmp)
| 0-977 | ||||||||||||||||||
| 170 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 171 | } executed 977 times by 1 test: end of blockExecuted by:
| 977 | ||||||||||||||||||
| 172 | rev->issuer = gens; | - | ||||||||||||||||||
| 173 | - | |||||||||||||||||||
| 174 | reason = X509_REVOKED_get_ext_d2i(rev, 141, &j, | - | ||||||||||||||||||
| 175 | ((void *)0) | - | ||||||||||||||||||
| 176 | ); | - | ||||||||||||||||||
| 177 | if (!reason
| 492-10059 | ||||||||||||||||||
| 178 | crl->flags |= 0x80; | - | ||||||||||||||||||
| 179 | return executed 492 times by 1 test: 1;return 1;Executed by:
executed 492 times by 1 test: return 1;Executed by:
| 492 | ||||||||||||||||||
| 180 | } | - | ||||||||||||||||||
| 181 | - | |||||||||||||||||||
| 182 | if (reason
| 3377-9567 | ||||||||||||||||||
| 183 | rev->reason = ASN1_ENUMERATED_get(reason); | - | ||||||||||||||||||
| 184 | ASN1_ENUMERATED_free(reason); | - | ||||||||||||||||||
| 185 | } executed 3377 times by 1 test: elseend of blockExecuted by:
| 3377 | ||||||||||||||||||
| 186 | rev->reason = -1; executed 9567 times by 1 test: rev->reason = -1;Executed by:
| 9567 | ||||||||||||||||||
| 187 | - | |||||||||||||||||||
| 188 | - | |||||||||||||||||||
| 189 | - | |||||||||||||||||||
| 190 | exts = rev->extensions; | - | ||||||||||||||||||
| 191 | - | |||||||||||||||||||
| 192 | for (j = 0; j < sk_X509_EXTENSION_num(exts)
| 5909-10689 | ||||||||||||||||||
| 193 | ext = sk_X509_EXTENSION_value(exts, j); | - | ||||||||||||||||||
| 194 | if (X509_EXTENSION_get_critical(ext)
| 2949-2960 | ||||||||||||||||||
| 195 | if (OBJ_obj2nid(X509_EXTENSION_get_object(ext)) == 771
| 694-2255 | ||||||||||||||||||
| 196 | continue; executed 694 times by 1 test: continue;Executed by:
| 694 | ||||||||||||||||||
| 197 | crl->flags |= 0x200; | - | ||||||||||||||||||
| 198 | break; executed 2255 times by 1 test: break;Executed by:
| 2255 | ||||||||||||||||||
| 199 | } | - | ||||||||||||||||||
| 200 | } executed 2960 times by 1 test: end of blockExecuted by:
| 2960 | ||||||||||||||||||
| 201 | - | |||||||||||||||||||
| 202 | } executed 12944 times by 1 test: end of blockExecuted by:
| 12944 | ||||||||||||||||||
| 203 | - | |||||||||||||||||||
| 204 | return executed 32581 times by 1 test: 1;return 1;Executed by:
executed 32581 times by 1 test: return 1;Executed by:
| 32581 | ||||||||||||||||||
| 205 | - | |||||||||||||||||||
| 206 | } | - | ||||||||||||||||||
| 207 | - | |||||||||||||||||||
| 208 | - | |||||||||||||||||||
| 209 | - | |||||||||||||||||||
| 210 | - | |||||||||||||||||||
| 211 | - | |||||||||||||||||||
| 212 | static int crl_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, | - | ||||||||||||||||||
| 213 | void *exarg) | - | ||||||||||||||||||
| 214 | { | - | ||||||||||||||||||
| 215 | X509_CRL *crl = (X509_CRL *)*pval; | - | ||||||||||||||||||
| 216 | struct stack_st_X509_EXTENSION *exts; | - | ||||||||||||||||||
| 217 | X509_EXTENSION *ext; | - | ||||||||||||||||||
| 218 | int idx; | - | ||||||||||||||||||
| 219 | - | |||||||||||||||||||
| 220 | switch (operation) { | - | ||||||||||||||||||
| 221 | case executed 38050 times by 1 test: 1:case 1:Executed by:
executed 38050 times by 1 test: case 1:Executed by:
| 38050 | ||||||||||||||||||
| 222 | crl->idp = | - | ||||||||||||||||||
| 223 | ((void *)0) | - | ||||||||||||||||||
| 224 | ; | - | ||||||||||||||||||
| 225 | crl->akid = | - | ||||||||||||||||||
| 226 | ((void *)0) | - | ||||||||||||||||||
| 227 | ; | - | ||||||||||||||||||
| 228 | crl->flags = 0; | - | ||||||||||||||||||
| 229 | crl->idp_flags = 0; | - | ||||||||||||||||||
| 230 | crl->idp_reasons = 0x807f; | - | ||||||||||||||||||
| 231 | crl->meth = default_crl_method; | - | ||||||||||||||||||
| 232 | crl->meth_data = | - | ||||||||||||||||||
| 233 | ((void *)0) | - | ||||||||||||||||||
| 234 | ; | - | ||||||||||||||||||
| 235 | crl->issuers = | - | ||||||||||||||||||
| 236 | ((void *)0) | - | ||||||||||||||||||
| 237 | ; | - | ||||||||||||||||||
| 238 | crl->crl_number = | - | ||||||||||||||||||
| 239 | ((void *)0) | - | ||||||||||||||||||
| 240 | ; | - | ||||||||||||||||||
| 241 | crl->base_crl_number = | - | ||||||||||||||||||
| 242 | ((void *)0) | - | ||||||||||||||||||
| 243 | ; | - | ||||||||||||||||||
| 244 | break; executed 38050 times by 1 test: break;Executed by:
| 38050 | ||||||||||||||||||
| 245 | - | |||||||||||||||||||
| 246 | case executed 34354 times by 1 test: 5:case 5:Executed by:
executed 34354 times by 1 test: case 5:Executed by:
| 34354 | ||||||||||||||||||
| 247 | X509_CRL_digest(crl, EVP_sha1(), crl->sha1_hash, | - | ||||||||||||||||||
| 248 | ((void *)0) | - | ||||||||||||||||||
| 249 | ); | - | ||||||||||||||||||
| 250 | crl->idp = X509_CRL_get_ext_d2i(crl, | - | ||||||||||||||||||
| 251 | 770, | - | ||||||||||||||||||
| 252 | ((void *)0) | - | ||||||||||||||||||
| 253 | , | - | ||||||||||||||||||
| 254 | - | |||||||||||||||||||
| 255 | ((void *)0) | - | ||||||||||||||||||
| 256 | ); | - | ||||||||||||||||||
| 257 | if (crl->idp
| 9609-24745 | ||||||||||||||||||
| 258 | setup_idp(crl, crl->idp); executed 9609 times by 1 test: setup_idp(crl, crl->idp);Executed by:
| 9609 | ||||||||||||||||||
| 259 | - | |||||||||||||||||||
| 260 | crl->akid = X509_CRL_get_ext_d2i(crl, | - | ||||||||||||||||||
| 261 | 90, | - | ||||||||||||||||||
| 262 | ((void *)0) | - | ||||||||||||||||||
| 263 | , | - | ||||||||||||||||||
| 264 | - | |||||||||||||||||||
| 265 | ((void *)0) | - | ||||||||||||||||||
| 266 | ); | - | ||||||||||||||||||
| 267 | - | |||||||||||||||||||
| 268 | crl->crl_number = X509_CRL_get_ext_d2i(crl, | - | ||||||||||||||||||
| 269 | 88, | - | ||||||||||||||||||
| 270 | ((void *)0) | - | ||||||||||||||||||
| 271 | , | - | ||||||||||||||||||
| 272 | ((void *)0) | - | ||||||||||||||||||
| 273 | ); | - | ||||||||||||||||||
| 274 | - | |||||||||||||||||||
| 275 | crl->base_crl_number = X509_CRL_get_ext_d2i(crl, | - | ||||||||||||||||||
| 276 | 140, | - | ||||||||||||||||||
| 277 | ((void *)0) | - | ||||||||||||||||||
| 278 | , | - | ||||||||||||||||||
| 279 | - | |||||||||||||||||||
| 280 | ((void *)0) | - | ||||||||||||||||||
| 281 | ); | - | ||||||||||||||||||
| 282 | - | |||||||||||||||||||
| 283 | if (crl->base_crl_number
| 398-33471 | ||||||||||||||||||
| 284 | crl->flags |= 0x80; executed 398 times by 1 test: crl->flags |= 0x80;Executed by:
| 398 | ||||||||||||||||||
| 285 | exts = crl->crl.extensions; | - | ||||||||||||||||||
| 286 | - | |||||||||||||||||||
| 287 | for (idx = 0; idx < sk_X509_EXTENSION_num(exts)
| 33868-69211 | ||||||||||||||||||
| 288 | int nid; | - | ||||||||||||||||||
| 289 | ext = sk_X509_EXTENSION_value(exts, idx); | - | ||||||||||||||||||
| 290 | nid = OBJ_obj2nid(X509_EXTENSION_get_object(ext)); | - | ||||||||||||||||||
| 291 | if (nid == 857
| 2728-66483 | ||||||||||||||||||
| 292 | crl->flags |= 0x1000; executed 2728 times by 1 test: crl->flags |= 0x1000;Executed by:
| 2728 | ||||||||||||||||||
| 293 | if (X509_EXTENSION_get_critical(ext)
| 3094-66117 | ||||||||||||||||||
| 294 | - | |||||||||||||||||||
| 295 | if ((
| 1190-1904 | ||||||||||||||||||
| 296 | || (
| 836-1068 | ||||||||||||||||||
| 297 | || (
| 486-582 | ||||||||||||||||||
| 298 | continue; executed 2608 times by 1 test: continue;Executed by:
| 2608 | ||||||||||||||||||
| 299 | crl->flags |= 0x200; | - | ||||||||||||||||||
| 300 | break; executed 486 times by 1 test: break;Executed by:
| 486 | ||||||||||||||||||
| 301 | } | - | ||||||||||||||||||
| 302 | } executed 66117 times by 1 test: end of blockExecuted by:
| 66117 | ||||||||||||||||||
| 303 | - | |||||||||||||||||||
| 304 | if (!crl_set_issuers(crl)
| 0-34354 | ||||||||||||||||||
| 305 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 306 | - | |||||||||||||||||||
| 307 | if (crl->meth->crl_init
| 0-34354 | ||||||||||||||||||
| 308 | if (crl->meth->crl_init(crl) == 0
| 0 | ||||||||||||||||||
| 309 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 310 | } never executed: end of block | 0 | ||||||||||||||||||
| 311 | - | |||||||||||||||||||
| 312 | crl->flags |= 0x100; | - | ||||||||||||||||||
| 313 | break; executed 34354 times by 1 test: break;Executed by:
| 34354 | ||||||||||||||||||
| 314 | - | |||||||||||||||||||
| 315 | case executed 38050 times by 1 test: 3:case 3:Executed by:
executed 38050 times by 1 test: case 3:Executed by:
| 38050 | ||||||||||||||||||
| 316 | if (crl->meth->crl_free
| 0-38050 | ||||||||||||||||||
| 317 | if (!crl->meth->crl_free(crl)
| 0 | ||||||||||||||||||
| 318 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 319 | } never executed: end of block | 0 | ||||||||||||||||||
| 320 | AUTHORITY_KEYID_free(crl->akid); | - | ||||||||||||||||||
| 321 | ISSUING_DIST_POINT_free(crl->idp); | - | ||||||||||||||||||
| 322 | ASN1_INTEGER_free(crl->crl_number); | - | ||||||||||||||||||
| 323 | ASN1_INTEGER_free(crl->base_crl_number); | - | ||||||||||||||||||
| 324 | sk_GENERAL_NAMES_pop_free(crl->issuers, GENERAL_NAMES_free); | - | ||||||||||||||||||
| 325 | break; executed 38050 times by 1 test: break;Executed by:
| 38050 | ||||||||||||||||||
| 326 | } | - | ||||||||||||||||||
| 327 | return executed 333946 times by 1 test: 1;return 1;Executed by:
executed 333946 times by 1 test: return 1;Executed by:
| 333946 | ||||||||||||||||||
| 328 | } | - | ||||||||||||||||||
| 329 | - | |||||||||||||||||||
| 330 | - | |||||||||||||||||||
| 331 | - | |||||||||||||||||||
| 332 | static void setup_idp(X509_CRL *crl, ISSUING_DIST_POINT *idp) | - | ||||||||||||||||||
| 333 | { | - | ||||||||||||||||||
| 334 | int idp_only = 0; | - | ||||||||||||||||||
| 335 | - | |||||||||||||||||||
| 336 | crl->idp_flags |= 0x1; | - | ||||||||||||||||||
| 337 | if (idp->onlyuser > 0
| 398-9211 | ||||||||||||||||||
| 338 | idp_only++; | - | ||||||||||||||||||
| 339 | crl->idp_flags |= 0x4; | - | ||||||||||||||||||
| 340 | } executed 398 times by 1 test: end of blockExecuted by:
| 398 | ||||||||||||||||||
| 341 | if (idp->onlyCA > 0
| 390-9219 | ||||||||||||||||||
| 342 | idp_only++; | - | ||||||||||||||||||
| 343 | crl->idp_flags |= 0x8; | - | ||||||||||||||||||
| 344 | } executed 390 times by 1 test: end of blockExecuted by:
| 390 | ||||||||||||||||||
| 345 | if (idp->onlyattr > 0
| 401-9208 | ||||||||||||||||||
| 346 | idp_only++; | - | ||||||||||||||||||
| 347 | crl->idp_flags |= 0x10; | - | ||||||||||||||||||
| 348 | } executed 401 times by 1 test: end of blockExecuted by:
| 401 | ||||||||||||||||||
| 349 | - | |||||||||||||||||||
| 350 | if (idp_only > 1
| 398-9211 | ||||||||||||||||||
| 351 | crl->idp_flags |= 0x2; executed 398 times by 1 test: crl->idp_flags |= 0x2;Executed by:
| 398 | ||||||||||||||||||
| 352 | - | |||||||||||||||||||
| 353 | if (idp->indirectCRL > 0
| 399-9210 | ||||||||||||||||||
| 354 | crl->idp_flags |= 0x20; executed 399 times by 1 test: crl->idp_flags |= 0x20;Executed by:
| 399 | ||||||||||||||||||
| 355 | - | |||||||||||||||||||
| 356 | if (idp->onlysomereasons
| 1042-8567 | ||||||||||||||||||
| 357 | crl->idp_flags |= 0x40; | - | ||||||||||||||||||
| 358 | if (idp->onlysomereasons->length > 0
| 389-653 | ||||||||||||||||||
| 359 | crl->idp_reasons = idp->onlysomereasons->data[0]; executed 653 times by 1 test: crl->idp_reasons = idp->onlysomereasons->data[0];Executed by:
| 653 | ||||||||||||||||||
| 360 | if (idp->onlysomereasons->length > 1
| 390-652 | ||||||||||||||||||
| 361 | crl->idp_reasons |= (idp->onlysomereasons->data[1] << 8); executed 390 times by 1 test: crl->idp_reasons |= (idp->onlysomereasons->data[1] << 8);Executed by:
| 390 | ||||||||||||||||||
| 362 | crl->idp_reasons &= 0x807f; | - | ||||||||||||||||||
| 363 | } executed 1042 times by 1 test: end of blockExecuted by:
| 1042 | ||||||||||||||||||
| 364 | - | |||||||||||||||||||
| 365 | DIST_POINT_set_dpname(idp->distpoint, X509_CRL_get_issuer(crl)); | - | ||||||||||||||||||
| 366 | } executed 9609 times by 1 test: end of blockExecuted by:
| 9609 | ||||||||||||||||||
| 367 | - | |||||||||||||||||||
| 368 | static const ASN1_AUX X509_CRL_aux = { | - | ||||||||||||||||||
| 369 | ((void *)0) | - | ||||||||||||||||||
| 370 | , 1, | - | ||||||||||||||||||
| 371 | __builtin_offsetof ( | - | ||||||||||||||||||
| 372 | X509_CRL | - | ||||||||||||||||||
| 373 | , | - | ||||||||||||||||||
| 374 | references | - | ||||||||||||||||||
| 375 | ) | - | ||||||||||||||||||
| 376 | , | - | ||||||||||||||||||
| 377 | __builtin_offsetof ( | - | ||||||||||||||||||
| 378 | X509_CRL | - | ||||||||||||||||||
| 379 | , | - | ||||||||||||||||||
| 380 | lock | - | ||||||||||||||||||
| 381 | ) | - | ||||||||||||||||||
| 382 | , crl_cb, 0}; static const ASN1_TEMPLATE X509_CRL_seq_tt[] = { | - | ||||||||||||||||||
| 383 | { ((0x1 << 12)), (0), | - | ||||||||||||||||||
| 384 | __builtin_offsetof ( | - | ||||||||||||||||||
| 385 | X509_CRL | - | ||||||||||||||||||
| 386 | , | - | ||||||||||||||||||
| 387 | crl | - | ||||||||||||||||||
| 388 | ) | - | ||||||||||||||||||
| 389 | , "crl", (&(X509_CRL_INFO_it)) }, | - | ||||||||||||||||||
| 390 | { ((0x1 << 12)), (0), | - | ||||||||||||||||||
| 391 | __builtin_offsetof ( | - | ||||||||||||||||||
| 392 | X509_CRL | - | ||||||||||||||||||
| 393 | , | - | ||||||||||||||||||
| 394 | sig_alg | - | ||||||||||||||||||
| 395 | ) | - | ||||||||||||||||||
| 396 | , "sig_alg", (&(X509_ALGOR_it)) }, | - | ||||||||||||||||||
| 397 | { ((0x1 << 12)), (0), | - | ||||||||||||||||||
| 398 | __builtin_offsetof ( | - | ||||||||||||||||||
| 399 | X509_CRL | - | ||||||||||||||||||
| 400 | , | - | ||||||||||||||||||
| 401 | signature | - | ||||||||||||||||||
| 402 | ) | - | ||||||||||||||||||
| 403 | , "signature", (&(ASN1_BIT_STRING_it)) } | - | ||||||||||||||||||
| 404 | } ; const ASN1_ITEM X509_CRL_it = { 0x1, 16, X509_CRL_seq_tt, sizeof(X509_CRL_seq_tt) / sizeof(ASN1_TEMPLATE), &X509_CRL_aux, sizeof(X509_CRL), "X509_CRL" }; | - | ||||||||||||||||||
| 405 | - | |||||||||||||||||||
| 406 | X509_REVOKED *d2i_X509_REVOKED(X509_REVOKED **a, const unsigned char **in, long len) { return never executed: (X509_REVOKED *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(X509_REVOKED_it)));return (X509_REVOKED *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(X509_REVOKED_it)));never executed: } int i2d_X509_REVOKED(X509_REVOKED *a, unsigned char **out) { returnreturn (X509_REVOKED *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(X509_REVOKED_it)));never executed: ASN1_item_i2d((ASN1_VALUE *)a, out, (&(X509_REVOKED_it)));return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(X509_REVOKED_it)));never executed: } X509_REVOKED *X509_REVOKED_new(void) { returnreturn ASN1_item_i2d((ASN1_VALUE *)a, out, (&(X509_REVOKED_it)));never executed: (X509_REVOKED *)ASN1_item_new((&(X509_REVOKED_it)));return (X509_REVOKED *)ASN1_item_new((&(X509_REVOKED_it)));never executed: } void X509_REVOKED_free(X509_REVOKED *a) { ASN1_item_free((ASN1_VALUE *)a, (&(X509_REVOKED_it))); }return (X509_REVOKED *)ASN1_item_new((&(X509_REVOKED_it)));never executed: end of block | 0 | ||||||||||||||||||
| 407 | - | |||||||||||||||||||
| 408 | X509_REVOKED * X509_REVOKED_dup(X509_REVOKED *x) { return never executed: ASN1_item_dup((&(X509_REVOKED_it)), x);return ASN1_item_dup((&(X509_REVOKED_it)), x);never executed: }return ASN1_item_dup((&(X509_REVOKED_it)), x); | 0 | ||||||||||||||||||
| 409 | - | |||||||||||||||||||
| 410 | X509_CRL_INFO *d2i_X509_CRL_INFO(X509_CRL_INFO **a, const unsigned char **in, long len) { return never executed: (X509_CRL_INFO *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(X509_CRL_INFO_it)));return (X509_CRL_INFO *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(X509_CRL_INFO_it)));never executed: } int i2d_X509_CRL_INFO(X509_CRL_INFO *a, unsigned char **out) { returnreturn (X509_CRL_INFO *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(X509_CRL_INFO_it)));never executed: ASN1_item_i2d((ASN1_VALUE *)a, out, (&(X509_CRL_INFO_it)));return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(X509_CRL_INFO_it)));never executed: } X509_CRL_INFO *X509_CRL_INFO_new(void) { returnreturn ASN1_item_i2d((ASN1_VALUE *)a, out, (&(X509_CRL_INFO_it)));never executed: (X509_CRL_INFO *)ASN1_item_new((&(X509_CRL_INFO_it)));return (X509_CRL_INFO *)ASN1_item_new((&(X509_CRL_INFO_it)));never executed: } void X509_CRL_INFO_free(X509_CRL_INFO *a) { ASN1_item_free((ASN1_VALUE *)a, (&(X509_CRL_INFO_it))); }return (X509_CRL_INFO *)ASN1_item_new((&(X509_CRL_INFO_it)));never executed: end of block | 0 | ||||||||||||||||||
| 411 | - | |||||||||||||||||||
| 412 | X509_CRL *d2i_X509_CRL(X509_CRL **a, const unsigned char **in, long len) { return executed 2076 times by 1 test: (X509_CRL *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(X509_CRL_it)));return (X509_CRL *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(X509_CRL_it)));Executed by:
executed 2076 times by 1 test: } int i2d_X509_CRL(X509_CRL *a, unsigned char **out) { returnreturn (X509_CRL *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(X509_CRL_it)));Executed by:
executed 1846 times by 1 test: ASN1_item_i2d((ASN1_VALUE *)a, out, (&(X509_CRL_it)));return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(X509_CRL_it)));Executed by:
executed 1846 times by 1 test: } X509_CRL *X509_CRL_new(void) { returnreturn ASN1_item_i2d((ASN1_VALUE *)a, out, (&(X509_CRL_it)));Executed by:
never executed: (X509_CRL *)ASN1_item_new((&(X509_CRL_it)));return (X509_CRL *)ASN1_item_new((&(X509_CRL_it)));never executed: } void X509_CRL_free(X509_CRL *a) { ASN1_item_free((ASN1_VALUE *)a, (&(X509_CRL_it))); }return (X509_CRL *)ASN1_item_new((&(X509_CRL_it)));executed 3617 times by 1 test: end of blockExecuted by:
| 0-3617 | ||||||||||||||||||
| 413 | - | |||||||||||||||||||
| 414 | X509_CRL * X509_CRL_dup(X509_CRL *x) { return never executed: ASN1_item_dup((&(X509_CRL_it)), x);return ASN1_item_dup((&(X509_CRL_it)), x);never executed: }return ASN1_item_dup((&(X509_CRL_it)), x); | 0 | ||||||||||||||||||
| 415 | - | |||||||||||||||||||
| 416 | static int X509_REVOKED_cmp(const X509_REVOKED *const *a, | - | ||||||||||||||||||
| 417 | const X509_REVOKED *const *b) | - | ||||||||||||||||||
| 418 | { | - | ||||||||||||||||||
| 419 | return executed 1 time by 1 test: (ASN1_STRING_cmp((ASN1_STRING *)&(*a)->serialNumber,return (ASN1_STRING_cmp((ASN1_STRING *)&(*a)->serialNumber, (ASN1_STRING *)&(*b)->serialNumber));Executed by:
executed 1 time by 1 test: return (ASN1_STRING_cmp((ASN1_STRING *)&(*a)->serialNumber, (ASN1_STRING *)&(*b)->serialNumber));Executed by:
| 1 | ||||||||||||||||||
| 420 | (ASN1_STRING *)&(*b)->serialNumber)); executed 1 time by 1 test: return (ASN1_STRING_cmp((ASN1_STRING *)&(*a)->serialNumber, (ASN1_STRING *)&(*b)->serialNumber));Executed by:
| 1 | ||||||||||||||||||
| 421 | } | - | ||||||||||||||||||
| 422 | - | |||||||||||||||||||
| 423 | int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev) | - | ||||||||||||||||||
| 424 | { | - | ||||||||||||||||||
| 425 | X509_CRL_INFO *inf; | - | ||||||||||||||||||
| 426 | - | |||||||||||||||||||
| 427 | inf = &crl->crl; | - | ||||||||||||||||||
| 428 | if (inf->revoked ==
| 0 | ||||||||||||||||||
| 429 | ((void *)0)
| 0 | ||||||||||||||||||
| 430 | ) | - | ||||||||||||||||||
| 431 | inf->revoked = sk_X509_REVOKED_new(X509_REVOKED_cmp); never executed: inf->revoked = sk_X509_REVOKED_new(X509_REVOKED_cmp); | 0 | ||||||||||||||||||
| 432 | if (inf->revoked ==
| 0 | ||||||||||||||||||
| 433 | ((void *)0)
| 0 | ||||||||||||||||||
| 434 | || !sk_X509_REVOKED_push(inf->revoked, rev)
| 0 | ||||||||||||||||||
| 435 | ERR_put_error(13,(169),((1|64)),__FILE__,317); | - | ||||||||||||||||||
| 436 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 437 | } | - | ||||||||||||||||||
| 438 | inf->enc.modified = 1; | - | ||||||||||||||||||
| 439 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||||||||
| 440 | } | - | ||||||||||||||||||
| 441 | - | |||||||||||||||||||
| 442 | int X509_CRL_verify(X509_CRL *crl, EVP_PKEY *r) | - | ||||||||||||||||||
| 443 | { | - | ||||||||||||||||||
| 444 | if (crl->meth->crl_verify
| 0-5 | ||||||||||||||||||
| 445 | return executed 5 times by 1 test: crl->meth->crl_verify(crl, r);return crl->meth->crl_verify(crl, r);Executed by:
executed 5 times by 1 test: return crl->meth->crl_verify(crl, r);Executed by:
| 5 | ||||||||||||||||||
| 446 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 447 | } | - | ||||||||||||||||||
| 448 | - | |||||||||||||||||||
| 449 | int X509_CRL_get0_by_serial(X509_CRL *crl, | - | ||||||||||||||||||
| 450 | X509_REVOKED **ret, ASN1_INTEGER *serial) | - | ||||||||||||||||||
| 451 | { | - | ||||||||||||||||||
| 452 | if (crl->meth->crl_lookup
| 0 | ||||||||||||||||||
| 453 | return never executed: crl->meth->crl_lookup(crl, ret, serial, return crl->meth->crl_lookup(crl, ret, serial, ((void *)0) );never executed: return crl->meth->crl_lookup(crl, ret, serial, ((void *)0) ); | 0 | ||||||||||||||||||
| 454 | ((void *)0) never executed: return crl->meth->crl_lookup(crl, ret, serial, ((void *)0) ); | 0 | ||||||||||||||||||
| 455 | ); never executed: return crl->meth->crl_lookup(crl, ret, serial, ((void *)0) ); | 0 | ||||||||||||||||||
| 456 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 457 | } | - | ||||||||||||||||||
| 458 | - | |||||||||||||||||||
| 459 | int X509_CRL_get0_by_cert(X509_CRL *crl, X509_REVOKED **ret, X509 *x) | - | ||||||||||||||||||
| 460 | { | - | ||||||||||||||||||
| 461 | if (crl->meth->crl_lookup
| 0-3 | ||||||||||||||||||
| 462 | return executed 3 times by 1 test: crl->meth->crl_lookup(crl, ret,return crl->meth->crl_lookup(crl, ret, X509_get_serialNumber(x), X509_get_issuer_name(x));Executed by:
executed 3 times by 1 test: return crl->meth->crl_lookup(crl, ret, X509_get_serialNumber(x), X509_get_issuer_name(x));Executed by:
| 3 | ||||||||||||||||||
| 463 | X509_get_serialNumber(x), executed 3 times by 1 test: return crl->meth->crl_lookup(crl, ret, X509_get_serialNumber(x), X509_get_issuer_name(x));Executed by:
| 3 | ||||||||||||||||||
| 464 | X509_get_issuer_name(x)); executed 3 times by 1 test: return crl->meth->crl_lookup(crl, ret, X509_get_serialNumber(x), X509_get_issuer_name(x));Executed by:
| 3 | ||||||||||||||||||
| 465 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 466 | } | - | ||||||||||||||||||
| 467 | - | |||||||||||||||||||
| 468 | static int def_crl_verify(X509_CRL *crl, EVP_PKEY *r) | - | ||||||||||||||||||
| 469 | { | - | ||||||||||||||||||
| 470 | return executed 5 times by 1 test: (ASN1_item_verify((&(X509_CRL_INFO_it)),return (ASN1_item_verify((&(X509_CRL_INFO_it)), &crl->sig_alg, &crl->signature, &crl->crl, r));Executed by:
executed 5 times by 1 test: return (ASN1_item_verify((&(X509_CRL_INFO_it)), &crl->sig_alg, &crl->signature, &crl->crl, r));Executed by:
| 5 | ||||||||||||||||||
| 471 | &crl->sig_alg, &crl->signature, &crl->crl, r)); executed 5 times by 1 test: return (ASN1_item_verify((&(X509_CRL_INFO_it)), &crl->sig_alg, &crl->signature, &crl->crl, r));Executed by:
| 5 | ||||||||||||||||||
| 472 | } | - | ||||||||||||||||||
| 473 | - | |||||||||||||||||||
| 474 | static int crl_revoked_issuer_match(X509_CRL *crl, X509_NAME *nm, | - | ||||||||||||||||||
| 475 | X509_REVOKED *rev) | - | ||||||||||||||||||
| 476 | { | - | ||||||||||||||||||
| 477 | int i; | - | ||||||||||||||||||
| 478 | - | |||||||||||||||||||
| 479 | if (!rev->issuer
| 0-1 | ||||||||||||||||||
| 480 | if (!nm
| 0-1 | ||||||||||||||||||
| 481 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||||||||
| 482 | if (!X509_NAME_cmp(nm, X509_CRL_get_issuer(crl))
| 0-1 | ||||||||||||||||||
| 483 | return executed 1 time by 1 test: 1;return 1;Executed by:
executed 1 time by 1 test: return 1;Executed by:
| 1 | ||||||||||||||||||
| 484 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 485 | } | - | ||||||||||||||||||
| 486 | - | |||||||||||||||||||
| 487 | if (!nm
| 0 | ||||||||||||||||||
| 488 | nm = X509_CRL_get_issuer(crl); never executed: nm = X509_CRL_get_issuer(crl); | 0 | ||||||||||||||||||
| 489 | - | |||||||||||||||||||
| 490 | for (i = 0; i < sk_GENERAL_NAME_num(rev->issuer)
| 0 | ||||||||||||||||||
| 491 | GENERAL_NAME *gen = sk_GENERAL_NAME_value(rev->issuer, i); | - | ||||||||||||||||||
| 492 | if (gen->type != 4
| 0 | ||||||||||||||||||
| 493 | continue; never executed: continue; | 0 | ||||||||||||||||||
| 494 | if (!X509_NAME_cmp(nm, gen->d.directoryName)
| 0 | ||||||||||||||||||
| 495 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||||||||
| 496 | } never executed: end of block | 0 | ||||||||||||||||||
| 497 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 498 | - | |||||||||||||||||||
| 499 | } | - | ||||||||||||||||||
| 500 | - | |||||||||||||||||||
| 501 | static int def_crl_lookup(X509_CRL *crl, | - | ||||||||||||||||||
| 502 | X509_REVOKED **ret, ASN1_INTEGER *serial, | - | ||||||||||||||||||
| 503 | X509_NAME *issuer) | - | ||||||||||||||||||
| 504 | { | - | ||||||||||||||||||
| 505 | X509_REVOKED rtmp, *rev; | - | ||||||||||||||||||
| 506 | int idx, num; | - | ||||||||||||||||||
| 507 | - | |||||||||||||||||||
| 508 | if (crl->crl.revoked ==
| 1-2 | ||||||||||||||||||
| 509 | ((void *)0)
| 1-2 | ||||||||||||||||||
| 510 | ) | - | ||||||||||||||||||
| 511 | return executed 2 times by 1 test: 0;return 0;Executed by:
executed 2 times by 1 test: return 0;Executed by:
| 2 | ||||||||||||||||||
| 512 | - | |||||||||||||||||||
| 513 | - | |||||||||||||||||||
| 514 | - | |||||||||||||||||||
| 515 | - | |||||||||||||||||||
| 516 | - | |||||||||||||||||||
| 517 | if (!sk_X509_REVOKED_is_sorted(crl->crl.revoked)
| 0-1 | ||||||||||||||||||
| 518 | CRYPTO_THREAD_write_lock(crl->lock); | - | ||||||||||||||||||
| 519 | sk_X509_REVOKED_sort(crl->crl.revoked); | - | ||||||||||||||||||
| 520 | CRYPTO_THREAD_unlock(crl->lock); | - | ||||||||||||||||||
| 521 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||
| 522 | rtmp.serialNumber = *serial; | - | ||||||||||||||||||
| 523 | idx = sk_X509_REVOKED_find(crl->crl.revoked, &rtmp); | - | ||||||||||||||||||
| 524 | if (idx < 0
| 0-1 | ||||||||||||||||||
| 525 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 526 | - | |||||||||||||||||||
| 527 | for (num = sk_X509_REVOKED_num(crl->crl.revoked); idx < num
| 0-1 | ||||||||||||||||||
| 528 | rev = sk_X509_REVOKED_value(crl->crl.revoked, idx); | - | ||||||||||||||||||
| 529 | if (ASN1_INTEGER_cmp(&rev->serialNumber, serial)
| 0-1 | ||||||||||||||||||
| 530 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 531 | if (crl_revoked_issuer_match(crl, issuer, rev)
| 0-1 | ||||||||||||||||||
| 532 | if (ret
| 0-1 | ||||||||||||||||||
| 533 | * executed 1 time by 1 test: ret = rev;*ret = rev;Executed by:
executed 1 time by 1 test: *ret = rev;Executed by:
| 1 | ||||||||||||||||||
| 534 | if (rev->reason == 8
| 0-1 | ||||||||||||||||||
| 535 | return never executed: 2;return 2;never executed: return 2; | 0 | ||||||||||||||||||
| 536 | return executed 1 time by 1 test: 1;return 1;Executed by:
executed 1 time by 1 test: return 1;Executed by:
| 1 | ||||||||||||||||||
| 537 | } | - | ||||||||||||||||||
| 538 | } never executed: end of block | 0 | ||||||||||||||||||
| 539 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 540 | } | - | ||||||||||||||||||
| 541 | - | |||||||||||||||||||
| 542 | void X509_CRL_set_default_method(const X509_CRL_METHOD *meth) | - | ||||||||||||||||||
| 543 | { | - | ||||||||||||||||||
| 544 | if (meth ==
| 0 | ||||||||||||||||||
| 545 | ((void *)0)
| 0 | ||||||||||||||||||
| 546 | ) | - | ||||||||||||||||||
| 547 | default_crl_method = &int_crl_meth; never executed: default_crl_method = &int_crl_meth; | 0 | ||||||||||||||||||
| 548 | else | - | ||||||||||||||||||
| 549 | default_crl_method = meth; never executed: default_crl_method = meth; | 0 | ||||||||||||||||||
| 550 | } | - | ||||||||||||||||||
| 551 | - | |||||||||||||||||||
| 552 | X509_CRL_METHOD *X509_CRL_METHOD_new(int (*crl_init) (X509_CRL *crl), | - | ||||||||||||||||||
| 553 | int (*crl_free) (X509_CRL *crl), | - | ||||||||||||||||||
| 554 | int (*crl_lookup) (X509_CRL *crl, | - | ||||||||||||||||||
| 555 | X509_REVOKED **ret, | - | ||||||||||||||||||
| 556 | ASN1_INTEGER *ser, | - | ||||||||||||||||||
| 557 | X509_NAME *issuer), | - | ||||||||||||||||||
| 558 | int (*crl_verify) (X509_CRL *crl, | - | ||||||||||||||||||
| 559 | EVP_PKEY *pk)) | - | ||||||||||||||||||
| 560 | { | - | ||||||||||||||||||
| 561 | X509_CRL_METHOD *m = CRYPTO_malloc(sizeof(*m), __FILE__, 437); | - | ||||||||||||||||||
| 562 | - | |||||||||||||||||||
| 563 | if (m ==
| 0 | ||||||||||||||||||
| 564 | ((void *)0)
| 0 | ||||||||||||||||||
| 565 | ) { | - | ||||||||||||||||||
| 566 | ERR_put_error(11,(154),((1|64)),__FILE__,440); | - | ||||||||||||||||||
| 567 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 568 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 569 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 570 | } | - | ||||||||||||||||||
| 571 | m->crl_init = crl_init; | - | ||||||||||||||||||
| 572 | m->crl_free = crl_free; | - | ||||||||||||||||||
| 573 | m->crl_lookup = crl_lookup; | - | ||||||||||||||||||
| 574 | m->crl_verify = crl_verify; | - | ||||||||||||||||||
| 575 | m->flags = 1; | - | ||||||||||||||||||
| 576 | return never executed: m;return m;never executed: return m; | 0 | ||||||||||||||||||
| 577 | } | - | ||||||||||||||||||
| 578 | - | |||||||||||||||||||
| 579 | void X509_CRL_METHOD_free(X509_CRL_METHOD *m) | - | ||||||||||||||||||
| 580 | { | - | ||||||||||||||||||
| 581 | if (m ==
| 0 | ||||||||||||||||||
| 582 | ((void *)0)
| 0 | ||||||||||||||||||
| 583 | || !(m->flags & 1)
| 0 | ||||||||||||||||||
| 584 | return; never executed: return; | 0 | ||||||||||||||||||
| 585 | CRYPTO_free(m, __FILE__, 455); | - | ||||||||||||||||||
| 586 | } never executed: end of block | 0 | ||||||||||||||||||
| 587 | - | |||||||||||||||||||
| 588 | void X509_CRL_set_meth_data(X509_CRL *crl, void *dat) | - | ||||||||||||||||||
| 589 | { | - | ||||||||||||||||||
| 590 | crl->meth_data = dat; | - | ||||||||||||||||||
| 591 | } never executed: end of block | 0 | ||||||||||||||||||
| 592 | - | |||||||||||||||||||
| 593 | void *X509_CRL_get_meth_data(X509_CRL *crl) | - | ||||||||||||||||||
| 594 | { | - | ||||||||||||||||||
| 595 | return never executed: crl->meth_data;return crl->meth_data;never executed: return crl->meth_data; | 0 | ||||||||||||||||||
| 596 | } | - | ||||||||||||||||||
| Switch to Source code | Preprocessed file |