diff options
author | Ulf Möller <ulf@openssl.org> | 2000-02-01 02:21:16 +0000 |
---|---|---|
committer | Ulf Möller <ulf@openssl.org> | 2000-02-01 02:21:16 +0000 |
commit | 8efb60144db6662fab314dd914a62356bffd4b5a (patch) | |
tree | 8711522dba38b925667263a772b23b64d11fccc4 /crypto/x509v3 | |
parent | 388f2f56f213dfada0370d48cb9bcc3c7e980b32 (diff) |
EBCDIC support.
Submitted by: Martin Kraemer <martin.kraemer@mch.sni.de>
Diffstat (limited to 'crypto/x509v3')
-rw-r--r-- | crypto/x509v3/v3_ia5.c | 3 | ||||
-rw-r--r-- | crypto/x509v3/v3_prn.c | 16 |
2 files changed, 19 insertions, 0 deletions
diff --git a/crypto/x509v3/v3_ia5.c b/crypto/x509v3/v3_ia5.c index 43dfd04f78..af3525f33e 100644 --- a/crypto/x509v3/v3_ia5.c +++ b/crypto/x509v3/v3_ia5.c @@ -102,6 +102,9 @@ static ASN1_IA5STRING *s2i_ASN1_IA5STRING(X509V3_EXT_METHOD *method, M_ASN1_IA5STRING_free(ia5); goto err; } +#ifdef CHARSET_EBCDIC + ebcdic2ascii(ia5->data, ia5->data, ia5->length); +#endif /*CHARSET_EBCDIC*/ return ia5; err: X509V3err(X509V3_F_S2I_ASN1_IA5STRING,ERR_R_MALLOC_FAILURE); diff --git a/crypto/x509v3/v3_prn.c b/crypto/x509v3/v3_prn.c index dc20c6bdba..bee624c6be 100644 --- a/crypto/x509v3/v3_prn.c +++ b/crypto/x509v3/v3_prn.c @@ -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; |