For an extension type which OpenSSL does not recognize, attempt to * parse the extension type as a primitive string. This will fail for * any structured extension type per the docs. Returns non-zero on * success and writes the string to the given bio. */
| 1036 | * any structured extension type per the docs. Returns non-zero on |
| 1037 | * success and writes the string to the given bio. */ |
| 1038 | static int dump_extn_value(BIO *bio, const ASN1_OCTET_STRING *str) |
| 1039 | { |
| 1040 | const unsigned char *pp = ASN1_STRING_get0_data(str); |
| 1041 | ASN1_STRING *ret = ASN1_STRING_new(); |
| 1042 | int rv = 0; |
| 1043 | |
| 1044 | if (!ret) { |
| 1045 | return rv; |
| 1046 | } |
| 1047 | |
| 1048 | /* This allows UTF8String, IA5String, VisibleString, or BMPString; |
| 1049 | * conversion to UTF-8 is forced. */ |
| 1050 | if (d2i_DISPLAYTEXT(&ret, &pp, ASN1_STRING_length(str))) { |
| 1051 | ASN1_STRING_print_ex(bio, ret, ASN1_STRFLGS_UTF8_CONVERT); |
| 1052 | rv = 1; |
| 1053 | } |
| 1054 | |
| 1055 | ASN1_STRING_free(ret); |
| 1056 | return rv; |
| 1057 | } |
| 1058 | |
| 1059 | apr_array_header_t *ssl_ext_list(apr_pool_t *p, conn_rec *c, int peer, |
| 1060 | const char *extension) |