/* * Converts OpenSSL ASN1_STRING structure into text * * Converts ASN1_STRING into text, converting all the characters into * current database encoding if possible. Any invalid characters are * replaced by question marks. * * Parameter: str - OpenSSL ASN1_STRING structure. Memory managment * of this structure is responsibility of caller. * * Returns Datum, which can be directly returned from a C language SQL * function. */ datum_t ASN1_STRING_to_text(ASN1_STRING *str) { BIO *membuf; size_t size; char nullterm; char *sp; char *dp; text *result; membuf = BIO_new(BIO_s_mem()); (void) BIO_set_close(membuf, BIO_CLOSE); ASN1_STRING_print_ex(membuf, str, ((ASN1_STRFLGS_RFC2253 & ~ASN1_STRFLGS_ESC_MSB) | ASN1_STRFLGS_UTF8_CONVERT)); /* ensure null termination of the BIO's content */ nullterm = '\0'; BIO_write(membuf, &nullterm, 1); size = BIO_get_mem_data(membuf, &sp); dp = (char *) pg_do_encoding_conversion((unsigned char *) sp, size - 1, PG_UTF8, get_db_encoding()); result = cstring_to_text(dp); if (dp != sp) pfree(dp); BIO_free(membuf); RET_TEXT_P(result); }
/* * Converts OpenSSL ASN1_STRING structure into text * * Converts ASN1_STRING into text, converting all the characters into * current database encoding if possible. Any invalid characters are * replaced by question marks. * * Parameter: str - OpenSSL ASN1_STRING structure. Memory management * of this structure is responsibility of caller. * * Returns Datum, which can be directly returned from a C language SQL * function. */ static Datum ASN1_STRING_to_text(ASN1_STRING *str) { BIO *membuf; size_t size; char nullterm; char *sp; char *dp; text *result; membuf = BIO_new(BIO_s_mem()); if (membuf == NULL) ereport(ERROR, (errcode(ERRCODE_OUT_OF_MEMORY), errmsg("could not create OpenSSL BIO structure"))); (void) BIO_set_close(membuf, BIO_CLOSE); ASN1_STRING_print_ex(membuf, str, ((ASN1_STRFLGS_RFC2253 & ~ASN1_STRFLGS_ESC_MSB) | ASN1_STRFLGS_UTF8_CONVERT)); /* ensure null termination of the BIO's content */ nullterm = '\0'; BIO_write(membuf, &nullterm, 1); size = BIO_get_mem_data(membuf, &sp); dp = pg_any_to_server(sp, size - 1, PG_UTF8); result = cstring_to_text(dp); if (dp != sp) pfree(dp); if (BIO_free(membuf) != 1) elog(ERROR, "could not free OpenSSL BIO structure"); PG_RETURN_TEXT_P(result); }
/* * Converts OpenSSL ASN1_STRING structure into text * * Converts ASN1_STRING into text, converting all the characters into * current database encoding if possible. Any invalid characters are * replaced by question marks. * * Parameter: str - OpenSSL ASN1_STRING structure. Memory managment * of this structure is responsibility of caller. * * Returns Datum, which can be directly returned from a C language SQL * function. */ Datum ASN1_STRING_to_text(ASN1_STRING *str) { BIO *membuf = NULL; size_t size, outlen; char *sp; char *dp; text *result; membuf = BIO_new(BIO_s_mem()); (void) BIO_set_close(membuf, BIO_CLOSE); ASN1_STRING_print_ex(membuf, str, ((ASN1_STRFLGS_RFC2253 & ~ASN1_STRFLGS_ESC_MSB) | ASN1_STRFLGS_UTF8_CONVERT)); outlen = 0; BIO_write(membuf, &outlen, 1); size = BIO_get_mem_data(membuf, &sp); dp = (char *) pg_do_encoding_conversion((unsigned char *) sp, size - 1, PG_UTF8, GetDatabaseEncoding()); outlen = strlen(dp); result = palloc(VARHDRSZ + outlen); memcpy(VARDATA(result), dp, outlen); if (dp != sp) pfree(dp); BIO_free(membuf); VARATT_SIZEP(result) = outlen + VARHDRSZ; PG_RETURN_TEXT_P(result); }
/* * Converts OpenSSL ASN1_STRING structure into text * * Converts ASN1_STRING into text, converting all the characters into * current database encoding if possible. Any invalid characters are * replaced by question marks. * * Parameter: str - OpenSSL ASN1_STRING structure. Memory management * of this structure is responsibility of caller. * * Returns Datum, which can be directly returned from a C language SQL * function. */ static Datum ASN1_STRING_to_text(ASN1_STRING *str) { BIO *membuf; size_t size; char nullterm; char *sp; char *dp; text *result; membuf = BIO_new(BIO_s_mem()); (void) BIO_set_close(membuf, BIO_CLOSE); ASN1_STRING_print_ex(membuf, str, ((ASN1_STRFLGS_RFC2253 & ~ASN1_STRFLGS_ESC_MSB) | ASN1_STRFLGS_UTF8_CONVERT)); /* ensure null termination of the BIO's content */ nullterm = '\0'; BIO_write(membuf, &nullterm, 1); size = BIO_get_mem_data(membuf, &sp); dp = pg_any_to_server(sp, size - 1, PG_UTF8); result = cstring_to_text(dp); if (dp != sp) pfree(dp); BIO_free(membuf); PG_RETURN_TEXT_P(result); }
/* * Equivalent of X509_NAME_oneline that respects encoding * * This function converts X509_NAME structure to the text variable * converting all textual data into current database encoding. * * Parameter: X509_NAME *name X509_NAME structure to be converted * * Returns: text datum which contains string representation of * X509_NAME */ static Datum X509_NAME_to_text(X509_NAME *name) { BIO *membuf = BIO_new(BIO_s_mem()); int i, nid, count = X509_NAME_entry_count(name); X509_NAME_ENTRY *e; ASN1_STRING *v; const char *field_name; size_t size; char nullterm; char *sp; char *dp; text *result; if (membuf == NULL) ereport(ERROR, (errcode(ERRCODE_OUT_OF_MEMORY), errmsg("could not create OpenSSL BIO structure"))); (void) BIO_set_close(membuf, BIO_CLOSE); for (i = 0; i < count; i++) { e = X509_NAME_get_entry(name, i); nid = OBJ_obj2nid(X509_NAME_ENTRY_get_object(e)); if (nid == NID_undef) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("could not get NID for ASN1_OBJECT object"))); v = X509_NAME_ENTRY_get_data(e); field_name = OBJ_nid2sn(nid); if (field_name == NULL) field_name = OBJ_nid2ln(nid); if (field_name == NULL) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("could not convert NID %d to an ASN1_OBJECT structure", nid))); BIO_printf(membuf, "/%s=", field_name); ASN1_STRING_print_ex(membuf, v, ((ASN1_STRFLGS_RFC2253 & ~ASN1_STRFLGS_ESC_MSB) | ASN1_STRFLGS_UTF8_CONVERT)); } /* ensure null termination of the BIO's content */ nullterm = '\0'; BIO_write(membuf, &nullterm, 1); size = BIO_get_mem_data(membuf, &sp); dp = pg_any_to_server(sp, size - 1, PG_UTF8); result = cstring_to_text(dp); if (dp != sp) pfree(dp); if (BIO_free(membuf) != 1) elog(ERROR, "could not free OpenSSL BIO structure"); PG_RETURN_TEXT_P(result); }
/* * Equivalent of X509_NAME_oneline that respects encoding * * This function converts X509_NAME structure to the text variable * converting all textual data into current database encoding. * * Parameter: X509_NAME *name X509_NAME structure to be converted * * Returns: text datum which contains string representation of * X509_NAME */ Datum X509_NAME_to_text(X509_NAME *name) { BIO *membuf = BIO_new(BIO_s_mem()); int i, nid, count = X509_NAME_entry_count(name); X509_NAME_ENTRY *e; ASN1_STRING *v; const char *field_name; size_t size, outlen; char *sp; char *dp; text *result; (void) BIO_set_close(membuf, BIO_CLOSE); for (i = 0; i < count; i++) { e = X509_NAME_get_entry(name, i); nid = OBJ_obj2nid(X509_NAME_ENTRY_get_object(e)); v = X509_NAME_ENTRY_get_data(e); field_name = OBJ_nid2sn(nid); if (!field_name) field_name = OBJ_nid2ln(nid); BIO_printf(membuf, "/%s=", field_name); ASN1_STRING_print_ex(membuf, v, ((ASN1_STRFLGS_RFC2253 & ~ASN1_STRFLGS_ESC_MSB) | ASN1_STRFLGS_UTF8_CONVERT)); } i = 0; BIO_write(membuf, &i, 1); size = BIO_get_mem_data(membuf, &sp); dp = (char *) pg_do_encoding_conversion((unsigned char *) sp, size - 1, PG_UTF8, GetDatabaseEncoding()); BIO_free(membuf); outlen = strlen(dp); result = palloc(VARHDRSZ + outlen); memcpy(VARDATA(result), dp, outlen); /* * pg_do_encoding_conversion has annoying habit of returning source * pointer */ if (dp != sp) pfree(dp); VARATT_SIZEP(result) = outlen + VARHDRSZ; PG_RETURN_TEXT_P(result); }
/* return an array of (RFC 6125 coined) DNS-IDs and CN-IDs in a certificate */ BOOL SSL_X509_getIDs(apr_pool_t *p, X509 *x509, apr_array_header_t **ids) { STACK_OF(GENERAL_NAME) *names; BIO *bio; X509_NAME *subj; char **cpp; int i, n; if (!x509 || !(*ids = apr_array_make(p, 0, sizeof(char *)))) { *ids = NULL; return FALSE; } /* First, the DNS-IDs (dNSName entries in the subjectAltName extension) */ if ((names = X509_get_ext_d2i(x509, NID_subject_alt_name, NULL, NULL)) && (bio = BIO_new(BIO_s_mem()))) { GENERAL_NAME *name; for (i = 0; i < sk_GENERAL_NAME_num(names); i++) { name = sk_GENERAL_NAME_value(names, i); if (name->type == GEN_DNS) { ASN1_STRING_print_ex(bio, name->d.ia5, ASN1_STRFLGS_ESC_CTRL| ASN1_STRFLGS_UTF8_CONVERT); n = BIO_pending(bio); if (n > 0) { cpp = (char **)apr_array_push(*ids); *cpp = apr_palloc(p, n+1); n = BIO_read(bio, *cpp, n); (*cpp)[n] = NUL; } } } BIO_free(bio); } if (names) sk_GENERAL_NAME_pop_free(names, GENERAL_NAME_free); /* Second, the CN-IDs (commonName attributes in the subject DN) */ subj = X509_get_subject_name(x509); i = -1; while ((i = X509_NAME_get_index_by_NID(subj, NID_commonName, i)) != -1) { cpp = (char **)apr_array_push(*ids); *cpp = SSL_X509_NAME_ENTRY_to_string(p, X509_NAME_get_entry(subj, i)); } return apr_is_empty_array(*ids) ? FALSE : TRUE; }
/* * Equivalent of X509_NAME_oneline that respects encoding * * This function converts X509_NAME structure to the text variable * converting all textual data into current database encoding. * * Parameter: X509_NAME *name X509_NAME structure to be converted * * Returns: text datum which contains string representation of * X509_NAME */ datum_t X509_NAME_to_text(X509_NAME *name) { BIO *membuf = BIO_new(BIO_s_mem()); int i, nid, count = X509_NAME_entry_count(name); X509_NAME_ENTRY *e; ASN1_STRING *v; const char *field_name; size_t size; char nullterm; char *sp; char *dp; text *result; (void) BIO_set_close(membuf, BIO_CLOSE); for (i = 0; i < count; i++) { e = X509_NAME_get_entry(name, i); nid = OBJ_obj2nid(X509_NAME_ENTRY_get_object(e)); v = X509_NAME_ENTRY_get_data(e); field_name = OBJ_nid2sn(nid); if (!field_name) field_name = OBJ_nid2ln(nid); BIO_printf(membuf, "/%s=", field_name); ASN1_STRING_print_ex(membuf, v, ((ASN1_STRFLGS_RFC2253 & ~ASN1_STRFLGS_ESC_MSB) | ASN1_STRFLGS_UTF8_CONVERT)); } /* ensure null termination of the BIO's content */ nullterm = '\0'; BIO_write(membuf, &nullterm, 1); size = BIO_get_mem_data(membuf, &sp); dp = (char *) pg_do_encoding_conversion((unsigned char *) sp, size - 1, PG_UTF8, get_db_encoding()); result = cstring_to_text(dp); if (dp != sp) pfree(dp); BIO_free(membuf); RET_TEXT_P(result); }
/* convert a NAME_ENTRY to UTF8 string */ char *SSL_X509_NAME_ENTRY_to_string(apr_pool_t *p, X509_NAME_ENTRY *xsne) { char *result = NULL; BIO* bio; int len; if ((bio = BIO_new(BIO_s_mem())) == NULL) return NULL; ASN1_STRING_print_ex(bio, X509_NAME_ENTRY_get_data(xsne), ASN1_STRFLGS_ESC_CTRL|ASN1_STRFLGS_UTF8_CONVERT); len = BIO_pending(bio); result = apr_palloc(p, len+1); len = BIO_read(bio, result, len); result[len] = NUL; BIO_free(bio); ap_xlate_proto_from_ascii(result, len); return result; }
/* * Convert an X509 subject name to a cstring. * */ static char * X509_NAME_to_cstring(X509_NAME *name) { BIO *membuf = BIO_new(BIO_s_mem()); int i, nid, count = X509_NAME_entry_count(name); X509_NAME_ENTRY *e; ASN1_STRING *v; const char *field_name; size_t size; char nullterm; char *sp; char *dp; char *result; (void) BIO_set_close(membuf, BIO_CLOSE); for (i = 0; i < count; i++) { e = X509_NAME_get_entry(name, i); nid = OBJ_obj2nid(X509_NAME_ENTRY_get_object(e)); v = X509_NAME_ENTRY_get_data(e); field_name = OBJ_nid2sn(nid); if (!field_name) field_name = OBJ_nid2ln(nid); BIO_printf(membuf, "/%s=", field_name); ASN1_STRING_print_ex(membuf, v, ((ASN1_STRFLGS_RFC2253 & ~ASN1_STRFLGS_ESC_MSB) | ASN1_STRFLGS_UTF8_CONVERT)); } /* ensure null termination of the BIO's content */ nullterm = '\0'; BIO_write(membuf, &nullterm, 1); size = BIO_get_mem_data(membuf, &sp); dp = pg_any_to_server(sp, size - 1, PG_UTF8); result = pstrdup(dp); if (dp != sp) pfree(dp); BIO_free(membuf); return result; }
static char* ldaplookup_attr(ASN1_STRING *nv) { char *p = NULL; int k; BIO *mbio; mbio = BIO_new(BIO_s_mem()); if (mbio == NULL) return(NULL); k = ASN1_STRING_print_ex(mbio, nv, XN_FLAG_RFC2253); p = OPENSSL_malloc(k + 1); if (p == NULL) goto done; k = BIO_read(mbio, p, k); p[k] = '\0'; done: BIO_free_all(mbio); return(p); }
/* Convert ASN.1 string to a pool-allocated char * string, escaping * control characters. If raw is zero, convert to UTF-8, otherwise * unchanged from the character set. */ static char *asn1_string_convert(apr_pool_t *p, ASN1_STRING *asn1str, int raw) { char *result = NULL; BIO *bio; int len, flags = ASN1_STRFLGS_ESC_CTRL; if ((bio = BIO_new(BIO_s_mem())) == NULL) return NULL; if (!raw) flags |= ASN1_STRFLGS_UTF8_CONVERT; ASN1_STRING_print_ex(bio, asn1str, flags); len = BIO_pending(bio); if (len > 0) { result = apr_palloc(p, len+1); len = BIO_read(bio, result, len); result[len] = NUL; } BIO_free(bio); return result; }
std::string cert_string_from_asn1_string(ASN1_STRING* value) { char * string_bio_chars = NULL; std::string result; // get a memory bio BIO *string_bio = BIO_new(BIO_s_mem()); if(!string_bio) { // stream the name into the bio. The name will be in the 'short name' format ASN1_STRING_print_ex(string_bio, value, ASN1_STRFLGS_RFC2253); int length = BIO_get_mem_data(string_bio, &string_bio_chars); result = std::string(string_bio_chars, length); BIO_free(string_bio); } else { LL_WARNS("SECAPI") << "Could not allocate an openssl memory BIO." << LL_ENDL; } return result; }
/* Function: GetX509NameInfo Used by System.Security.Cryptography.X509Certificates' OpenSslX509CertificateReader as the entire implementation of X509Certificate2.GetNameInfo. Return values: NULL if the certificate is invalid or no name information could be found, otherwise a pointer to a memory-backed BIO structure which contains the answer to the GetNameInfo query */ BIO* GetX509NameInfo( X509* x509, int nameType, int forIssuer) { static const char szOidUpn[] = "1.3.6.1.4.1.311.20.2.3"; if (!x509 || !x509->cert_info || nameType < NAME_TYPE_SIMPLE || nameType > NAME_TYPE_URL) { return NULL; } // Algorithm behaviors (pseudocode). When forIssuer is true, replace "Subject" with "Issuer" and // SAN (Subject Alternative Names) with IAN (Issuer Alternative Names). // // SimpleName: Subject[CN] ?? Subject[OU] ?? Subject[O] ?? Subject[E] ?? Subject.Rdns.FirstOrDefault() ?? SAN.Entries.FirstOrDefault(type == GEN_EMAIL); // EmailName: SAN.Entries.FirstOrDefault(type == GEN_EMAIL) ?? Subject[E]; // UpnName: SAN.Entries.FirsOrDefaultt(type == GEN_OTHER && entry.AsOther().OID == szOidUpn).AsOther().Value; // DnsName: SAN.Entries.FirstOrDefault(type == GEN_DNS) ?? Subject[CN]; // DnsFromAlternativeName: SAN.Entries.FirstOrDefault(type == GEN_DNS); // UrlName: SAN.Entries.FirstOrDefault(type == GEN_URI); if (nameType == NAME_TYPE_SIMPLE) { X509_NAME* name = forIssuer ? x509->cert_info->issuer : x509->cert_info->subject; if (name) { ASN1_STRING* cn = NULL; ASN1_STRING* ou = NULL; ASN1_STRING* o = NULL; ASN1_STRING* e = NULL; ASN1_STRING* firstRdn = NULL; // Walk the list backwards because it is stored in stack order for (int i = X509_NAME_entry_count(name) - 1; i >= 0; --i) { X509_NAME_ENTRY* entry = X509_NAME_get_entry(name, i); if (!entry) { continue; } ASN1_OBJECT* oid = X509_NAME_ENTRY_get_object(entry); ASN1_STRING* str = X509_NAME_ENTRY_get_data(entry); if (!oid || !str) { continue; } int nid = OBJ_obj2nid(oid); if (nid == NID_commonName) { // CN wins, so no need to keep looking. cn = str; break; } else if (nid == NID_organizationalUnitName) { ou = str; } else if (nid == NID_organizationName) { o = str; } else if (nid == NID_pkcs9_emailAddress) { e = str; } else if (!firstRdn) { firstRdn = str; } } ASN1_STRING* answer = cn; // If there was no CN, but there was something, then perform fallbacks. if (!answer && firstRdn) { answer = ou; if (!answer) { answer = o; } if (!answer) { answer = e; } if (!answer) { answer = firstRdn; } } if (answer) { BIO* b = BIO_new(BIO_s_mem()); ASN1_STRING_print_ex(b, answer, 0); return b; } } } if (nameType == NAME_TYPE_SIMPLE || nameType == NAME_TYPE_DNS || nameType == NAME_TYPE_DNSALT || nameType == NAME_TYPE_EMAIL || nameType == NAME_TYPE_UPN || nameType == NAME_TYPE_URL) { int expectedType = -1; switch (nameType) { case NAME_TYPE_DNS: case NAME_TYPE_DNSALT: expectedType = GEN_DNS; break; case NAME_TYPE_SIMPLE: case NAME_TYPE_EMAIL: expectedType = GEN_EMAIL; break; case NAME_TYPE_UPN: expectedType = GEN_OTHERNAME; break; case NAME_TYPE_URL: expectedType = GEN_URI; break; } STACK_OF(GENERAL_NAME)* altNames = X509_get_ext_d2i(x509, forIssuer ? NID_issuer_alt_name : NID_subject_alt_name, NULL, NULL); if (altNames) { int i; for (i = 0; i < sk_GENERAL_NAME_num(altNames); ++i) { GENERAL_NAME* altName = sk_GENERAL_NAME_value(altNames, i); if (altName && altName->type == expectedType) { ASN1_STRING* str = NULL; switch (nameType) { case NAME_TYPE_DNS: case NAME_TYPE_DNSALT: str = altName->d.dNSName; break; case NAME_TYPE_SIMPLE: case NAME_TYPE_EMAIL: str = altName->d.rfc822Name; break; case NAME_TYPE_URL: str = altName->d.uniformResourceIdentifier; break; case NAME_TYPE_UPN: { OTHERNAME* value = altName->d.otherName; if (value) { // Enough more padding than szOidUpn that a \0 won't accidentally align char localOid[sizeof(szOidUpn) + 3]; int cchLocalOid = 1 + OBJ_obj2txt(localOid, sizeof(localOid), value->type_id, 1); if (sizeof(szOidUpn) == cchLocalOid && 0 == strncmp(localOid, szOidUpn, sizeof(szOidUpn))) { //OTHERNAME->ASN1_TYPE->union.field str = value->value->value.asn1_string; } } break; } } if (str) { BIO* b = BIO_new(BIO_s_mem()); ASN1_STRING_print_ex(b, str, 0); sk_GENERAL_NAME_free(altNames); return b; } } } sk_GENERAL_NAME_free(altNames); } } if (nameType == NAME_TYPE_EMAIL || nameType == NAME_TYPE_DNS) { X509_NAME* name = forIssuer ? x509->cert_info->issuer : x509->cert_info->subject; int expectedNid = NID_undef; switch (nameType) { case NAME_TYPE_EMAIL: expectedNid = NID_pkcs9_emailAddress; break; case NAME_TYPE_DNS: expectedNid = NID_commonName; break; } if (name) { // Walk the list backwards because it is stored in stack order for (int i = X509_NAME_entry_count(name) - 1; i >= 0; --i) { X509_NAME_ENTRY* entry = X509_NAME_get_entry(name, i); if (!entry) { continue; } ASN1_OBJECT* oid = X509_NAME_ENTRY_get_object(entry); ASN1_STRING* str = X509_NAME_ENTRY_get_data(entry); if (!oid || !str) { continue; } int nid = OBJ_obj2nid(oid); if (nid == expectedNid) { BIO* b = BIO_new(BIO_s_mem()); ASN1_STRING_print_ex(b, str, 0); return b; } } } } return NULL; }
int TS_STATUS_INFO_print_bio(BIO *bio, TS_STATUS_INFO *a) { static const char *status_map[] = { "Granted.", "Granted with modifications.", "Rejected.", "Waiting.", "Revocation warning.", "Revoked." }; static struct status_map_st failure_map[] = { {TS_INFO_BAD_ALG, "unrecognized or unsupported algorithm identifier"}, {TS_INFO_BAD_REQUEST, "transaction not permitted or supported"}, {TS_INFO_BAD_DATA_FORMAT, "the data submitted has the wrong format"}, {TS_INFO_TIME_NOT_AVAILABLE, "the TSA's time source is not available"}, {TS_INFO_UNACCEPTED_POLICY, "the requested TSA policy is not supported by the TSA"}, {TS_INFO_UNACCEPTED_EXTENSION, "the requested extension is not supported by the TSA"}, {TS_INFO_ADD_INFO_NOT_AVAILABLE, "the additional information requested could not be understood " "or is not available"}, {TS_INFO_SYSTEM_FAILURE, "the request cannot be handled due to system failure"}, {-1, NULL} }; long status; int i, lines = 0; /* Printing status code. */ BIO_printf(bio, "Status: "); status = ASN1_INTEGER_get(a->status); if (0 <= status && status < (long)(sizeof(status_map) / sizeof(status_map[0]))) BIO_printf(bio, "%s\n", status_map[status]); else BIO_printf(bio, "out of bounds\n"); /* Printing status description. */ BIO_printf(bio, "Status description: "); for (i = 0; i < sk_ASN1_UTF8STRING_num(a->text); ++i) { if (i > 0) BIO_puts(bio, "\t"); ASN1_STRING_print_ex(bio, sk_ASN1_UTF8STRING_value(a->text, i), 0); BIO_puts(bio, "\n"); } if (i == 0) BIO_printf(bio, "unspecified\n"); /* Printing failure information. */ BIO_printf(bio, "Failure info: "); if (a->failure_info != NULL) lines = TS_status_map_print(bio, failure_map, a->failure_info); if (lines == 0) BIO_printf(bio, "unspecified"); BIO_printf(bio, "\n"); return 1; }
extern "C" int32_t CryptoNative_Asn1StringPrintEx(BIO* out, ASN1_STRING* str, Asn1StringPrintFlags flags) { return ASN1_STRING_print_ex(out, str, flags); }