static int do_file(const char *filename, const char *fullpath, enum Hash h)
{
    STACK_OF (X509_INFO) *inf;
    X509_INFO *x;
    X509_NAME *name = NULL;
    BIO *b;
    const char *ext;
    unsigned char digest[EVP_MAX_MD_SIZE];
    int i, type, ret = -1;
    if ((ext = strrchr(filename, '.')) == NULL)
        return 0;
    for (i = 0; i < (int)OSSL_NELEM(extensions); i++) {
        if (strcasecmp(extensions[i], ext + 1) == 0)
            break;
    }
    if (i >= (int)OSSL_NELEM(extensions))
        return -1;
    if ((b = BIO_new_file(fullpath, "r")) == NULL)
        return -1;
    inf = PEM_X509_INFO_read_bio(b, NULL, NULL, NULL);
    BIO_free(b);
    if (inf == NULL)
        return -1;
    if (sk_X509_INFO_num(inf) != 1) {
        BIO_printf(bio_err,
                   "%s: skipping %s,"
                   "it does not contain exactly one certificate or CRL\n",
                   opt_getprog(), filename);
        goto end;
    }
    x = sk_X509_INFO_value(inf, 0);
    if (x->x509) {
        type = TYPE_CERT;
        name = X509_get_subject_name(x->x509);
        X509_digest(x->x509, evpmd, digest, NULL);
    } else if (x->crl) {
        type = TYPE_CRL;
        name = X509_CRL_get_issuer(x->crl);
        X509_CRL_digest(x->crl, evpmd, digest, NULL);
    }
    if (name) {
        if ((h == HASH_NEW) || (h == HASH_BOTH))
            add_entry(type, X509_NAME_hash(name), filename, digest, 1, ~0);
        if ((h == HASH_OLD) || (h == HASH_BOTH))
            add_entry(type, X509_NAME_hash_old(name), filename, digest, 1, ~0);
    }
end:
    sk_X509_INFO_pop_free(inf, X509_INFO_free);
    return ret;
}
['static int do_file(const char *filename, const char *fullpath, enum Hash h)\n{\n    STACK_OF (X509_INFO) *inf;\n    X509_INFO *x;\n    X509_NAME *name = NULL;\n    BIO *b;\n    const char *ext;\n    unsigned char digest[EVP_MAX_MD_SIZE];\n    int i, type, ret = -1;\n    if ((ext = strrchr(filename, \'.\')) == NULL)\n        return 0;\n    for (i = 0; i < (int)OSSL_NELEM(extensions); i++) {\n        if (strcasecmp(extensions[i], ext + 1) == 0)\n            break;\n    }\n    if (i >= (int)OSSL_NELEM(extensions))\n        return -1;\n    if ((b = BIO_new_file(fullpath, "r")) == NULL)\n        return -1;\n    inf = PEM_X509_INFO_read_bio(b, NULL, NULL, NULL);\n    BIO_free(b);\n    if (inf == NULL)\n        return -1;\n    if (sk_X509_INFO_num(inf) != 1) {\n        BIO_printf(bio_err,\n                   "%s: skipping %s,"\n                   "it does not contain exactly one certificate or CRL\\n",\n                   opt_getprog(), filename);\n        goto end;\n    }\n    x = sk_X509_INFO_value(inf, 0);\n    if (x->x509) {\n        type = TYPE_CERT;\n        name = X509_get_subject_name(x->x509);\n        X509_digest(x->x509, evpmd, digest, NULL);\n    } else if (x->crl) {\n        type = TYPE_CRL;\n        name = X509_CRL_get_issuer(x->crl);\n        X509_CRL_digest(x->crl, evpmd, digest, NULL);\n    }\n    if (name) {\n        if ((h == HASH_NEW) || (h == HASH_BOTH))\n            add_entry(type, X509_NAME_hash(name), filename, digest, 1, ~0);\n        if ((h == HASH_OLD) || (h == HASH_BOTH))\n            add_entry(type, X509_NAME_hash_old(name), filename, digest, 1, ~0);\n    }\nend:\n    sk_X509_INFO_pop_free(inf, X509_INFO_free);\n    return ret;\n}']