static int sxnet_i2r(X509V3_EXT_METHOD *method, SXNET *sx, BIO *out, int indent) { long v; char *tmp; SXNETID *id; int i; v = ASN1_INTEGER_get(sx->version); BIO_printf(out, "%*sVersion: %ld (0x%lX)", indent, "", v + 1, v); for(i = 0; i < sk_SXNETID_num(sx->ids); i++) { id = sk_SXNETID_value(sx->ids, i); tmp = i2s_ASN1_INTEGER(NULL, id->zone); BIO_printf(out, "\n%*sZone: %s, User: "******"", tmp); OPENSSL_free(tmp); M_ASN1_OCTET_STRING_print(out, id->user); } return 1; }
} return asn1_item_print_nm(out, fld, indent, tt->item, tt->field_name); } static int asn1_primitive_print(BIO *out, void *fld, long utype, int indent, const char *name) { ASN1_STRING *str = fld; if(fld) { if(utype == V_ASN1_BOOLEAN) { int *bool = fld; if(*bool == -1) printf("BOOL MISSING\n"); BIO_printf(out, "%*s%s:%s", indent, "", "BOOLEAN", *bool ? "TRUE" : "FALSE"); } else if((utype == V_ASN1_INTEGER) || (utype == V_ASN1_ENUMERATED)) { char *s, *nm; s = i2s_ASN1_INTEGER(NULL, fld); if(utype == V_ASN1_INTEGER) nm = "INTEGER"; else nm = "ENUMERATED"; BIO_printf(out, "%*s%s:%s", indent, "", nm, s); OPENSSL_free(s); } else if(utype == V_ASN1_NULL) { BIO_printf(out, "%*s%s", indent, "", "NULL"); } else if(utype == V_ASN1_UTCTIME) { BIO_printf(out, "%*s%s:%s:", indent, "", name, "UTCTIME"); ASN1_UTCTIME_print(out, str); } else if(utype == V_ASN1_GENERALIZEDTIME) { BIO_printf(out, "%*s%s:%s:", indent, "", name, "GENERALIZEDTIME"); ASN1_GENERALIZEDTIME_print(out, str); } else if(utype == V_ASN1_OBJECT) { char objbuf[80], *ln; ln = OBJ_nid2ln(OBJ_obj2nid(fld));