summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libcrypto/asn1/a_gentm.c18
-rw-r--r--lib/libcrypto/asn1/a_mbstr.c7
-rw-r--r--lib/libcrypto/asn1/a_print.c8
-rw-r--r--lib/libcrypto/asn1/a_time.c15
-rw-r--r--lib/libcrypto/asn1/a_utctm.c18
-rw-r--r--lib/libcrypto/asn1/f_int.c9
-rw-r--r--lib/libcrypto/asn1/f_string.c9
-rw-r--r--lib/libcrypto/asn1/t_x509.c10
-rw-r--r--lib/libcrypto/bf/bftest.c11
-rw-r--r--lib/libcrypto/bio/b_dump.c6
-rw-r--r--lib/libcrypto/conf/conf_def.h17
-rw-r--r--lib/libcrypto/conf/keysets.pl16
-rw-r--r--lib/libcrypto/crypto.h4
-rw-r--r--lib/libcrypto/des/fcrypt.c46
-rw-r--r--lib/libcrypto/ebcdic.c221
-rw-r--r--lib/libcrypto/ebcdic.h19
-rw-r--r--lib/libcrypto/evp/encode.c11
-rw-r--r--lib/libcrypto/hmac/hmactest.c11
-rw-r--r--lib/libcrypto/md2/md2_one.c16
-rw-r--r--lib/libcrypto/md2/md2test.c4
-rw-r--r--lib/libcrypto/md4/md4_one.c20
-rw-r--r--lib/libcrypto/md5/md5_one.c20
-rw-r--r--lib/libcrypto/mdc2/mdc2test.c11
-rw-r--r--lib/libcrypto/objects/obj_dat.c16
-rw-r--r--lib/libcrypto/pem/pem_lib.c15
-rw-r--r--lib/libcrypto/ripemd/rmdtest.c7
-rw-r--r--lib/libcrypto/sha/sha1test.c12
-rw-r--r--lib/libcrypto/sha/shatest.c12
-rw-r--r--lib/libcrypto/x509/x509_obj.c40
-rw-r--r--lib/libcrypto/x509v3/v3_ia5.c3
-rw-r--r--lib/libcrypto/x509v3/v3_prn.c30
-rw-r--r--lib/libcrypto/x509v3/v3_utl.c18
-rw-r--r--lib/libssl/ssl_ciph.c4
-rw-r--r--lib/libssl/tls1.h19
34 files changed, 3 insertions, 700 deletions
diff --git a/lib/libcrypto/asn1/a_gentm.c b/lib/libcrypto/asn1/a_gentm.c
index 04266e790a6..4f312ee6c9c 100644
--- a/lib/libcrypto/asn1/a_gentm.c
+++ b/lib/libcrypto/asn1/a_gentm.c
@@ -68,18 +68,6 @@
int i2d_ASN1_GENERALIZEDTIME(ASN1_GENERALIZEDTIME *a, unsigned char **pp)
{
-#ifdef CHARSET_EBCDIC
- /* KLUDGE! We convert to ascii before writing DER */
- int len;
- char tmp[24];
- ASN1_STRING 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
return(i2d_ASN1_bytes((ASN1_STRING *)a,pp,
V_ASN1_GENERALIZEDTIME,V_ASN1_UNIVERSAL));
}
@@ -97,9 +85,6 @@ ASN1_GENERALIZEDTIME *d2i_ASN1_GENERALIZEDTIME(ASN1_GENERALIZEDTIME **a,
ASN1err(ASN1_F_D2I_ASN1_GENERALIZEDTIME,ERR_R_NESTED_ASN1_ERROR);
return(NULL);
}
-#ifdef CHARSET_EBCDIC
- ascii2ebcdic(ret->data, ret->data, ret->length);
-#endif
if (!ASN1_GENERALIZEDTIME_check(ret))
{
ASN1err(ASN1_F_D2I_ASN1_GENERALIZEDTIME,ASN1_R_INVALID_TIME_FORMAT);
@@ -256,8 +241,5 @@ ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s,
ts->tm_mon+1,ts->tm_mday,ts->tm_hour,ts->tm_min,ts->tm_sec);
s->length=strlen(p);
s->type=V_ASN1_GENERALIZEDTIME;
-#ifdef CHARSET_EBCDIC_not
- ebcdic2ascii(s->data, s->data, s->length);
-#endif
return(s);
}
diff --git a/lib/libcrypto/asn1/a_mbstr.c b/lib/libcrypto/asn1/a_mbstr.c
index 264d8f677f0..dc953c83251 100644
--- a/lib/libcrypto/asn1/a_mbstr.c
+++ b/lib/libcrypto/asn1/a_mbstr.c
@@ -385,16 +385,9 @@ static int is_printable(unsigned long value)
/* Note: we can't use 'isalnum' because certain accented
* characters may count as alphanumeric in some environments.
*/
-#ifndef CHARSET_EBCDIC
if((ch >= 'a') && (ch <= 'z')) return 1;
if((ch >= 'A') && (ch <= 'Z')) return 1;
if((ch >= '0') && (ch <= '9')) return 1;
if ((ch == ' ') || strchr("'()+,-./:=?", ch)) return 1;
-#else /*CHARSET_EBCDIC*/
- if((ch >= os_toascii['a']) && (ch <= os_toascii['z'])) return 1;
- if((ch >= os_toascii['A']) && (ch <= os_toascii['Z'])) return 1;
- if((ch >= os_toascii['0']) && (ch <= os_toascii['9'])) return 1;
- if ((ch == os_toascii[' ']) || strchr("'()+,-./:=?", os_toebcdic[ch])) return 1;
-#endif /*CHARSET_EBCDIC*/
return 0;
}
diff --git a/lib/libcrypto/asn1/a_print.c b/lib/libcrypto/asn1/a_print.c
index d18e7723204..9eec5034e1a 100644
--- a/lib/libcrypto/asn1/a_print.c
+++ b/lib/libcrypto/asn1/a_print.c
@@ -72,7 +72,6 @@ int ASN1_PRINTABLE_type(const unsigned char *s, int len)
while ((*s) && (len-- != 0))
{
c= *(s++);
-#ifndef CHARSET_EBCDIC
if (!( ((c >= 'a') && (c <= 'z')) ||
((c >= 'A') && (c <= 'Z')) ||
(c == ' ') ||
@@ -86,13 +85,6 @@ int ASN1_PRINTABLE_type(const unsigned char *s, int len)
ia5=1;
if (c&0x80)
t61=1;
-#else
- if (!isalnum(c) && (c != ' ') &&
- strchr("'()+,-./:=?", c) == NULL)
- ia5=1;
- if (os_toascii[c] & 0x80)
- t61=1;
-#endif
}
if (t61) return(V_ASN1_T61STRING);
if (ia5) return(V_ASN1_IA5STRING);
diff --git a/lib/libcrypto/asn1/a_time.c b/lib/libcrypto/asn1/a_time.c
index e2eb9b243ef..4ade88f065c 100644
--- a/lib/libcrypto/asn1/a_time.c
+++ b/lib/libcrypto/asn1/a_time.c
@@ -74,21 +74,6 @@ IMPLEMENT_ASN1_FUNCTIONS(ASN1_TIME)
#if 0
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));
diff --git a/lib/libcrypto/asn1/a_utctm.c b/lib/libcrypto/asn1/a_utctm.c
index 615395b7389..f2e7de16af5 100644
--- a/lib/libcrypto/asn1/a_utctm.c
+++ b/lib/libcrypto/asn1/a_utctm.c
@@ -65,20 +65,8 @@
#if 0
int i2d_ASN1_UTCTIME(ASN1_UTCTIME *a, unsigned char **pp)
{
-#ifndef CHARSET_EBCDIC
return(i2d_ASN1_bytes((ASN1_STRING *)a,pp,
V_ASN1_UTCTIME,V_ASN1_UNIVERSAL));
-#else
- /* KLUDGE! We convert to ascii before writing DER */
- int len;
- char tmp[24];
- ASN1_STRING x = *(ASN1_STRING *)a;
-
- len = x.length;
- ebcdic2ascii(tmp, x.data, (len >= sizeof tmp) ? sizeof tmp : len);
- x.data = tmp;
- return i2d_ASN1_bytes(&x, pp, V_ASN1_UTCTIME,V_ASN1_UNIVERSAL);
-#endif
}
@@ -94,9 +82,6 @@ ASN1_UTCTIME *d2i_ASN1_UTCTIME(ASN1_UTCTIME **a, unsigned char **pp,
ASN1err(ASN1_F_D2I_ASN1_UTCTIME,ERR_R_NESTED_ASN1_ERROR);
return(NULL);
}
-#ifdef CHARSET_EBCDIC
- ascii2ebcdic(ret->data, ret->data, ret->length);
-#endif
if (!ASN1_UTCTIME_check(ret))
{
ASN1err(ASN1_F_D2I_ASN1_UTCTIME,ASN1_R_INVALID_TIME_FORMAT);
@@ -233,9 +218,6 @@ ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t,
ts->tm_mon+1,ts->tm_mday,ts->tm_hour,ts->tm_min,ts->tm_sec);
s->length=strlen(p);
s->type=V_ASN1_UTCTIME;
-#ifdef CHARSET_EBCDIC_not
- ebcdic2ascii(s->data, s->data, s->length);
-#endif
return(s);
}
diff --git a/lib/libcrypto/asn1/f_int.c b/lib/libcrypto/asn1/f_int.c
index 9494e597abc..8b92fad9df3 100644
--- a/lib/libcrypto/asn1/f_int.c
+++ b/lib/libcrypto/asn1/f_int.c
@@ -123,18 +123,9 @@ int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size)
for (j=0; j<i; j++)
{
-#ifndef CHARSET_EBCDIC
if (!( ((buf[j] >= '0') && (buf[j] <= '9')) ||
((buf[j] >= 'a') && (buf[j] <= 'f')) ||
((buf[j] >= 'A') && (buf[j] <= 'F'))))
-#else
- /* This #ifdef is not strictly necessary, since
- * the characters A...F a...f 0...9 are contiguous
- * (yes, even in EBCDIC - but not the whole alphabet).
- * Nevertheless, isxdigit() is faster.
- */
- if (!isxdigit(buf[j]))
-#endif
{
i=j;
break;
diff --git a/lib/libcrypto/asn1/f_string.c b/lib/libcrypto/asn1/f_string.c
index 968698a7988..f7d36adac79 100644
--- a/lib/libcrypto/asn1/f_string.c
+++ b/lib/libcrypto/asn1/f_string.c
@@ -123,18 +123,9 @@ int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size)
for (j=i-1; j>0; j--)
{
-#ifndef CHARSET_EBCDIC
if (!( ((buf[j] >= '0') && (buf[j] <= '9')) ||
((buf[j] >= 'a') && (buf[j] <= 'f')) ||
((buf[j] >= 'A') && (buf[j] <= 'F'))))
-#else
- /* This #ifdef is not strictly necessary, since
- * the characters A...F a...f 0...9 are contiguous
- * (yes, even in EBCDIC - but not the whole alphabet).
- * Nevertheless, isxdigit() is faster.
- */
- if (!isxdigit(buf[j]))
-#endif
{
i=j;
break;
diff --git a/lib/libcrypto/asn1/t_x509.c b/lib/libcrypto/asn1/t_x509.c
index edbb39a02f7..bbf00c7a29b 100644
--- a/lib/libcrypto/asn1/t_x509.c
+++ b/lib/libcrypto/asn1/t_x509.c
@@ -485,7 +485,6 @@ int X509_NAME_print(BIO *bp, X509_NAME *name, int obase)
c=s;
for (;;)
{
-#ifndef CHARSET_EBCDIC
if ( ((*s == '/') &&
((s[1] >= 'A') && (s[1] <= 'Z') && (
(s[2] == '=') ||
@@ -493,15 +492,6 @@ int X509_NAME_print(BIO *bp, X509_NAME *name, int obase)
(s[3] == '='))
))) ||
(*s == '\0'))
-#else
- if ( ((*s == '/') &&
- (isupper(s[1]) && (
- (s[2] == '=') ||
- (isupper(s[2]) &&
- (s[3] == '='))
- ))) ||
- (*s == '\0'))
-#endif
{
i=s-c;
if (BIO_write(bp,c,i) != i) goto err;
diff --git a/lib/libcrypto/bf/bftest.c b/lib/libcrypto/bf/bftest.c
index 97e6634d37f..20caf0f3f83 100644
--- a/lib/libcrypto/bf/bftest.c
+++ b/lib/libcrypto/bf/bftest.c
@@ -75,10 +75,6 @@ int main(int argc, char *argv[])
#else
#include <openssl/blowfish.h>
-#ifdef CHARSET_EBCDIC
-#include <openssl/ebcdic.h>
-#endif
-
static char *bf_key[2]={
"abcdefghijklmnopqrstuvwxyz",
"Who is John Galt?"
@@ -361,16 +357,9 @@ static int test(void)
unsigned char out[8];
BF_LONG len;
-#ifdef CHARSET_EBCDIC
- ebcdic2ascii(cbc_data, cbc_data, strlen(cbc_data));
-#endif
-
printf("testing blowfish in raw ecb mode\n");
for (n=0; n<2; n++)
{
-#ifdef CHARSET_EBCDIC
- ebcdic2ascii(bf_key[n], bf_key[n], strlen(bf_key[n]));
-#endif
BF_set_key(&key,strlen(bf_key[n]),(unsigned char *)bf_key[n]);
data[0]=bf_plain[n][0];
diff --git a/lib/libcrypto/bio/b_dump.c b/lib/libcrypto/bio/b_dump.c
index bea94969a2f..32d523563ea 100644
--- a/lib/libcrypto/bio/b_dump.c
+++ b/lib/libcrypto/bio/b_dump.c
@@ -125,14 +125,8 @@ BIO_dump_indent_cb(int (*cb)(const void *data, size_t len, void *u),
if (((i*dump_width) + j) >= len)
break;
ch = ((unsigned char)*(s + i * dump_width + j)) & 0xff;
-#ifndef CHARSET_EBCDIC
(void) snprintf(tmp, sizeof tmp, "%c",
((ch >= ' ') && (ch <= '~')) ? ch : '.');
-#else
- (void) snprintf(tmp, sizeof tmp, "%c",
- ((ch >= os_toascii[' ']) && (ch <= os_toascii['~']))
- ? os_toebcdic[ch] : '.');
-#endif
BUF_strlcat(buf, tmp, sizeof buf);
}
BUF_strlcat(buf, "\n", sizeof buf);
diff --git a/lib/libcrypto/conf/conf_def.h b/lib/libcrypto/conf/conf_def.h
index 92a7d8ad77c..b18e6e27285 100644
--- a/lib/libcrypto/conf/conf_def.h
+++ b/lib/libcrypto/conf/conf_def.h
@@ -78,7 +78,6 @@
CONF_PUNCTUATION)
#define KEYTYPES(c) ((unsigned short *)((c)->meth_data))
-#ifndef CHARSET_EBCDIC
#define IS_COMMENT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_COMMENT)
#define IS_FCOMMENT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_FCOMMENT)
#define IS_EOF(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_EOF)
@@ -92,22 +91,6 @@
#define IS_DQUOTE(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_DQUOTE)
#define IS_HIGHBIT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_HIGHBIT)
-#else /*CHARSET_EBCDIC*/
-
-#define IS_COMMENT(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_COMMENT)
-#define IS_FCOMMENT(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_FCOMMENT)
-#define IS_EOF(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_EOF)
-#define IS_ESC(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_ESC)
-#define IS_NUMBER(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_NUMBER)
-#define IS_WS(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_WS)
-#define IS_ALPHA_NUMERIC(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_ALPHA_NUMERIC)
-#define IS_ALPHA_NUMERIC_PUNCT(c,a) \
- (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_ALPHA_NUMERIC_PUNCT)
-#define IS_QUOTE(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_QUOTE)
-#define IS_DQUOTE(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_DQUOTE)
-#define IS_HIGHBIT(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_HIGHBIT)
-#endif /*CHARSET_EBCDIC*/
-
static unsigned short CONF_type_default[256]={
0x0008,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0010,0x0010,0x0000,0x0000,0x0010,0x0000,0x0000,
diff --git a/lib/libcrypto/conf/keysets.pl b/lib/libcrypto/conf/keysets.pl
index 50ed67fa527..fe17be57fea 100644
--- a/lib/libcrypto/conf/keysets.pl
+++ b/lib/libcrypto/conf/keysets.pl
@@ -132,7 +132,6 @@ print <<"EOF";
CONF_PUNCTUATION)
#define KEYTYPES(c) ((unsigned short *)((c)->meth_data))
-#ifndef CHARSET_EBCDIC
#define IS_COMMENT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_COMMENT)
#define IS_FCOMMENT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_FCOMMENT)
#define IS_EOF(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_EOF)
@@ -146,21 +145,6 @@ print <<"EOF";
#define IS_DQUOTE(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_DQUOTE)
#define IS_HIGHBIT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_HIGHBIT)
-#else /*CHARSET_EBCDIC*/
-
-#define IS_COMMENT(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_COMMENT)
-#define IS_FCOMMENT(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_FCOMMENT)
-#define IS_EOF(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_EOF)
-#define IS_ESC(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_ESC)
-#define IS_NUMBER(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_NUMBER)
-#define IS_WS(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_WS)
-#define IS_ALPHA_NUMERIC(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_ALPHA_NUMERIC)
-#define IS_ALPHA_NUMERIC_PUNCT(c,a) \\
- (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_ALPHA_NUMERIC_PUNCT)
-#define IS_QUOTE(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_QUOTE)
-#define IS_DQUOTE(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_DQUOTE)
-#define IS_HIGHBIT(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_HIGHBIT)
-#endif /*CHARSET_EBCDIC*/
EOF
diff --git a/lib/libcrypto/crypto.h b/lib/libcrypto/crypto.h
index baeba25b996..351ccfd35b4 100644
--- a/lib/libcrypto/crypto.h
+++ b/lib/libcrypto/crypto.h
@@ -130,10 +130,6 @@
#include <openssl/opensslv.h>
#include <openssl/ossl_typ.h>
-#ifdef CHARSET_EBCDIC
-#include <openssl/ebcdic.h>
-#endif
-
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/lib/libcrypto/des/fcrypt.c b/lib/libcrypto/des/fcrypt.c
index ccbdff250f7..d02189b290e 100644
--- a/lib/libcrypto/des/fcrypt.c
+++ b/lib/libcrypto/des/fcrypt.c
@@ -1,13 +1,5 @@
/* NOCW */
#include <stdio.h>
-#ifdef _OSD_POSIX
-#ifndef CHARSET_EBCDIC
-#define CHARSET_EBCDIC 1
-#endif
-#endif
-#ifdef CHARSET_EBCDIC
-#include <openssl/ebcdic.h>
-#endif
/* This version of crypt has been developed from my MIT compatible
* DES library.
@@ -62,37 +54,7 @@ char *DES_crypt(const char *buf, const char *salt)
{
static char buff[14];
-#ifndef CHARSET_EBCDIC
return(DES_fcrypt(buf,salt,buff));
-#else
- char e_salt[2+1];
- char e_buf[32+1]; /* replace 32 by 8 ? */
- char *ret;
-
- /* Copy at most 2 chars of salt */
- if ((e_salt[0] = salt[0]) != '\0')
- e_salt[1] = salt[1];
-
- /* Copy at most 32 chars of password */
- strncpy (e_buf, buf, sizeof(e_buf));
-
- /* Make sure we have a delimiter */
- e_salt[sizeof(e_salt)-1] = e_buf[sizeof(e_buf)-1] = '\0';
-
- /* Convert the e_salt to ASCII, as that's what DES_fcrypt works on */
- ebcdic2ascii(e_salt, e_salt, sizeof e_salt);
-
- /* Convert the cleartext password to ASCII */
- ebcdic2ascii(e_buf, e_buf, sizeof e_buf);
-
- /* Encrypt it (from/to ASCII) */
- ret = DES_fcrypt(e_buf,e_salt,buff);
-
- /* Convert the result back to EBCDIC */
- ascii2ebcdic(ret, ret, strlen(ret));
-
- return ret;
-#endif
}
@@ -115,18 +77,10 @@ char *DES_fcrypt(const char *buf, const char *salt, char *ret)
* crypt to "*". This was found when replacing the crypt in
* our shared libraries. People found that the disabled
* accounts effectively had no passwd :-(. */
-#ifndef CHARSET_EBCDIC
x=ret[0]=((salt[0] == '\0')?'A':salt[0]);
Eswap0=con_salt[x]<<2;
x=ret[1]=((salt[1] == '\0')?'A':salt[1]);
Eswap1=con_salt[x]<<6;
-#else
- x=ret[0]=((salt[0] == '\0')?os_toascii['A']:salt[0]);
- Eswap0=con_salt[x]<<2;
- x=ret[1]=((salt[1] == '\0')?os_toascii['A']:salt[1]);
- Eswap1=con_salt[x]<<6;
-#endif
-
/* EAY
r=strlen(buf);
r=(r+7)/8;
diff --git a/lib/libcrypto/ebcdic.c b/lib/libcrypto/ebcdic.c
deleted file mode 100644
index 2ac26abc725..00000000000
--- a/lib/libcrypto/ebcdic.c
+++ /dev/null
@@ -1,221 +0,0 @@
-/* crypto/ebcdic.c */
-
-#ifndef CHARSET_EBCDIC
-
-#include <openssl/e_os2.h>
-#if defined(PEDANTIC) || defined(__DECC) || defined(OPENSSL_SYS_MACOSX)
-static void *dummy = &dummy;
-#endif
-
-#else /*CHARSET_EBCDIC*/
-
-#include "ebcdic.h"
-/* Initial Port for Apache-1.3 by <Martin.Kraemer@Mch.SNI.De>
- * Adapted for OpenSSL-0.9.4 by <Martin.Kraemer@Mch.SNI.De>
- */
-
-#ifdef _OSD_POSIX
-/*
- "BS2000 OSD" is a POSIX subsystem on a main frame.
- It is made by Siemens AG, Germany, for their BS2000 mainframe machines.
- Within the POSIX subsystem, the same character set was chosen as in
- "native BS2000", namely EBCDIC. (EDF04)
-
- The name "ASCII" in these routines is misleading: actually, conversion
- is not between EBCDIC and ASCII, but EBCDIC(EDF04) and ISO-8859.1;
- that means that (western european) national characters are preserved.
-
- This table is identical to the one used by rsh/rcp/ftp and other POSIX tools.
-*/
-
-/* Here's the bijective ebcdic-to-ascii table: */
-const unsigned char os_toascii[256] = {
-/*00*/ 0x00, 0x01, 0x02, 0x03, 0x85, 0x09, 0x86, 0x7f,
- 0x87, 0x8d, 0x8e, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /*................*/
-/*10*/ 0x10, 0x11, 0x12, 0x13, 0x8f, 0x0a, 0x08, 0x97,
- 0x18, 0x19, 0x9c, 0x9d, 0x1c, 0x1d, 0x1e, 0x1f, /*................*/
-/*20*/ 0x80, 0x81, 0x82, 0x83, 0x84, 0x92, 0x17, 0x1b,
- 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x05, 0x06, 0x07, /*................*/
-/*30*/ 0x90, 0x91, 0x16, 0x93, 0x94, 0x95, 0x96, 0x04,
- 0x98, 0x99, 0x9a, 0x9b, 0x14, 0x15, 0x9e, 0x1a, /*................*/
-/*40*/ 0x20, 0xa0, 0xe2, 0xe4, 0xe0, 0xe1, 0xe3, 0xe5,
- 0xe7, 0xf1, 0x60, 0x2e, 0x3c, 0x28, 0x2b, 0x7c, /* .........`.<(+|*/
-/*50*/ 0x26, 0xe9, 0xea, 0xeb, 0xe8, 0xed, 0xee, 0xef,
- 0xec, 0xdf, 0x21, 0x24, 0x2a, 0x29, 0x3b, 0x9f, /*&.........!$*);.*/
-/*60*/ 0x2d, 0x2f, 0xc2, 0xc4, 0xc0, 0xc1, 0xc3, 0xc5,
- 0xc7, 0xd1, 0x5e, 0x2c, 0x25, 0x5f, 0x3e, 0x3f, /*-/........^,%_>?*/
-/*70*/ 0xf8, 0xc9, 0xca, 0xcb, 0xc8, 0xcd, 0xce, 0xcf,
- 0xcc, 0xa8, 0x3a, 0x23, 0x40, 0x27, 0x3d, 0x22, /*..........:#@'="*/
-/*80*/ 0xd8, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
- 0x68, 0x69, 0xab, 0xbb, 0xf0, 0xfd, 0xfe, 0xb1, /*.abcdefghi......*/
-/*90*/ 0xb0, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70,
- 0x71, 0x72, 0xaa, 0xba, 0xe6, 0xb8, 0xc6, 0xa4, /*.jklmnopqr......*/
-/*a0*/ 0xb5, 0xaf, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
- 0x79, 0x7a, 0xa1, 0xbf, 0xd0, 0xdd, 0xde, 0xae, /*..stuvwxyz......*/
-/*b0*/ 0xa2, 0xa3, 0xa5, 0xb7, 0xa9, 0xa7, 0xb6, 0xbc,
- 0xbd, 0xbe, 0xac, 0x5b, 0x5c, 0x5d, 0xb4, 0xd7, /*...........[\]..*/
-/*c0*/ 0xf9, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
- 0x48, 0x49, 0xad, 0xf4, 0xf6, 0xf2, 0xf3, 0xf5, /*.ABCDEFGHI......*/
-/*d0*/ 0xa6, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50,
- 0x51, 0x52, 0xb9, 0xfb, 0xfc, 0xdb, 0xfa, 0xff, /*.JKLMNOPQR......*/
-/*e0*/ 0xd9, 0xf7, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
- 0x59, 0x5a, 0xb2, 0xd4, 0xd6, 0xd2, 0xd3, 0xd5, /*..STUVWXYZ......*/
-/*f0*/ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
- 0x38, 0x39, 0xb3, 0x7b, 0xdc, 0x7d, 0xda, 0x7e /*0123456789.{.}.~*/
-};
-
-
-/* The ascii-to-ebcdic table: */
-const unsigned char os_toebcdic[256] = {
-/*00*/ 0x00, 0x01, 0x02, 0x03, 0x37, 0x2d, 0x2e, 0x2f,
- 0x16, 0x05, 0x15, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /*................*/
-/*10*/ 0x10, 0x11, 0x12, 0x13, 0x3c, 0x3d, 0x32, 0x26,
- 0x18, 0x19, 0x3f, 0x27, 0x1c, 0x1d, 0x1e, 0x1f, /*................*/
-/*20*/ 0x40, 0x5a, 0x7f, 0x7b, 0x5b, 0x6c, 0x50, 0x7d,
- 0x4d, 0x5d, 0x5c, 0x4e, 0x6b, 0x60, 0x4b, 0x61, /* !"#$%&'()*+,-./ */
-/*30*/ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
- 0xf8, 0xf9, 0x7a, 0x5e, 0x4c, 0x7e, 0x6e, 0x6f, /*0123456789:;<=>?*/
-/*40*/ 0x7c, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
- 0xc8, 0xc9, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, /*@ABCDEFGHIJKLMNO*/
-/*50*/ 0xd7, 0xd8, 0xd9, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6,
- 0xe7, 0xe8, 0xe9, 0xbb, 0xbc, 0xbd, 0x6a, 0x6d, /*PQRSTUVWXYZ[\]^_*/
-/*60*/ 0x4a, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
- 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, /*`abcdefghijklmno*/
-/*70*/ 0x97, 0x98, 0x99, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6,
- 0xa7, 0xa8, 0xa9, 0xfb, 0x4f, 0xfd, 0xff, 0x07, /*pqrstuvwxyz{|}~.*/
-/*80*/ 0x20, 0x21, 0x22, 0x23, 0x24, 0x04, 0x06, 0x08,
- 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x09, 0x0a, 0x14, /*................*/
-/*90*/ 0x30, 0x31, 0x25, 0x33, 0x34, 0x35, 0x36, 0x17,
- 0x38, 0x39, 0x3a, 0x3b, 0x1a, 0x1b, 0x3e, 0x5f, /*................*/
-/*a0*/ 0x41, 0xaa, 0xb0, 0xb1, 0x9f, 0xb2, 0xd0, 0xb5,
- 0x79, 0xb4, 0x9a, 0x8a, 0xba, 0xca, 0xaf, 0xa1, /*................*/
-/*b0*/ 0x90, 0x8f, 0xea, 0xfa, 0xbe, 0xa0, 0xb6, 0xb3,
- 0x9d, 0xda, 0x9b, 0x8b, 0xb7, 0xb8, 0xb9, 0xab, /*................*/
-/*c0*/ 0x64, 0x65, 0x62, 0x66, 0x63, 0x67, 0x9e, 0x68,
- 0x74, 0x71, 0x72, 0x73, 0x78, 0x75, 0x76, 0x77, /*................*/
-/*d0*/ 0xac, 0x69, 0xed, 0xee, 0xeb, 0xef, 0xec, 0xbf,
- 0x80, 0xe0, 0xfe, 0xdd, 0xfc, 0xad, 0xae, 0x59, /*................*/
-/*e0*/ 0x44, 0x45, 0x42, 0x46, 0x43, 0x47, 0x9c, 0x48,
- 0x54, 0x51, 0x52, 0x53, 0x58, 0x55, 0x56, 0x57, /*................*/
-/*f0*/ 0x8c, 0x49, 0xcd, 0xce, 0xcb, 0xcf, 0xcc, 0xe1,
- 0x70, 0xc0, 0xde, 0xdb, 0xdc, 0x8d, 0x8e, 0xdf /*................*/
-};
-
-#else /*_OSD_POSIX*/
-
-/*
-This code does basic character mapping for IBM's TPF and OS/390 operating systems.
-It is a modified version of the BS2000 table.
-
-Bijective EBCDIC (character set IBM-1047) to US-ASCII table:
-This table is bijective - there are no ambigous or duplicate characters.
-*/
-const unsigned char os_toascii[256] = {
- 0x00, 0x01, 0x02, 0x03, 0x85, 0x09, 0x86, 0x7f, /* 00-0f: */
- 0x87, 0x8d, 0x8e, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* ................ */
- 0x10, 0x11, 0x12, 0x13, 0x8f, 0x0a, 0x08, 0x97, /* 10-1f: */
- 0x18, 0x19, 0x9c, 0x9d, 0x1c, 0x1d, 0x1e, 0x1f, /* ................ */
- 0x80, 0x81, 0x82, 0x83, 0x84, 0x92, 0x17, 0x1b, /* 20-2f: */
- 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x05, 0x06, 0x07, /* ................ */
- 0x90, 0x91, 0x16, 0x93, 0x94, 0x95, 0x96, 0x04, /* 30-3f: */
- 0x98, 0x99, 0x9a, 0x9b, 0x14, 0x15, 0x9e, 0x1a, /* ................ */
- 0x20, 0xa0, 0xe2, 0xe4, 0xe0, 0xe1, 0xe3, 0xe5, /* 40-4f: */
- 0xe7, 0xf1, 0xa2, 0x2e, 0x3c, 0x28, 0x2b, 0x7c, /* ...........<(+| */
- 0x26, 0xe9, 0xea, 0xeb, 0xe8, 0xed, 0xee, 0xef, /* 50-5f: */
- 0xec, 0xdf, 0x21, 0x24, 0x2a, 0x29, 0x3b, 0x5e, /* &.........!$*);^ */
- 0x2d, 0x2f, 0xc2, 0xc4, 0xc0, 0xc1, 0xc3, 0xc5, /* 60-6f: */
- 0xc7, 0xd1, 0xa6, 0x2c, 0x25, 0x5f, 0x3e, 0x3f, /* -/.........,%_>? */
- 0xf8, 0xc9, 0xca, 0xcb, 0xc8, 0xcd, 0xce, 0xcf, /* 70-7f: */
- 0xcc, 0x60, 0x3a, 0x23, 0x40, 0x27, 0x3d, 0x22, /* .........`:#@'=" */
- 0xd8, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 80-8f: */
- 0x68, 0x69, 0xab, 0xbb, 0xf0, 0xfd, 0xfe, 0xb1, /* .abcdefghi...... */
- 0xb0, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, /* 90-9f: */
- 0x71, 0x72, 0xaa, 0xba, 0xe6, 0xb8, 0xc6, 0xa4, /* .jklmnopqr...... */
- 0xb5, 0x7e, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, /* a0-af: */
- 0x79, 0x7a, 0xa1, 0xbf, 0xd0, 0x5b, 0xde, 0xae, /* .~stuvwxyz...[.. */
- 0xac, 0xa3, 0xa5, 0xb7, 0xa9, 0xa7, 0xb6, 0xbc, /* b0-bf: */
- 0xbd, 0xbe, 0xdd, 0xa8, 0xaf, 0x5d, 0xb4, 0xd7, /* .............].. */
- 0x7b, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* c0-cf: */
- 0x48, 0x49, 0xad, 0xf4, 0xf6, 0xf2, 0xf3, 0xf5, /* {ABCDEFGHI...... */
- 0x7d, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, /* d0-df: */
- 0x51, 0x52, 0xb9, 0xfb, 0xfc, 0xf9, 0xfa, 0xff, /* }JKLMNOPQR...... */
- 0x5c, 0xf7, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, /* e0-ef: */
- 0x59, 0x5a, 0xb2, 0xd4, 0xd6, 0xd2, 0xd3, 0xd5, /* \.STUVWXYZ...... */
- 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* f0-ff: */
- 0x38, 0x39, 0xb3, 0xdb, 0xdc, 0xd9, 0xda, 0x9f /* 0123456789...... */
-};
-
-
-/*
-The US-ASCII to EBCDIC (character set IBM-1047) table:
-This table is bijective (no ambiguous or duplicate characters)
-*/
-const unsigned char os_toebcdic[256] = {
- 0x00, 0x01, 0x02, 0x03, 0x37, 0x2d, 0x2e, 0x2f, /* 00-0f: */
- 0x16, 0x05, 0x15, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* ................ */
- 0x10, 0x11, 0x12, 0x13, 0x3c, 0x3d, 0x32, 0x26, /* 10-1f: */
- 0x18, 0x19, 0x3f, 0x27, 0x1c, 0x1d, 0x1e, 0x1f, /* ................ */
- 0x40, 0x5a, 0x7f, 0x7b, 0x5b, 0x6c, 0x50, 0x7d, /* 20-2f: */
- 0x4d, 0x5d, 0x5c, 0x4e, 0x6b, 0x60, 0x4b, 0x61, /* !"#$%&'()*+,-./ */
- 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 30-3f: */
- 0xf8, 0xf9, 0x7a, 0x5e, 0x4c, 0x7e, 0x6e, 0x6f, /* 0123456789:;<=>? */
- 0x7c, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 40-4f: */
- 0xc8, 0xc9, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, /* @ABCDEFGHIJKLMNO */
- 0xd7, 0xd8, 0xd9, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, /* 50-5f: */
- 0xe7, 0xe8, 0xe9, 0xad, 0xe0, 0xbd, 0x5f, 0x6d, /* PQRSTUVWXYZ[\]^_ */
- 0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 60-6f: */
- 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, /* `abcdefghijklmno */
- 0x97, 0x98, 0x99, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, /* 70-7f: */
- 0xa7, 0xa8, 0xa9, 0xc0, 0x4f, 0xd0, 0xa1, 0x07, /* pqrstuvwxyz{|}~. */
- 0x20, 0x21, 0x22, 0x23, 0x24, 0x04, 0x06, 0x08, /* 80-8f: */
- 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x09, 0x0a, 0x14, /* ................ */
- 0x30, 0x31, 0x25, 0x33, 0x34, 0x35, 0x36, 0x17, /* 90-9f: */
- 0x38, 0x39, 0x3a, 0x3b, 0x1a, 0x1b, 0x3e, 0xff, /* ................ */
- 0x41, 0xaa, 0x4a, 0xb1, 0x9f, 0xb2, 0x6a, 0xb5, /* a0-af: */
- 0xbb, 0xb4, 0x9a, 0x8a, 0xb0, 0xca, 0xaf, 0xbc, /* ................ */
- 0x90, 0x8f, 0xea, 0xfa, 0xbe, 0xa0, 0xb6, 0xb3, /* b0-bf: */
- 0x9d, 0xda, 0x9b, 0x8b, 0xb7, 0xb8, 0xb9, 0xab, /* ................ */
- 0x64, 0x65, 0x62, 0x66, 0x63, 0x67, 0x9e, 0x68, /* c0-cf: */
- 0x74, 0x71, 0x72, 0x73, 0x78, 0x75, 0x76, 0x77, /* ................ */
- 0xac, 0x69, 0xed, 0xee, 0xeb, 0xef, 0xec, 0xbf, /* d0-df: */
- 0x80, 0xfd, 0xfe, 0xfb, 0xfc, 0xba, 0xae, 0x59, /* ................ */
- 0x44, 0x45, 0x42, 0x46, 0x43, 0x47, 0x9c, 0x48, /* e0-ef: */
- 0x54, 0x51, 0x52, 0x53, 0x58, 0x55, 0x56, 0x57, /* ................ */
- 0x8c, 0x49, 0xcd, 0xce, 0xcb, 0xcf, 0xcc, 0xe1, /* f0-ff: */
- 0x70, 0xdd, 0xde, 0xdb, 0xdc, 0x8d, 0x8e, 0xdf /* ................ */
-};
-#endif /*_OSD_POSIX*/
-
-/* Translate a memory block from EBCDIC (host charset) to ASCII (net charset)
- * dest and srce may be identical, or separate memory blocks, but
- * should not overlap. These functions intentionally have an interface
- * compatible to memcpy(3).
- */
-
-void *
-ebcdic2ascii(void *dest, const void *srce, size_t count)
-{
- unsigned char *udest = dest;
- const unsigned char *usrce = srce;
-
- while (count-- != 0) {
- *udest++ = os_toascii[*usrce++];
- }
-
- return dest;
-}
-
-void *
-ascii2ebcdic(void *dest, const void *srce, size_t count)
-{
- unsigned char *udest = dest;
- const unsigned char *usrce = srce;
-
- while (count-- != 0) {
- *udest++ = os_toebcdic[*usrce++];
- }
-
- return dest;
-}
-
-#endif
diff --git a/lib/libcrypto/ebcdic.h b/lib/libcrypto/ebcdic.h
deleted file mode 100644
index 6d65afcf9e7..00000000000
--- a/lib/libcrypto/ebcdic.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/* crypto/ebcdic.h */
-
-#ifndef HEADER_EBCDIC_H
-#define HEADER_EBCDIC_H
-
-#include <sys/types.h>
-
-/* Avoid name clashes with other applications */
-#define os_toascii _openssl_os_toascii
-#define os_toebcdic _openssl_os_toebcdic
-#define ebcdic2ascii _openssl_ebcdic2ascii
-#define ascii2ebcdic _openssl_ascii2ebcdic
-
-extern const unsigned char os_toascii[256];
-extern const unsigned char os_toebcdic[256];
-void *ebcdic2ascii(void *dest, const void *srce, size_t count);
-void *ascii2ebcdic(void *dest, const void *srce, size_t count);
-
-#endif
diff --git a/lib/libcrypto/evp/encode.c b/lib/libcrypto/evp/encode.c
index 28546a84bc2..7af9a2780b3 100644
--- a/lib/libcrypto/evp/encode.c
+++ b/lib/libcrypto/evp/encode.c
@@ -60,19 +60,8 @@
#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
diff --git a/lib/libcrypto/hmac/hmactest.c b/lib/libcrypto/hmac/hmactest.c
index 1b906b81afb..282e06e53e2 100644
--- a/lib/libcrypto/hmac/hmactest.c
+++ b/lib/libcrypto/hmac/hmactest.c
@@ -74,9 +74,6 @@ int main(int argc, char *argv[])
#include <openssl/md5.h>
#endif
-#ifdef CHARSET_EBCDIC
-#include <openssl/ebcdic.h>
-#endif
#ifndef OPENSSL_NO_MD5
static struct test_st
@@ -132,14 +129,6 @@ int main(int argc, char *argv[])
#ifdef OPENSSL_NO_MD5
printf("test skipped: MD5 disabled\n");
#else
-
-#ifdef CHARSET_EBCDIC
- ebcdic2ascii(test[0].data, test[0].data, test[0].data_len);
- ebcdic2ascii(test[1].data, test[1].data, test[1].data_len);
- ebcdic2ascii(test[2].key, test[2].key, test[2].key_len);
- ebcdic2ascii(test[2].data, test[2].data, test[2].data_len);
-#endif
-
for (i=0; i<4; i++)
{
p=pt(HMAC(EVP_md5(),
diff --git a/lib/libcrypto/md2/md2_one.c b/lib/libcrypto/md2/md2_one.c
index f7fef5cc0a7..cb8594e0857 100644
--- a/lib/libcrypto/md2/md2_one.c
+++ b/lib/libcrypto/md2/md2_one.c
@@ -71,23 +71,7 @@ unsigned char *MD2(const unsigned char *d, size_t n, unsigned char *md)
if (md == NULL) md=m;
if (!MD2_Init(&c))
return NULL;
-#ifndef CHARSET_EBCDIC
MD2_Update(&c,d,n);
-#else
- {
- char temp[1024];
- unsigned long chunk;
-
- while (n > 0)
- {
- chunk = (n > sizeof(temp)) ? sizeof(temp) : n;
- ebcdic2ascii(temp, d, chunk);
- MD2_Update(&c,temp,chunk);
- n -= chunk;
- d += chunk;
- }
- }
-#endif
MD2_Final(md,&c);
OPENSSL_cleanse(&c,sizeof(c)); /* Security consideration */
return(md);
diff --git a/lib/libcrypto/md2/md2test.c b/lib/libcrypto/md2/md2test.c
index db5f5bc6d20..01952140364 100644
--- a/lib/libcrypto/md2/md2test.c
+++ b/lib/libcrypto/md2/md2test.c
@@ -72,10 +72,6 @@ int main(int argc, char *argv[])
#include <openssl/evp.h>
#include <openssl/md2.h>
-#ifdef CHARSET_EBCDIC
-#include <openssl/ebcdic.h>
-#endif
-
static char *test[]={
"",
"a",
diff --git a/lib/libcrypto/md4/md4_one.c b/lib/libcrypto/md4/md4_one.c
index bb643626381..ed6ce33650e 100644
--- a/lib/libcrypto/md4/md4_one.c
+++ b/lib/libcrypto/md4/md4_one.c
@@ -61,10 +61,6 @@
#include <openssl/md4.h>
#include <openssl/crypto.h>
-#ifdef CHARSET_EBCDIC
-#include <openssl/ebcdic.h>
-#endif
-
unsigned char *MD4(const unsigned char *d, size_t n, unsigned char *md)
{
MD4_CTX c;
@@ -73,23 +69,7 @@ unsigned char *MD4(const unsigned char *d, size_t n, unsigned char *md)
if (md == NULL) md=m;
if (!MD4_Init(&c))
return NULL;
-#ifndef CHARSET_EBCDIC
MD4_Update(&c,d,n);
-#else
- {
- char temp[1024];
- unsigned long chunk;
-
- while (n > 0)
- {
- chunk = (n > sizeof(temp)) ? sizeof(temp) : n;
- ebcdic2ascii(temp, d, chunk);
- MD4_Update(&c,temp,chunk);
- n -= chunk;
- d += chunk;
- }
- }
-#endif
MD4_Final(md,&c);
OPENSSL_cleanse(&c,sizeof(c)); /* security consideration */
return(md);
diff --git a/lib/libcrypto/md5/md5_one.c b/lib/libcrypto/md5/md5_one.c
index 43fee893796..839e27e9726 100644
--- a/lib/libcrypto/md5/md5_one.c
+++ b/lib/libcrypto/md5/md5_one.c
@@ -61,10 +61,6 @@
#include <openssl/md5.h>
#include <openssl/crypto.h>
-#ifdef CHARSET_EBCDIC
-#include <openssl/ebcdic.h>
-#endif
-
unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md)
{
MD5_CTX c;
@@ -73,23 +69,7 @@ unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md)
if (md == NULL) md=m;
if (!MD5_Init(&c))
return NULL;
-#ifndef CHARSET_EBCDIC
MD5_Update(&c,d,n);
-#else
- {
- char temp[1024];
- unsigned long chunk;
-
- while (n > 0)
- {
- chunk = (n > sizeof(temp)) ? sizeof(temp) : n;
- ebcdic2ascii(temp, d, chunk);
- MD5_Update(&c,temp,chunk);
- n -= chunk;
- d += chunk;
- }
- }
-#endif
MD5_Final(md,&c);
OPENSSL_cleanse(&c,sizeof(c)); /* security consideration */
return(md);
diff --git a/lib/libcrypto/mdc2/mdc2test.c b/lib/libcrypto/mdc2/mdc2test.c
index c9abe99d928..cf8f65cf275 100644
--- a/lib/libcrypto/mdc2/mdc2test.c
+++ b/lib/libcrypto/mdc2/mdc2test.c
@@ -76,10 +76,6 @@ int main(int argc, char *argv[])
#include <openssl/evp.h>
#include <openssl/mdc2.h>
-#ifdef CHARSET_EBCDIC
-#include <openssl/ebcdic.h>
-#endif
-
static unsigned char pad1[16]={
0x42,0xE5,0x0C,0xD2,0x24,0xBA,0xCE,0xBA,
0x76,0x0B,0xDD,0x2B,0xD4,0x09,0x28,0x1A
@@ -98,10 +94,6 @@ int main(int argc, char *argv[])
EVP_MD_CTX c;
static char *text="Now is the time for all ";
-#ifdef CHARSET_EBCDIC
- ebcdic2ascii(text,text,strlen(text));
-#endif
-
EVP_MD_CTX_init(&c);
EVP_DigestInit_ex(&c,EVP_mdc2(), NULL);
EVP_DigestUpdate(&c,(unsigned char *)text,strlen(text));
@@ -140,6 +132,9 @@ int main(int argc, char *argv[])
printf("pad2 - ok\n");
EVP_MD_CTX_cleanup(&c);
+#ifdef OPENSSL_SYS_NETWARE
+ if (ret) printf("ERROR: %d\n", ret);
+#endif
EXIT(ret);
return(ret);
}
diff --git a/lib/libcrypto/objects/obj_dat.c b/lib/libcrypto/objects/obj_dat.c
index a597284c808..bced796e624 100644
--- a/lib/libcrypto/objects/obj_dat.c
+++ b/lib/libcrypto/objects/obj_dat.c
@@ -705,22 +705,6 @@ const void *OBJ_bsearch_ex_(const void *key, const void *base_, int num,
else
break;
}
-#ifdef CHARSET_EBCDIC
-/* THIS IS A KLUDGE - Because the *_obj is sorted in ASCII order, and
- * I don't have perl (yet), we revert to a *LINEAR* search
- * when the object wasn't found in the binary search.
- */
- if (c != 0)
- {
- for (i=0; i<num; ++i)
- {
- p= &(base[i*size]);
- c = (*cmp)(key,p);
- if (c == 0 || (c < 0 && (flags & OBJ_BSEARCH_VALUE_ON_NOMATCH)))
- return p;
- }
- }
-#endif
if (c != 0 && !(flags & OBJ_BSEARCH_VALUE_ON_NOMATCH))
p = NULL;
else if (c == 0 && (flags & OBJ_BSEARCH_FIRST_VALUE_ON_MATCH))
diff --git a/lib/libcrypto/pem/pem_lib.c b/lib/libcrypto/pem/pem_lib.c
index 5a421fc4b6a..74baa2ec1cc 100644
--- a/lib/libcrypto/pem/pem_lib.c
+++ b/lib/libcrypto/pem/pem_lib.c
@@ -382,10 +382,6 @@ int PEM_ASN1_write_bio(i2d_of_void *i2d, const char *name, BIO *bp,
PEMerr(PEM_F_PEM_ASN1_WRITE_BIO,PEM_R_READ_KEY);
goto err;
}
-#ifdef CHARSET_EBCDIC
- /* Convert the pass phrase from EBCDIC */
- ebcdic2ascii(buf, buf, klen);
-#endif
kstr=(unsigned char *)buf;
}
RAND_add(data,i,0);/* put in the RSA key. */
@@ -458,11 +454,6 @@ int PEM_do_header(EVP_CIPHER_INFO *cipher, unsigned char *data, long *plen,
PEMerr(PEM_F_PEM_DO_HEADER,PEM_R_BAD_PASSWORD_READ);
return(0);
}
-#ifdef CHARSET_EBCDIC
- /* Convert the pass phrase from EBCDIC */
- ebcdic2ascii(buf, buf, klen);
-#endif
-
if (!EVP_BytesToKey(cipher->cipher,EVP_md5(),&(cipher->iv[0]),
(unsigned char *)buf,klen,1,key,NULL))
return 0;
@@ -516,15 +507,9 @@ int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher)
for (;;)
{
c= *header;
-#ifndef CHARSET_EBCDIC
if (!( ((c >= 'A') && (c <= 'Z')) || (c == '-') ||
((c >= '0') && (c <= '9'))))
break;
-#else
- if (!( isupper(c) || (c == '-') ||
- isdigit(c)))
- break;
-#endif
header++;
}
*header='\0';
diff --git a/lib/libcrypto/ripemd/rmdtest.c b/lib/libcrypto/ripemd/rmdtest.c
index fb34e0e836c..b32fda96ed9 100644
--- a/lib/libcrypto/ripemd/rmdtest.c
+++ b/lib/libcrypto/ripemd/rmdtest.c
@@ -72,10 +72,6 @@ int main(int argc, char *argv[])
#include <openssl/ripemd.h>
#include <openssl/evp.h>
-#ifdef CHARSET_EBCDIC
-#include <openssl/ebcdic.h>
-#endif
-
static char *test[]={
"",
"a",
@@ -112,9 +108,6 @@ int main(int argc, char *argv[])
i=1;
while (*P != NULL)
{
-#ifdef CHARSET_EBCDIC
- ebcdic2ascii((char *)*P, (char *)*P, strlen((char *)*P));
-#endif
EVP_Digest(&(P[0][0]),strlen((char *)*P),md,NULL,EVP_ripemd160(), NULL);
p=pt(md);
if (strcmp(p,(char *)*R) != 0)
diff --git a/lib/libcrypto/sha/sha1test.c b/lib/libcrypto/sha/sha1test.c
index 6feb3964c75..ad9e3dc407e 100644
--- a/lib/libcrypto/sha/sha1test.c
+++ b/lib/libcrypto/sha/sha1test.c
@@ -72,10 +72,6 @@ int main(int argc, char *argv[])
#include <openssl/evp.h>
#include <openssl/sha.h>
-#ifdef CHARSET_EBCDIC
-#include <openssl/ebcdic.h>
-#endif
-
#undef SHA_0 /* FIPS 180 */
#define SHA_1 /* FIPS 180-1 */
@@ -112,11 +108,6 @@ int main(int argc, char *argv[])
EVP_MD_CTX c;
unsigned char md[SHA_DIGEST_LENGTH];
-#ifdef CHARSET_EBCDIC
- ebcdic2ascii(test[0], test[0], strlen(test[0]));
- ebcdic2ascii(test[1], test[1], strlen(test[1]));
-#endif
-
EVP_MD_CTX_init(&c);
P=test;
R=ret;
@@ -139,9 +130,6 @@ int main(int argc, char *argv[])
}
memset(buf,'a',1000);
-#ifdef CHARSET_EBCDIC
- ebcdic2ascii(buf, buf, 1000);
-#endif /*CHARSET_EBCDIC*/
EVP_DigestInit_ex(&c,EVP_sha1(), NULL);
for (i=0; i<1000; i++)
EVP_DigestUpdate(&c,buf,1000);
diff --git a/lib/libcrypto/sha/shatest.c b/lib/libcrypto/sha/shatest.c
index 27614646d15..6c93c395903 100644
--- a/lib/libcrypto/sha/shatest.c
+++ b/lib/libcrypto/sha/shatest.c
@@ -72,10 +72,6 @@ int main(int argc, char *argv[])
#include <openssl/evp.h>
#include <openssl/sha.h>
-#ifdef CHARSET_EBCDIC
-#include <openssl/ebcdic.h>
-#endif
-
#define SHA_0 /* FIPS 180 */
#undef SHA_1 /* FIPS 180-1 */
@@ -112,11 +108,6 @@ int main(int argc, char *argv[])
EVP_MD_CTX c;
unsigned char md[SHA_DIGEST_LENGTH];
-#ifdef CHARSET_EBCDIC
- ebcdic2ascii(test[0], test[0], strlen(test[0]));
- ebcdic2ascii(test[1], test[1], strlen(test[1]));
-#endif
-
EVP_MD_CTX_init(&c);
P=test;
R=ret;
@@ -139,9 +130,6 @@ int main(int argc, char *argv[])
}
memset(buf,'a',1000);
-#ifdef CHARSET_EBCDIC
- ebcdic2ascii(buf, buf, 1000);
-#endif /*CHARSET_EBCDIC*/
EVP_DigestInit_ex(&c,EVP_sha(), NULL);
for (i=0; i<1000; i++)
EVP_DigestUpdate(&c,buf,1000);
diff --git a/lib/libcrypto/x509/x509_obj.c b/lib/libcrypto/x509/x509_obj.c
index 21fed9f838d..bcc1e7429eb 100644
--- a/lib/libcrypto/x509/x509_obj.c
+++ b/lib/libcrypto/x509/x509_obj.c
@@ -75,9 +75,6 @@ int i;
static const char hex[17]="0123456789ABCDEF";
int gs_doit[4];
char tmp_buf[80];
-#ifdef CHARSET_EBCDIC
- char ebcdic_buf[1024];
-#endif
if (buf == NULL)
{
@@ -114,20 +111,6 @@ int i;
type=ne->value->type;
num=ne->value->length;
q=ne->value->data;
-#ifdef CHARSET_EBCDIC
- if (type == V_ASN1_GENERALSTRING ||
- type == V_ASN1_VISIBLESTRING ||
- type == V_ASN1_PRINTABLESTRING ||
- type == V_ASN1_TELETEXSTRING ||
- type == V_ASN1_VISIBLESTRING ||
- type == V_ASN1_IA5STRING) {
- ascii2ebcdic(ebcdic_buf, q,
- (num > sizeof ebcdic_buf)
- ? sizeof ebcdic_buf : num);
- q=ebcdic_buf;
- }
-#endif
-
if ((type == V_ASN1_GENERALSTRING) && ((num%4) == 0))
{
gs_doit[0]=gs_doit[1]=gs_doit[2]=gs_doit[3]=0;
@@ -149,12 +132,7 @@ int i;
{
if (!gs_doit[j&3]) continue;
l2++;
-#ifndef CHARSET_EBCDIC
if ((q[j] < ' ') || (q[j] > '~')) l2+=3;
-#else
- if ((os_toascii[q[j]] < os_toascii[' ']) ||
- (os_toascii[q[j]] > os_toascii['~'])) l2+=3;
-#endif
}
lold=l;
@@ -173,15 +151,10 @@ int i;
*(p++)='/';
memcpy(p,s,(unsigned int)l1); p+=l1;
*(p++)='=';
-
-#ifndef CHARSET_EBCDIC /* q was assigned above already. */
q=ne->value->data;
-#endif
-
for (j=0; j<num; j++)
{
if (!gs_doit[j&3]) continue;
-#ifndef CHARSET_EBCDIC
n=q[j];
if ((n < ' ') || (n > '~'))
{
@@ -192,19 +165,6 @@ int i;
}
else
*(p++)=n;
-#else
- n=os_toascii[q[j]];
- if ((n < os_toascii[' ']) ||
- (n > os_toascii['~']))
- {
- *(p++)='\\';
- *(p++)='x';
- *(p++)=hex[(n>>4)&0x0f];
- *(p++)=hex[n&0x0f];
- }
- else
- *(p++)=q[j];
-#endif
}
*p='\0';
}
diff --git a/lib/libcrypto/x509v3/v3_ia5.c b/lib/libcrypto/x509v3/v3_ia5.c
index 4ff12b52b54..ab1c5188b8f 100644
--- a/lib/libcrypto/x509v3/v3_ia5.c
+++ b/lib/libcrypto/x509v3/v3_ia5.c
@@ -105,9 +105,6 @@ 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/lib/libcrypto/x509v3/v3_prn.c b/lib/libcrypto/x509v3/v3_prn.c
index 31462187081..2124b447b4f 100644
--- a/lib/libcrypto/x509v3/v3_prn.c
+++ b/lib/libcrypto/x509v3/v3_prn.c
@@ -83,22 +83,7 @@ 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 {
- int len;
- char *tmp;
- len = strlen(nval->value)+1;
- tmp = OPENSSL_malloc(len);
- if (tmp)
- {
- ascii2ebcdic(tmp, nval->value, len);
- BIO_printf(out, "%s:%s", nval->name, tmp);
- OPENSSL_free(tmp);
- }
- }
-#endif
if(ml) BIO_puts(out, "\n");
}
}
@@ -127,22 +112,7 @@ int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, unsigned long flag, int inde
ok = 0;
goto err;
}
-#ifndef CHARSET_EBCDIC
BIO_printf(out, "%*s%s", indent, "", value);
-#else
- {
- int len;
- char *tmp;
- len = strlen(value)+1;
- tmp = OPENSSL_malloc(len);
- if (tmp)
- {
- ascii2ebcdic(tmp, value, len);
- BIO_printf(out, "%*s%s", indent, "", tmp);
- OPENSSL_free(tmp);
- }
- }
-#endif
} else if(method->i2v) {
if(!(nval = method->i2v(method, ext_str, NULL))) {
ok = 0;
diff --git a/lib/libcrypto/x509v3/v3_utl.c b/lib/libcrypto/x509v3/v3_utl.c
index e0302345400..c4b6143eff1 100644
--- a/lib/libcrypto/x509v3/v3_utl.c
+++ b/lib/libcrypto/x509v3/v3_utl.c
@@ -378,10 +378,6 @@ char *hex_to_string(const unsigned char *buffer, long len)
*q++ = ':';
}
q[-1] = 0;
-#ifdef CHARSET_EBCDIC
- ebcdic2ascii(tmp, tmp, q - tmp - 1);
-#endif
-
return tmp;
}
@@ -400,14 +396,8 @@ unsigned char *string_to_hex(const char *str, long *len)
if(!(hexbuf = OPENSSL_malloc(strlen(str) >> 1))) goto err;
for(p = (unsigned char *)str, q = hexbuf; *p;) {
ch = *p++;
-#ifdef CHARSET_EBCDIC
- ch = os_toebcdic[ch];
-#endif
if(ch == ':') continue;
cl = *p++;
-#ifdef CHARSET_EBCDIC
- cl = os_toebcdic[cl];
-#endif
if(!cl) {
X509V3err(X509V3_F_STRING_TO_HEX,X509V3_R_ODD_NUMBER_OF_DIGITS);
OPENSSL_free(hexbuf);
@@ -844,21 +834,13 @@ int X509V3_NAME_from_section(X509_NAME *nm, STACK_OF(CONF_VALUE)*dn_sk,
* multiple instances
*/
for(p = type; *p ; p++)
-#ifndef CHARSET_EBCDIC
if ((*p == ':') || (*p == ',') || (*p == '.'))
-#else
- if ((*p == os_toascii[':']) || (*p == os_toascii[',']) || (*p == os_toascii['.']))
-#endif
{
p++;
if(*p) type = p;
break;
}
-#ifndef CHARSET_EBCDIC
if (*type == '+')
-#else
- if (*type == os_toascii['+'])
-#endif
{
mval = -1;
type++;
diff --git a/lib/libssl/ssl_ciph.c b/lib/libssl/ssl_ciph.c
index 0e24e0a5c69..ed2e78bdcc9 100644
--- a/lib/libssl/ssl_ciph.c
+++ b/lib/libssl/ssl_ciph.c
@@ -1130,14 +1130,10 @@ const SSL_CIPHER **ca_list)
ch = *l;
buf = l;
buflen = 0;
-#ifndef CHARSET_EBCDIC
while (((ch >= 'A') && (ch <= 'Z')) ||
((ch >= '0') && (ch <= '9')) ||
((ch >= 'a') && (ch <= 'z')) ||
(ch == '-') || (ch == '.'))
-#else
- while (isalnum(ch) || (ch == '-') || (ch == '.'))
-#endif
{
ch = *(++l);
buflen++;
diff --git a/lib/libssl/tls1.h b/lib/libssl/tls1.h
index 95d6660ac32..43879f82af6 100644
--- a/lib/libssl/tls1.h
+++ b/lib/libssl/tls1.h
@@ -699,25 +699,6 @@ SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb)
#define TLS_MD_MASTER_SECRET_CONST "master secret"
#define TLS_MD_MASTER_SECRET_CONST_SIZE 13
-#ifdef CHARSET_EBCDIC
-#undef TLS_MD_CLIENT_FINISH_CONST
-#define TLS_MD_CLIENT_FINISH_CONST "\x63\x6c\x69\x65\x6e\x74\x20\x66\x69\x6e\x69\x73\x68\x65\x64" /*client finished*/
-#undef TLS_MD_SERVER_FINISH_CONST
-#define TLS_MD_SERVER_FINISH_CONST "\x73\x65\x72\x76\x65\x72\x20\x66\x69\x6e\x69\x73\x68\x65\x64" /*server finished*/
-#undef TLS_MD_SERVER_WRITE_KEY_CONST
-#define TLS_MD_SERVER_WRITE_KEY_CONST "\x73\x65\x72\x76\x65\x72\x20\x77\x72\x69\x74\x65\x20\x6b\x65\x79" /*server write key*/
-#undef TLS_MD_KEY_EXPANSION_CONST
-#define TLS_MD_KEY_EXPANSION_CONST "\x6b\x65\x79\x20\x65\x78\x70\x61\x6e\x73\x69\x6f\x6e" /*key expansion*/
-#undef TLS_MD_CLIENT_WRITE_KEY_CONST
-#define TLS_MD_CLIENT_WRITE_KEY_CONST "\x63\x6c\x69\x65\x6e\x74\x20\x77\x72\x69\x74\x65\x20\x6b\x65\x79" /*client write key*/
-#undef TLS_MD_SERVER_WRITE_KEY_CONST
-#define TLS_MD_SERVER_WRITE_KEY_CONST "\x73\x65\x72\x76\x65\x72\x20\x77\x72\x69\x74\x65\x20\x6b\x65\x79" /*server write key*/
-#undef TLS_MD_IV_BLOCK_CONST
-#define TLS_MD_IV_BLOCK_CONST "\x49\x56\x20\x62\x6c\x6f\x63\x6b" /*IV block*/
-#undef TLS_MD_MASTER_SECRET_CONST
-#define TLS_MD_MASTER_SECRET_CONST "\x6d\x61\x73\x74\x65\x72\x20\x73\x65\x63\x72\x65\x74" /*master secret*/
-#endif
-
/* TLS Session Ticket extension struct */
struct tls_session_ticket_ext_st {
unsigned short length;