int ASN1_UTCTIME_print(BIO *bp, const ASN1_UTCTIME *tm)
{
    const char *v;
    int gmt = 0;
    int i;
    int y = 0, M = 0, d = 0, h = 0, m = 0, s = 0;
    i = tm->length;
    v = (const char *)tm->data;
    if (i < 10)
        goto err;
    if (v[i - 1] == 'Z')
        gmt = 1;
    for (i = 0; i < 10; i++)
        if ((v[i] > '9') || (v[i] < '0'))
            goto err;
    y = (v[0] - '0') * 10 + (v[1] - '0');
    if (y < 50)
        y += 100;
    M = (v[2] - '0') * 10 + (v[3] - '0');
    if ((M > 12) || (M < 1))
        goto err;
    d = (v[4] - '0') * 10 + (v[5] - '0');
    h = (v[6] - '0') * 10 + (v[7] - '0');
    m = (v[8] - '0') * 10 + (v[9] - '0');
    if (tm->length >= 12 &&
        (v[10] >= '0') && (v[10] <= '9') && (v[11] >= '0') && (v[11] <= '9'))
        s = (v[10] - '0') * 10 + (v[11] - '0');
    if (BIO_printf(bp, "%s %2d %02d:%02d:%02d %d%s",
                   mon[M - 1], d, h, m, s, y + 1900,
                   (gmt) ? " GMT" : "") <= 0)
        return (0);
    else
        return (1);
 err:
    BIO_write(bp, "Bad time value", 14);
    return (0);
}
['static int asn1_primitive_print(BIO *out, ASN1_VALUE **fld,\n                                const ASN1_ITEM *it, int indent,\n                                const char *fname, const char *sname,\n                                const ASN1_PCTX *pctx)\n{\n    long utype;\n    ASN1_STRING *str;\n    int ret = 1, needlf = 1;\n    const char *pname;\n    const ASN1_PRIMITIVE_FUNCS *pf;\n    pf = it->funcs;\n    if (!asn1_print_fsname(out, indent, fname, sname, pctx))\n        return 0;\n    if (pf && pf->prim_print)\n        return pf->prim_print(out, fld, it, indent, pctx);\n    str = (ASN1_STRING *)*fld;\n    if (it->itype == ASN1_ITYPE_MSTRING)\n        utype = str->type & ~V_ASN1_NEG;\n    else\n        utype = it->utype;\n    if (utype == V_ASN1_ANY) {\n        ASN1_TYPE *atype = (ASN1_TYPE *)*fld;\n        utype = atype->type;\n        fld = &atype->value.asn1_value;\n        str = (ASN1_STRING *)*fld;\n        if (pctx->flags & ASN1_PCTX_FLAGS_NO_ANY_TYPE)\n            pname = NULL;\n        else\n            pname = ASN1_tag2str(utype);\n    } else {\n        if (pctx->flags & ASN1_PCTX_FLAGS_SHOW_TYPE)\n            pname = ASN1_tag2str(utype);\n        else\n            pname = NULL;\n    }\n    if (utype == V_ASN1_NULL) {\n        if (BIO_puts(out, "NULL\\n") <= 0)\n            return 0;\n        return 1;\n    }\n    if (pname) {\n        if (BIO_puts(out, pname) <= 0)\n            return 0;\n        if (BIO_puts(out, ":") <= 0)\n            return 0;\n    }\n    switch (utype) {\n    case V_ASN1_BOOLEAN:\n        {\n            int boolval = *(int *)fld;\n            if (boolval == -1)\n                boolval = it->size;\n            ret = asn1_print_boolean_ctx(out, boolval, pctx);\n        }\n        break;\n    case V_ASN1_INTEGER:\n    case V_ASN1_ENUMERATED:\n        ret = asn1_print_integer_ctx(out, str, pctx);\n        break;\n    case V_ASN1_UTCTIME:\n        ret = ASN1_UTCTIME_print(out, str);\n        break;\n    case V_ASN1_GENERALIZEDTIME:\n        ret = ASN1_GENERALIZEDTIME_print(out, str);\n        break;\n    case V_ASN1_OBJECT:\n        ret = asn1_print_oid_ctx(out, (const ASN1_OBJECT *)*fld, pctx);\n        break;\n    case V_ASN1_OCTET_STRING:\n    case V_ASN1_BIT_STRING:\n        ret = asn1_print_obstring_ctx(out, str, indent, pctx);\n        needlf = 0;\n        break;\n    case V_ASN1_SEQUENCE:\n    case V_ASN1_SET:\n    case V_ASN1_OTHER:\n        if (BIO_puts(out, "\\n") <= 0)\n            return 0;\n        if (ASN1_parse_dump(out, str->data, str->length, indent, 0) <= 0)\n            ret = 0;\n        needlf = 0;\n        break;\n    default:\n        ret = ASN1_STRING_print_ex(out, str, pctx->str_flags);\n    }\n    if (!ret)\n        return 0;\n    if (needlf && BIO_puts(out, "\\n") <= 0)\n        return 0;\n    return 1;\n}', 'int ASN1_UTCTIME_print(BIO *bp, const ASN1_UTCTIME *tm)\n{\n    const char *v;\n    int gmt = 0;\n    int i;\n    int y = 0, M = 0, d = 0, h = 0, m = 0, s = 0;\n    i = tm->length;\n    v = (const char *)tm->data;\n    if (i < 10)\n        goto err;\n    if (v[i - 1] == \'Z\')\n        gmt = 1;\n    for (i = 0; i < 10; i++)\n        if ((v[i] > \'9\') || (v[i] < \'0\'))\n            goto err;\n    y = (v[0] - \'0\') * 10 + (v[1] - \'0\');\n    if (y < 50)\n        y += 100;\n    M = (v[2] - \'0\') * 10 + (v[3] - \'0\');\n    if ((M > 12) || (M < 1))\n        goto err;\n    d = (v[4] - \'0\') * 10 + (v[5] - \'0\');\n    h = (v[6] - \'0\') * 10 + (v[7] - \'0\');\n    m = (v[8] - \'0\') * 10 + (v[9] - \'0\');\n    if (tm->length >= 12 &&\n        (v[10] >= \'0\') && (v[10] <= \'9\') && (v[11] >= \'0\') && (v[11] <= \'9\'))\n        s = (v[10] - \'0\') * 10 + (v[11] - \'0\');\n    if (BIO_printf(bp, "%s %2d %02d:%02d:%02d %d%s",\n                   mon[M - 1], d, h, m, s, y + 1900,\n                   (gmt) ? " GMT" : "") <= 0)\n        return (0);\n    else\n        return (1);\n err:\n    BIO_write(bp, "Bad time value", 14);\n    return (0);\n}']