int X509_CRL_print(BIO *out, X509_CRL *x)
{
    STACK_OF(X509_REVOKED) *rev;
    X509_REVOKED *r;
    X509_ALGOR *sig_alg;
    ASN1_BIT_STRING *sig;
    long l;
    int i;
    char *p;
    BIO_printf(out, "Certificate Revocation List (CRL):\n");
    l = X509_CRL_get_version(x);
    BIO_printf(out, "%8sVersion %lu (0x%lx)\n", "", l + 1, l);
    X509_CRL_get0_signature(&sig, &sig_alg, x);
    X509_signature_print(out, sig_alg, NULL);
    p = X509_NAME_oneline(X509_CRL_get_issuer(x), NULL, 0);
    BIO_printf(out, "%8sIssuer: %s\n", "", p);
    OPENSSL_free(p);
    BIO_printf(out, "%8sLast Update: ", "");
    ASN1_TIME_print(out, X509_CRL_get_lastUpdate(x));
    BIO_printf(out, "\n%8sNext Update: ", "");
    if (X509_CRL_get_nextUpdate(x))
        ASN1_TIME_print(out, X509_CRL_get_nextUpdate(x));
    else
        BIO_printf(out, "NONE");
    BIO_printf(out, "\n");
    X509V3_extensions_print(out, "CRL extensions",
                            X509_CRL_get0_extensions(x), 0, 8);
    rev = X509_CRL_get_REVOKED(x);
    if (sk_X509_REVOKED_num(rev) > 0)
        BIO_printf(out, "Revoked Certificates:\n");
    else
        BIO_printf(out, "No Revoked Certificates.\n");
    for (i = 0; i < sk_X509_REVOKED_num(rev); i++) {
        r = sk_X509_REVOKED_value(rev, i);
        BIO_printf(out, "    Serial Number: ");
        i2a_ASN1_INTEGER(out, X509_REVOKED_get0_serialNumber(r));
        BIO_printf(out, "\n        Revocation Date: ");
        ASN1_TIME_print(out, X509_REVOKED_get0_revocationDate(r));
        BIO_printf(out, "\n");
        X509V3_extensions_print(out, "CRL entry extensions",
                                X509_REVOKED_get0_extensions(r), 0, 8);
    }
    X509_signature_print(out, sig_alg, sig);
    return 1;
}
['int X509_CRL_print(BIO *out, X509_CRL *x)\n{\n    STACK_OF(X509_REVOKED) *rev;\n    X509_REVOKED *r;\n    X509_ALGOR *sig_alg;\n    ASN1_BIT_STRING *sig;\n    long l;\n    int i;\n    char *p;\n    BIO_printf(out, "Certificate Revocation List (CRL):\\n");\n    l = X509_CRL_get_version(x);\n    BIO_printf(out, "%8sVersion %lu (0x%lx)\\n", "", l + 1, l);\n    X509_CRL_get0_signature(&sig, &sig_alg, x);\n    X509_signature_print(out, sig_alg, NULL);\n    p = X509_NAME_oneline(X509_CRL_get_issuer(x), NULL, 0);\n    BIO_printf(out, "%8sIssuer: %s\\n", "", p);\n    OPENSSL_free(p);\n    BIO_printf(out, "%8sLast Update: ", "");\n    ASN1_TIME_print(out, X509_CRL_get_lastUpdate(x));\n    BIO_printf(out, "\\n%8sNext Update: ", "");\n    if (X509_CRL_get_nextUpdate(x))\n        ASN1_TIME_print(out, X509_CRL_get_nextUpdate(x));\n    else\n        BIO_printf(out, "NONE");\n    BIO_printf(out, "\\n");\n    X509V3_extensions_print(out, "CRL extensions",\n                            X509_CRL_get0_extensions(x), 0, 8);\n    rev = X509_CRL_get_REVOKED(x);\n    if (sk_X509_REVOKED_num(rev) > 0)\n        BIO_printf(out, "Revoked Certificates:\\n");\n    else\n        BIO_printf(out, "No Revoked Certificates.\\n");\n    for (i = 0; i < sk_X509_REVOKED_num(rev); i++) {\n        r = sk_X509_REVOKED_value(rev, i);\n        BIO_printf(out, "    Serial Number: ");\n        i2a_ASN1_INTEGER(out, X509_REVOKED_get0_serialNumber(r));\n        BIO_printf(out, "\\n        Revocation Date: ");\n        ASN1_TIME_print(out, X509_REVOKED_get0_revocationDate(r));\n        BIO_printf(out, "\\n");\n        X509V3_extensions_print(out, "CRL entry extensions",\n                                X509_REVOKED_get0_extensions(r), 0, 8);\n    }\n    X509_signature_print(out, sig_alg, sig);\n    return 1;\n}', 'long X509_CRL_get_version(const X509_CRL *crl)\n{\n    return ASN1_INTEGER_get(crl->crl.version);\n}', 'long ASN1_INTEGER_get(const ASN1_INTEGER *a)\n{\n    int i;\n    int64_t r;\n    if (a == NULL)\n        return 0;\n    i = ASN1_INTEGER_get_int64(&r, a);\n    if (i == 0)\n        return -1;\n    if (r > LONG_MAX || r < LONG_MIN)\n        return -1;\n    return (long)r;\n}']