MCPcopy Create free account
hub / github.com/apache/httpd / modssl_ASN1_STRING_convert

Function modssl_ASN1_STRING_convert

modules/ssl/ssl_util_ssl.c:205–218  ·  view source on GitHub ↗

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. */

Source from the content-addressed store, hash-verified

203 * control characters. If raw is zero, convert to UTF-8, otherwise
204 * unchanged from the character set. */
205char *modssl_ASN1_STRING_convert(apr_pool_t *p, const ASN1_STRING *asn1str, int raw)
206{
207 BIO *bio;
208 int flags = ASN1_STRFLGS_ESC_CTRL;
209
210 if ((bio = BIO_new(BIO_s_mem())) == NULL)
211 return NULL;
212
213 if (!raw) flags |= ASN1_STRFLGS_UTF8_CONVERT;
214
215 ASN1_STRING_print_ex(bio, asn1str, flags);
216
217 return modssl_bio_free_read(p, bio);
218}
219
220#define asn1_string_to_utf8(p, a) modssl_ASN1_STRING_convert(p, a, 0)
221

Callers 2

extract_responder_uriFunction · 0.85

Calls 1

modssl_bio_free_readFunction · 0.85

Tested by

no test coverage detected