int opt_verify(int opt, X509_VERIFY_PARAM *vpm)
{
    int i;
    ossl_intmax_t t = 0;
    ASN1_OBJECT *otmp;
    X509_PURPOSE *xptmp;
    const X509_VERIFY_PARAM *vtmp;
    assert(vpm != NULL);
    assert(opt > OPT_V__FIRST);
    assert(opt < OPT_V__LAST);
    switch ((enum range)opt) {
    case OPT_V__FIRST:
    case OPT_V__LAST:
        return 0;
    case OPT_V_POLICY:
        otmp = OBJ_txt2obj(opt_arg(), 0);
        if (otmp == NULL) {
            BIO_printf(bio_err, "%s: Invalid Policy %s\n", prog, opt_arg());
            return 0;
        }
        X509_VERIFY_PARAM_add0_policy(vpm, otmp);
        break;
    case OPT_V_PURPOSE:
        i = X509_PURPOSE_get_by_sname(opt_arg());
        if (i < 0) {
            BIO_printf(bio_err, "%s: Invalid purpose %s\n", prog, opt_arg());
            return 0;
        }
        xptmp = X509_PURPOSE_get0(i);
        i = X509_PURPOSE_get_id(xptmp);
        X509_VERIFY_PARAM_set_purpose(vpm, i);
        break;
    case OPT_V_VERIFY_NAME:
        vtmp = X509_VERIFY_PARAM_lookup(opt_arg());
        if (vtmp == NULL) {
            BIO_printf(bio_err, "%s: Invalid verify name %s\n",
                       prog, opt_arg());
            return 0;
        }
        X509_VERIFY_PARAM_set1(vpm, vtmp);
        break;
    case OPT_V_VERIFY_DEPTH:
        i = atoi(opt_arg());
        if (i >= 0)
            X509_VERIFY_PARAM_set_depth(vpm, i);
        break;
    case OPT_V_ATTIME:
        if (!opt_imax(opt_arg(), &t))
            return 0;
        if (t != (time_t)t) {
            BIO_printf(bio_err, "%s: epoch time out of range %s\n",
                       prog, opt_arg());
            return 0;
        }
        X509_VERIFY_PARAM_set_time(vpm, (time_t)t);
        break;
    case OPT_V_VERIFY_HOSTNAME:
        if (!X509_VERIFY_PARAM_set1_host(vpm, opt_arg(), 0))
            return 0;
        break;
    case OPT_V_VERIFY_EMAIL:
        if (!X509_VERIFY_PARAM_set1_email(vpm, opt_arg(), 0))
            return 0;
        break;
    case OPT_V_VERIFY_IP:
        if (!X509_VERIFY_PARAM_set1_ip_asc(vpm, opt_arg()))
            return 0;
        break;
    case OPT_V_IGNORE_CRITICAL:
        X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_IGNORE_CRITICAL);
        break;
    case OPT_V_ISSUER_CHECKS:
        X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_CB_ISSUER_CHECK);
        break;
    case OPT_V_CRL_CHECK:
        X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_CRL_CHECK);
        break;
    case OPT_V_CRL_CHECK_ALL:
        X509_VERIFY_PARAM_set_flags(vpm,
                                    X509_V_FLAG_CRL_CHECK |
                                    X509_V_FLAG_CRL_CHECK_ALL);
        break;
    case OPT_V_POLICY_CHECK:
        X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_POLICY_CHECK);
        break;
    case OPT_V_EXPLICIT_POLICY:
        X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_EXPLICIT_POLICY);
        break;
    case OPT_V_INHIBIT_ANY:
        X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_INHIBIT_ANY);
        break;
    case OPT_V_INHIBIT_MAP:
        X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_INHIBIT_MAP);
        break;
    case OPT_V_X509_STRICT:
        X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_X509_STRICT);
        break;
    case OPT_V_EXTENDED_CRL:
        X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_EXTENDED_CRL_SUPPORT);
        break;
    case OPT_V_USE_DELTAS:
        X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_USE_DELTAS);
        break;
    case OPT_V_POLICY_PRINT:
        X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_NOTIFY_POLICY);
        break;
    case OPT_V_CHECK_SS_SIG:
        X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_CHECK_SS_SIGNATURE);
        break;
    case OPT_V_TRUSTED_FIRST:
        X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_TRUSTED_FIRST);
        break;
    case OPT_V_SUITEB_128_ONLY:
        X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_SUITEB_128_LOS_ONLY);
        break;
    case OPT_V_SUITEB_128:
        X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_SUITEB_128_LOS);
        break;
    case OPT_V_SUITEB_192:
        X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_SUITEB_192_LOS);
        break;
    case OPT_V_PARTIAL_CHAIN:
        X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_PARTIAL_CHAIN);
        break;
    case OPT_V_NO_ALT_CHAINS:
        X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_NO_ALT_CHAINS);
	break;
    case OPT_V_NO_CHECK_TIME:
        X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_NO_CHECK_TIME);
	break;
    }
    return 1;
}
['int opt_verify(int opt, X509_VERIFY_PARAM *vpm)\n{\n    int i;\n    ossl_intmax_t t = 0;\n    ASN1_OBJECT *otmp;\n    X509_PURPOSE *xptmp;\n    const X509_VERIFY_PARAM *vtmp;\n    assert(vpm != NULL);\n    assert(opt > OPT_V__FIRST);\n    assert(opt < OPT_V__LAST);\n    switch ((enum range)opt) {\n    case OPT_V__FIRST:\n    case OPT_V__LAST:\n        return 0;\n    case OPT_V_POLICY:\n        otmp = OBJ_txt2obj(opt_arg(), 0);\n        if (otmp == NULL) {\n            BIO_printf(bio_err, "%s: Invalid Policy %s\\n", prog, opt_arg());\n            return 0;\n        }\n        X509_VERIFY_PARAM_add0_policy(vpm, otmp);\n        break;\n    case OPT_V_PURPOSE:\n        i = X509_PURPOSE_get_by_sname(opt_arg());\n        if (i < 0) {\n            BIO_printf(bio_err, "%s: Invalid purpose %s\\n", prog, opt_arg());\n            return 0;\n        }\n        xptmp = X509_PURPOSE_get0(i);\n        i = X509_PURPOSE_get_id(xptmp);\n        X509_VERIFY_PARAM_set_purpose(vpm, i);\n        break;\n    case OPT_V_VERIFY_NAME:\n        vtmp = X509_VERIFY_PARAM_lookup(opt_arg());\n        if (vtmp == NULL) {\n            BIO_printf(bio_err, "%s: Invalid verify name %s\\n",\n                       prog, opt_arg());\n            return 0;\n        }\n        X509_VERIFY_PARAM_set1(vpm, vtmp);\n        break;\n    case OPT_V_VERIFY_DEPTH:\n        i = atoi(opt_arg());\n        if (i >= 0)\n            X509_VERIFY_PARAM_set_depth(vpm, i);\n        break;\n    case OPT_V_ATTIME:\n        if (!opt_imax(opt_arg(), &t))\n            return 0;\n        if (t != (time_t)t) {\n            BIO_printf(bio_err, "%s: epoch time out of range %s\\n",\n                       prog, opt_arg());\n            return 0;\n        }\n        X509_VERIFY_PARAM_set_time(vpm, (time_t)t);\n        break;\n    case OPT_V_VERIFY_HOSTNAME:\n        if (!X509_VERIFY_PARAM_set1_host(vpm, opt_arg(), 0))\n            return 0;\n        break;\n    case OPT_V_VERIFY_EMAIL:\n        if (!X509_VERIFY_PARAM_set1_email(vpm, opt_arg(), 0))\n            return 0;\n        break;\n    case OPT_V_VERIFY_IP:\n        if (!X509_VERIFY_PARAM_set1_ip_asc(vpm, opt_arg()))\n            return 0;\n        break;\n    case OPT_V_IGNORE_CRITICAL:\n        X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_IGNORE_CRITICAL);\n        break;\n    case OPT_V_ISSUER_CHECKS:\n        X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_CB_ISSUER_CHECK);\n        break;\n    case OPT_V_CRL_CHECK:\n        X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_CRL_CHECK);\n        break;\n    case OPT_V_CRL_CHECK_ALL:\n        X509_VERIFY_PARAM_set_flags(vpm,\n                                    X509_V_FLAG_CRL_CHECK |\n                                    X509_V_FLAG_CRL_CHECK_ALL);\n        break;\n    case OPT_V_POLICY_CHECK:\n        X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_POLICY_CHECK);\n        break;\n    case OPT_V_EXPLICIT_POLICY:\n        X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_EXPLICIT_POLICY);\n        break;\n    case OPT_V_INHIBIT_ANY:\n        X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_INHIBIT_ANY);\n        break;\n    case OPT_V_INHIBIT_MAP:\n        X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_INHIBIT_MAP);\n        break;\n    case OPT_V_X509_STRICT:\n        X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_X509_STRICT);\n        break;\n    case OPT_V_EXTENDED_CRL:\n        X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_EXTENDED_CRL_SUPPORT);\n        break;\n    case OPT_V_USE_DELTAS:\n        X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_USE_DELTAS);\n        break;\n    case OPT_V_POLICY_PRINT:\n        X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_NOTIFY_POLICY);\n        break;\n    case OPT_V_CHECK_SS_SIG:\n        X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_CHECK_SS_SIGNATURE);\n        break;\n    case OPT_V_TRUSTED_FIRST:\n        X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_TRUSTED_FIRST);\n        break;\n    case OPT_V_SUITEB_128_ONLY:\n        X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_SUITEB_128_LOS_ONLY);\n        break;\n    case OPT_V_SUITEB_128:\n        X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_SUITEB_128_LOS);\n        break;\n    case OPT_V_SUITEB_192:\n        X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_SUITEB_192_LOS);\n        break;\n    case OPT_V_PARTIAL_CHAIN:\n        X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_PARTIAL_CHAIN);\n        break;\n    case OPT_V_NO_ALT_CHAINS:\n        X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_NO_ALT_CHAINS);\n\tbreak;\n    case OPT_V_NO_CHECK_TIME:\n        X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_NO_CHECK_TIME);\n\tbreak;\n    }\n    return 1;\n}', 'char *opt_arg(void)\n{\n    return arg;\n}', 'X509_PURPOSE *X509_PURPOSE_get0(int idx)\n{\n    if (idx < 0)\n        return NULL;\n    if (idx < (int)X509_PURPOSE_COUNT)\n        return xstandard + idx;\n    return sk_X509_PURPOSE_value(xptable, idx - X509_PURPOSE_COUNT);\n}', 'DEFINE_STACK_OF(X509_PURPOSE)', 'void *sk_value(const _STACK *st, int i)\n{\n    if (!st || (i < 0) || (i >= st->num))\n        return NULL;\n    return st->data[i];\n}', 'int X509_PURPOSE_get_id(X509_PURPOSE *xp)\n{\n    return xp->purpose;\n}']