diff options
author | Ulf Möller <ulf@openssl.org> | 1999-06-04 21:35:58 +0000 |
---|---|---|
committer | Ulf Möller <ulf@openssl.org> | 1999-06-04 21:35:58 +0000 |
commit | a53955d8abd68c604de02cc1e101c66169207fb7 (patch) | |
tree | e51051484f2b073f7b58a1549442bf0657ca2978 /crypto/asn1/a_time.c | |
parent | 9231f4779677a3cb95a4f8ccebd56432cb914498 (diff) | |
download | openssl-new-a53955d8abd68c604de02cc1e101c66169207fb7.tar.gz |
Support the EBCDIC character set and BS2000/OSD-POSIX (work in progress).
Submitted by: Martin Kraemer <Martin.Kraemer@MchP.Siemens.De>
Diffstat (limited to 'crypto/asn1/a_time.c')
-rw-r--r-- | crypto/asn1/a_time.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/crypto/asn1/a_time.c b/crypto/asn1/a_time.c index 718992d0a5..c1690a5694 100644 --- a/crypto/asn1/a_time.c +++ b/crypto/asn1/a_time.c @@ -68,6 +68,21 @@ int i2d_ASN1_TIME(ASN1_TIME *a, unsigned char **pp) { +#ifdef CHARSET_EBCDIC + /* KLUDGE! We convert to ascii before writing DER */ + char tmp[24]; + ASN1_STRING tmpstr; + + if(a->type == V_ASN1_UTCTIME || a->type == V_ASN1_GENERALIZEDTIME) { + int len; + + tmpstr = *(ASN1_STRING *)a; + len = tmpstr.length; + ebcdic2ascii(tmp, tmpstr.data, (len >= sizeof tmp) ? sizeof tmp : len); + tmpstr.data = tmp; + a = (ASN1_GENERALIZEDTIME *) &tmpstr; + } +#endif if(a->type == V_ASN1_UTCTIME || a->type == V_ASN1_GENERALIZEDTIME) return(i2d_ASN1_bytes((ASN1_STRING *)a,pp, a->type ,V_ASN1_UNIVERSAL)); |