It's not just VMS that needs some symbols to be hacked. Let's
[oweals/openssl.git] / crypto / x509v3 / v3_prn.c
index 74cad7d90b7ef9629016bac9a4984da442f9a3fb..dbc4fb1f160009d575d919c689a40f9afac25c0b 100644 (file)
@@ -81,7 +81,15 @@ void X509V3_EXT_val_prn(BIO *out, STACK_OF(CONF_VALUE) *val, int indent, int ml)
                nval = sk_CONF_VALUE_value(val, i);
                if(!nval->name) BIO_puts(out, nval->value);
                else if(!nval->value) BIO_puts(out, nval->name);
+#ifndef CHARSET_EBCDIC
                else BIO_printf(out, "%s:%s", nval->name, nval->value);
+#else
+               else {
+                       char tmp[10240]; /* 10k is BIO_printf's limit anyway */
+                       ascii2ebcdic(tmp, nval->value, strlen(nval->value)+1);
+                       BIO_printf(out, "%s:%s", nval->name, tmp);
+               }
+#endif
                if(ml) BIO_puts(out, "\n");
        }
 }
@@ -103,7 +111,15 @@ int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, int flag, int indent)
                        ok = 0;
                        goto err;
                }
+#ifndef CHARSET_EBCDIC
                BIO_printf(out, "%*s%s", indent, "", value);
+#else
+               {
+                       char tmp[10240]; /* 10k is BIO_printf's limit anyway */
+                       ascii2ebcdic(tmp, value, strlen(value)+1);
+                       BIO_printf(out, "%*s%s", indent, "", tmp);
+               }
+#endif
        } else if(method->i2v) {
                if(!(nval = method->i2v(method, ext_str, NULL))) {
                        ok = 0;
@@ -117,11 +133,12 @@ int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, int flag, int indent)
 
        err:
                sk_CONF_VALUE_pop_free(nval, X509V3_conf_free);
-               if(value) Free(value);
+               if(value) OPENSSL_free(value);
                method->ext_free(ext_str);
                return ok;
 }
 
+#ifndef NO_FP_API
 int X509V3_EXT_print_fp(FILE *fp, X509_EXTENSION *ext, int flag, int indent)
 {
        BIO *bio_tmp;
@@ -131,3 +148,4 @@ int X509V3_EXT_print_fp(FILE *fp, X509_EXTENSION *ext, int flag, int indent)
        BIO_free(bio_tmp);
        return ret;
 }
+#endif