summaryrefslogtreecommitdiffstats
path: root/crypto/evp/encode.c
diff options
context:
space:
mode:
authorUlf Möller <ulf@openssl.org>1999-06-04 21:35:58 +0000
committerUlf Möller <ulf@openssl.org>1999-06-04 21:35:58 +0000
commita53955d8abd68c604de02cc1e101c66169207fb7 (patch)
treee51051484f2b073f7b58a1549442bf0657ca2978 /crypto/evp/encode.c
parent9231f4779677a3cb95a4f8ccebd56432cb914498 (diff)
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/evp/encode.c')
-rw-r--r--crypto/evp/encode.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/crypto/evp/encode.c b/crypto/evp/encode.c
index 20d6ec6dd0..0152624a76 100644
--- a/crypto/evp/encode.c
+++ b/crypto/evp/encode.c
@@ -60,8 +60,19 @@
#include "cryptlib.h"
#include <openssl/evp.h>
+#ifndef CHARSET_EBCDIC
#define conv_bin2ascii(a) (data_bin2ascii[(a)&0x3f])
#define conv_ascii2bin(a) (data_ascii2bin[(a)&0x7f])
+#else
+/* We assume that PEM encoded files are EBCDIC files
+ * (i.e., printable text files). Convert them here while decoding.
+ * When encoding, output is EBCDIC (text) format again.
+ * (No need for conversion in the conv_bin2ascii macro, as the
+ * underlying textstring data_bin2ascii[] is already EBCDIC)
+ */
+#define conv_bin2ascii(a) (data_bin2ascii[(a)&0x3f])
+#define conv_ascii2bin(a) (data_ascii2bin[os_toascii[a]&0x7f])
+#endif
/* 64 char lines
* pad input with 0