| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/libressl/src/crypto/asn1/t_crl.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | - | |||||||||||||
| 3 | int | - | ||||||||||||
| 4 | X509_CRL_print_fp(FILE *fp, X509_CRL *x) | - | ||||||||||||
| 5 | { | - | ||||||||||||
| 6 | BIO *b; | - | ||||||||||||
| 7 | int ret; | - | ||||||||||||
| 8 | - | |||||||||||||
| 9 | if ((
| 0 | ||||||||||||
| 10 | ((void *)0)
| 0 | ||||||||||||
| 11 | ) { | - | ||||||||||||
| 12 | ERR_put_error(11,(0xfff),(7),__FILE__,75); | - | ||||||||||||
| 13 | return never executed: (0);return (0);never executed: return (0); | 0 | ||||||||||||
| 14 | } | - | ||||||||||||
| 15 | BIO_ctrl(b,106,0x00,(char *)fp); | - | ||||||||||||
| 16 | ret = X509_CRL_print(b, x); | - | ||||||||||||
| 17 | BIO_free(b); | - | ||||||||||||
| 18 | return never executed: (ret);return (ret);never executed: return (ret); | 0 | ||||||||||||
| 19 | } | - | ||||||||||||
| 20 | - | |||||||||||||
| 21 | int | - | ||||||||||||
| 22 | X509_CRL_print(BIO *out, X509_CRL *x) | - | ||||||||||||
| 23 | { | - | ||||||||||||
| 24 | struct stack_st_X509_REVOKED *rev; | - | ||||||||||||
| 25 | X509_REVOKED *r; | - | ||||||||||||
| 26 | long l; | - | ||||||||||||
| 27 | int i; | - | ||||||||||||
| 28 | char *p; | - | ||||||||||||
| 29 | - | |||||||||||||
| 30 | BIO_printf(out, "Certificate Revocation List (CRL):\n"); | - | ||||||||||||
| 31 | l = X509_CRL_get_version(x); | - | ||||||||||||
| 32 | BIO_printf(out, "%8sVersion %lu (0x%lx)\n", "", l + 1, l); | - | ||||||||||||
| 33 | i = OBJ_obj2nid(x->sig_alg->algorithm); | - | ||||||||||||
| 34 | if (X509_signature_print(out, x->sig_alg,
| 0 | ||||||||||||
| 35 | ((void *)0)
| 0 | ||||||||||||
| 36 | ) == 0
| 0 | ||||||||||||
| 37 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||
| 38 | p = X509_NAME_oneline(X509_CRL_get_issuer(x), | - | ||||||||||||
| 39 | ((void *)0) | - | ||||||||||||
| 40 | , 0); | - | ||||||||||||
| 41 | if (p ==
| 0 | ||||||||||||
| 42 | ((void *)0)
| 0 | ||||||||||||
| 43 | ) | - | ||||||||||||
| 44 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||
| 45 | BIO_printf(out, "%8sIssuer: %s\n", "", p); | - | ||||||||||||
| 46 | free(p); | - | ||||||||||||
| 47 | BIO_printf(out, "%8sLast Update: ", ""); | - | ||||||||||||
| 48 | ASN1_TIME_print(out, X509_CRL_get_lastUpdate(x)); | - | ||||||||||||
| 49 | BIO_printf(out, "\n%8sNext Update: ", ""); | - | ||||||||||||
| 50 | if (X509_CRL_get_nextUpdate(x)
| 0 | ||||||||||||
| 51 | ASN1_TIME_print(out, X509_CRL_get_nextUpdate(x)); never executed: ASN1_TIME_print(out, X509_CRL_get_nextUpdate(x)); | 0 | ||||||||||||
| 52 | else | - | ||||||||||||
| 53 | BIO_printf(out, "NONE"); never executed: BIO_printf(out, "NONE"); | 0 | ||||||||||||
| 54 | BIO_printf(out, "\n"); | - | ||||||||||||
| 55 | - | |||||||||||||
| 56 | X509V3_extensions_print(out, "CRL extensions", | - | ||||||||||||
| 57 | x->crl->extensions, 0, 8); | - | ||||||||||||
| 58 | - | |||||||||||||
| 59 | rev = X509_CRL_get_REVOKED(x); | - | ||||||||||||
| 60 | - | |||||||||||||
| 61 | if (sk_num(((_STACK*) (1 ? (rev) : (struct stack_st_X509_REVOKED*)0))) > 0
| 0 | ||||||||||||
| 62 | BIO_printf(out, "Revoked Certificates:\n"); never executed: BIO_printf(out, "Revoked Certificates:\n"); | 0 | ||||||||||||
| 63 | else | - | ||||||||||||
| 64 | BIO_printf(out, "No Revoked Certificates.\n"); never executed: BIO_printf(out, "No Revoked Certificates.\n"); | 0 | ||||||||||||
| 65 | - | |||||||||||||
| 66 | for (i = 0; i < sk_num(((_STACK*) (1 ? (rev) : (struct stack_st_X509_REVOKED*)0)))
| 0 | ||||||||||||
| 67 | r = ((X509_REVOKED *)sk_value(((_STACK*) (1 ? (rev) : (struct stack_st_X509_REVOKED*)0)), (i))); | - | ||||||||||||
| 68 | BIO_printf(out, " Serial Number: "); | - | ||||||||||||
| 69 | i2a_ASN1_INTEGER(out, r->serialNumber); | - | ||||||||||||
| 70 | BIO_printf(out, "\n Revocation Date: "); | - | ||||||||||||
| 71 | ASN1_TIME_print(out, r->revocationDate); | - | ||||||||||||
| 72 | BIO_printf(out, "\n"); | - | ||||||||||||
| 73 | X509V3_extensions_print(out, "CRL entry extensions", | - | ||||||||||||
| 74 | r->extensions, 0, 8); | - | ||||||||||||
| 75 | } never executed: end of block | 0 | ||||||||||||
| 76 | if (X509_signature_print(out, x->sig_alg, x->signature) == 0
| 0 | ||||||||||||
| 77 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||
| 78 | - | |||||||||||||
| 79 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||
| 80 | - | |||||||||||||
| 81 | err: | - | ||||||||||||
| 82 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||
| 83 | } | - | ||||||||||||
| Switch to Source code | Preprocessed file |