From c9414ed70ec89926c1041a64ee4b2f3ef36c90f6 Mon Sep 17 00:00:00 2001 From: beck <> Date: Tue, 15 Apr 2014 17:46:17 +0000 Subject: Send the rotIBM stream cipher (ebcdic) to Valhalla to party for eternity with the bearded ones... some API's that nobody should be using will dissapear with this commit. --- src/lib/libcrypto/Attic/Makefile | 6 +- src/lib/libcrypto/asn1/a_gentm.c | 18 --- src/lib/libcrypto/asn1/a_mbstr.c | 7 - src/lib/libcrypto/asn1/a_print.c | 8 - src/lib/libcrypto/asn1/a_time.c | 15 -- src/lib/libcrypto/asn1/a_utctm.c | 18 --- src/lib/libcrypto/asn1/f_int.c | 9 -- src/lib/libcrypto/asn1/f_string.c | 9 -- src/lib/libcrypto/asn1/t_x509.c | 10 -- src/lib/libcrypto/bf/bftest.c | 11 -- src/lib/libcrypto/bio/b_dump.c | 6 - src/lib/libcrypto/conf/conf_def.h | 17 --- src/lib/libcrypto/conf/keysets.pl | 16 -- src/lib/libcrypto/crypto.h | 4 - src/lib/libcrypto/crypto/Makefile | 5 +- src/lib/libcrypto/des/fcrypt.c | 46 ------ src/lib/libcrypto/ebcdic.c | 221 ---------------------------- src/lib/libcrypto/ebcdic.h | 19 --- src/lib/libcrypto/evp/encode.c | 11 -- src/lib/libcrypto/hmac/hmactest.c | 11 -- src/lib/libcrypto/md2/md2_one.c | 16 -- src/lib/libcrypto/md2/md2test.c | 4 - src/lib/libcrypto/md4/md4_one.c | 20 --- src/lib/libcrypto/md5/md5_one.c | 20 --- src/lib/libcrypto/mdc2/mdc2test.c | 8 - src/lib/libcrypto/objects/obj_dat.c | 16 -- src/lib/libcrypto/pem/pem_lib.c | 15 -- src/lib/libcrypto/ripemd/rmdtest.c | 7 - src/lib/libcrypto/sha/sha1test.c | 12 -- src/lib/libcrypto/sha/shatest.c | 12 -- src/lib/libcrypto/x509/x509_obj.c | 40 ----- src/lib/libcrypto/x509v3/v3_ia5.c | 3 - src/lib/libcrypto/x509v3/v3_prn.c | 30 ---- src/lib/libcrypto/x509v3/v3_utl.c | 18 --- src/lib/libssl/src/apps/passwd.c | 6 +- src/lib/libssl/src/apps/req.c | 14 -- src/lib/libssl/src/apps/s_client.c | 6 - src/lib/libssl/src/apps/s_server.c | 159 -------------------- src/lib/libssl/src/crypto/Makefile | 6 +- src/lib/libssl/src/crypto/asn1/a_gentm.c | 18 --- src/lib/libssl/src/crypto/asn1/a_mbstr.c | 7 - src/lib/libssl/src/crypto/asn1/a_print.c | 8 - src/lib/libssl/src/crypto/asn1/a_time.c | 15 -- src/lib/libssl/src/crypto/asn1/a_utctm.c | 18 --- src/lib/libssl/src/crypto/asn1/f_int.c | 9 -- src/lib/libssl/src/crypto/asn1/f_string.c | 9 -- src/lib/libssl/src/crypto/asn1/t_x509.c | 10 -- src/lib/libssl/src/crypto/bf/bftest.c | 11 -- src/lib/libssl/src/crypto/bio/b_dump.c | 6 - src/lib/libssl/src/crypto/conf/conf_def.h | 17 --- src/lib/libssl/src/crypto/conf/keysets.pl | 16 -- src/lib/libssl/src/crypto/crypto.h | 4 - src/lib/libssl/src/crypto/des/fcrypt.c | 46 ------ src/lib/libssl/src/crypto/ebcdic.c | 221 ---------------------------- src/lib/libssl/src/crypto/ebcdic.h | 19 --- src/lib/libssl/src/crypto/evp/encode.c | 11 -- src/lib/libssl/src/crypto/hmac/hmactest.c | 11 -- src/lib/libssl/src/crypto/md2/md2_one.c | 16 -- src/lib/libssl/src/crypto/md2/md2test.c | 4 - src/lib/libssl/src/crypto/md4/md4_one.c | 20 --- src/lib/libssl/src/crypto/md5/md5_one.c | 20 --- src/lib/libssl/src/crypto/mdc2/mdc2test.c | 8 - src/lib/libssl/src/crypto/objects/obj_dat.c | 16 -- src/lib/libssl/src/crypto/pem/pem_lib.c | 15 -- src/lib/libssl/src/crypto/ripemd/rmdtest.c | 7 - src/lib/libssl/src/crypto/sha/sha1test.c | 12 -- src/lib/libssl/src/crypto/sha/shatest.c | 12 -- src/lib/libssl/src/crypto/x509/x509_obj.c | 40 ----- src/lib/libssl/src/crypto/x509v3/v3_ia5.c | 3 - src/lib/libssl/src/crypto/x509v3/v3_prn.c | 30 ---- src/lib/libssl/src/crypto/x509v3/v3_utl.c | 18 --- src/lib/libssl/src/ssl/s2_lib.c | 4 - src/lib/libssl/src/ssl/s3_enc.c | 9 -- src/lib/libssl/src/ssl/ssl_ciph.c | 4 - src/lib/libssl/src/ssl/tls1.h | 19 --- src/lib/libssl/ssl_ciph.c | 4 - src/lib/libssl/tls1.h | 19 --- 77 files changed, 9 insertions(+), 1606 deletions(-) delete mode 100644 src/lib/libcrypto/ebcdic.c delete mode 100644 src/lib/libcrypto/ebcdic.h delete mode 100644 src/lib/libssl/src/crypto/ebcdic.c delete mode 100644 src/lib/libssl/src/crypto/ebcdic.h (limited to 'src/lib') diff --git a/src/lib/libcrypto/Attic/Makefile b/src/lib/libcrypto/Attic/Makefile index aa105e37a2..326915d520 100644 --- a/src/lib/libcrypto/Attic/Makefile +++ b/src/lib/libcrypto/Attic/Makefile @@ -35,13 +35,13 @@ GENERAL=Makefile README crypto-lib.com install.com LIB= $(TOP)/libcrypto.a SHARED_LIB= libcrypto$(SHLIB_EXT) LIBSRC= cryptlib.c mem.c mem_clr.c mem_dbg.c cversion.c ex_data.c cpt_err.c \ - ebcdic.c uid.c o_time.c o_str.c o_dir.c o_fips.c o_init.c fips_ers.c -LIBOBJ= cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o cpt_err.o ebcdic.o \ + uid.c o_time.c o_str.c o_dir.c o_fips.c o_init.c fips_ers.c +LIBOBJ= cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o cpt_err.o \ uid.o o_time.o o_str.o o_dir.o o_fips.o o_init.o fips_ers.o $(CPUID_OBJ) SRC= $(LIBSRC) -EXHEADER= crypto.h opensslv.h opensslconf.h ebcdic.h symhacks.h \ +EXHEADER= crypto.h opensslv.h opensslconf.h symhacks.h \ ossl_typ.h HEADER= cryptlib.h buildinf.h md32_common.h o_time.h o_str.h o_dir.h $(EXHEADER) diff --git a/src/lib/libcrypto/asn1/a_gentm.c b/src/lib/libcrypto/asn1/a_gentm.c index 04266e790a..4f312ee6c9 100644 --- a/src/lib/libcrypto/asn1/a_gentm.c +++ b/src/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/src/lib/libcrypto/asn1/a_mbstr.c b/src/lib/libcrypto/asn1/a_mbstr.c index 264d8f677f..dc953c8325 100644 --- a/src/lib/libcrypto/asn1/a_mbstr.c +++ b/src/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/src/lib/libcrypto/asn1/a_print.c b/src/lib/libcrypto/asn1/a_print.c index d18e772320..9eec5034e1 100644 --- a/src/lib/libcrypto/asn1/a_print.c +++ b/src/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/src/lib/libcrypto/asn1/a_time.c b/src/lib/libcrypto/asn1/a_time.c index e2eb9b243e..4ade88f065 100644 --- a/src/lib/libcrypto/asn1/a_time.c +++ b/src/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/src/lib/libcrypto/asn1/a_utctm.c b/src/lib/libcrypto/asn1/a_utctm.c index 615395b738..f2e7de16af 100644 --- a/src/lib/libcrypto/asn1/a_utctm.c +++ b/src/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/src/lib/libcrypto/asn1/f_int.c b/src/lib/libcrypto/asn1/f_int.c index 9494e597ab..8b92fad9df 100644 --- a/src/lib/libcrypto/asn1/f_int.c +++ b/src/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= '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/src/lib/libcrypto/asn1/f_string.c b/src/lib/libcrypto/asn1/f_string.c index 968698a798..f7d36adac7 100644 --- a/src/lib/libcrypto/asn1/f_string.c +++ b/src/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/src/lib/libcrypto/asn1/t_x509.c b/src/lib/libcrypto/asn1/t_x509.c index edbb39a02f..bbf00c7a29 100644 --- a/src/lib/libcrypto/asn1/t_x509.c +++ b/src/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/src/lib/libcrypto/bf/bftest.c b/src/lib/libcrypto/bf/bftest.c index 97e6634d37..20caf0f3f8 100644 --- a/src/lib/libcrypto/bf/bftest.c +++ b/src/lib/libcrypto/bf/bftest.c @@ -75,10 +75,6 @@ int main(int argc, char *argv[]) #else #include -#ifdef CHARSET_EBCDIC -#include -#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/src/lib/libcrypto/bio/b_dump.c b/src/lib/libcrypto/bio/b_dump.c index bea94969a2..32d523563e 100644 --- a/src/lib/libcrypto/bio/b_dump.c +++ b/src/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/src/lib/libcrypto/conf/conf_def.h b/src/lib/libcrypto/conf/conf_def.h index 92a7d8ad77..b18e6e2728 100644 --- a/src/lib/libcrypto/conf/conf_def.h +++ b/src/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/src/lib/libcrypto/conf/keysets.pl b/src/lib/libcrypto/conf/keysets.pl index 50ed67fa52..fe17be57fe 100644 --- a/src/lib/libcrypto/conf/keysets.pl +++ b/src/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/src/lib/libcrypto/crypto.h b/src/lib/libcrypto/crypto.h index baeba25b99..351ccfd35b 100644 --- a/src/lib/libcrypto/crypto.h +++ b/src/lib/libcrypto/crypto.h @@ -130,10 +130,6 @@ #include #include -#ifdef CHARSET_EBCDIC -#include -#endif - #ifdef __cplusplus extern "C" { #endif diff --git a/src/lib/libcrypto/crypto/Makefile b/src/lib/libcrypto/crypto/Makefile index f07176f829..e3bb0a2b36 100644 --- a/src/lib/libcrypto/crypto/Makefile +++ b/src/lib/libcrypto/crypto/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.7 2014/04/15 17:20:09 beck Exp $ +# $OpenBSD: Makefile,v 1.8 2014/04/15 17:46:16 beck Exp $ LIB= crypto @@ -43,7 +43,7 @@ CFLAGS+= -I${LCRYPTO_SRC}/modes -I${LCRYPTO_SRC}/asn1 -I${LCRYPTO_SRC}/evp # crypto/ SRCS+= cryptlib.c mem.c mem_dbg.c cversion.c ex_data.c cpt_err.c -SRCS+= ebcdic.c uid.c o_time.c o_str.c o_fips.c o_init.c fips_ers.c +SRCS+= uid.c o_time.c o_str.c o_fips.c o_init.c fips_ers.c # aes/ SRCS+= aes_misc.c aes_ecb.c aes_cfb.c aes_ofb.c @@ -369,7 +369,6 @@ HDRS=\ crypto/dh/dh.h \ crypto/dsa/dsa.h \ crypto/dso/dso.h \ - crypto/ebcdic.h \ crypto/ec/ec.h \ crypto/ecdh/ecdh.h \ crypto/ecdsa/ecdsa.h \ diff --git a/src/lib/libcrypto/des/fcrypt.c b/src/lib/libcrypto/des/fcrypt.c index ccbdff250f..d02189b290 100644 --- a/src/lib/libcrypto/des/fcrypt.c +++ b/src/lib/libcrypto/des/fcrypt.c @@ -1,13 +1,5 @@ /* NOCW */ #include -#ifdef _OSD_POSIX -#ifndef CHARSET_EBCDIC -#define CHARSET_EBCDIC 1 -#endif -#endif -#ifdef CHARSET_EBCDIC -#include -#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/src/lib/libcrypto/ebcdic.c b/src/lib/libcrypto/ebcdic.c deleted file mode 100644 index 2ac26abc72..0000000000 --- a/src/lib/libcrypto/ebcdic.c +++ /dev/null @@ -1,221 +0,0 @@ -/* crypto/ebcdic.c */ - -#ifndef CHARSET_EBCDIC - -#include -#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 - * Adapted for OpenSSL-0.9.4 by - */ - -#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/src/lib/libcrypto/ebcdic.h b/src/lib/libcrypto/ebcdic.h deleted file mode 100644 index 6d65afcf9e..0000000000 --- a/src/lib/libcrypto/ebcdic.h +++ /dev/null @@ -1,19 +0,0 @@ -/* crypto/ebcdic.h */ - -#ifndef HEADER_EBCDIC_H -#define HEADER_EBCDIC_H - -#include - -/* 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/src/lib/libcrypto/evp/encode.c b/src/lib/libcrypto/evp/encode.c index 28546a84bc..7af9a2780b 100644 --- a/src/lib/libcrypto/evp/encode.c +++ b/src/lib/libcrypto/evp/encode.c @@ -60,19 +60,8 @@ #include "cryptlib.h" #include -#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/src/lib/libcrypto/hmac/hmactest.c b/src/lib/libcrypto/hmac/hmactest.c index 1b906b81af..282e06e53e 100644 --- a/src/lib/libcrypto/hmac/hmactest.c +++ b/src/lib/libcrypto/hmac/hmactest.c @@ -74,9 +74,6 @@ int main(int argc, char *argv[]) #include #endif -#ifdef CHARSET_EBCDIC -#include -#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/src/lib/libcrypto/md2/md2_one.c b/src/lib/libcrypto/md2/md2_one.c index f7fef5cc0a..cb8594e085 100644 --- a/src/lib/libcrypto/md2/md2_one.c +++ b/src/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/src/lib/libcrypto/md2/md2test.c b/src/lib/libcrypto/md2/md2test.c index db5f5bc6d2..0195214036 100644 --- a/src/lib/libcrypto/md2/md2test.c +++ b/src/lib/libcrypto/md2/md2test.c @@ -72,10 +72,6 @@ int main(int argc, char *argv[]) #include #include -#ifdef CHARSET_EBCDIC -#include -#endif - static char *test[]={ "", "a", diff --git a/src/lib/libcrypto/md4/md4_one.c b/src/lib/libcrypto/md4/md4_one.c index bb64362638..ed6ce33650 100644 --- a/src/lib/libcrypto/md4/md4_one.c +++ b/src/lib/libcrypto/md4/md4_one.c @@ -61,10 +61,6 @@ #include #include -#ifdef CHARSET_EBCDIC -#include -#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/src/lib/libcrypto/md5/md5_one.c b/src/lib/libcrypto/md5/md5_one.c index 43fee89379..839e27e972 100644 --- a/src/lib/libcrypto/md5/md5_one.c +++ b/src/lib/libcrypto/md5/md5_one.c @@ -61,10 +61,6 @@ #include #include -#ifdef CHARSET_EBCDIC -#include -#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/src/lib/libcrypto/mdc2/mdc2test.c b/src/lib/libcrypto/mdc2/mdc2test.c index 017b31add2..cf8f65cf27 100644 --- a/src/lib/libcrypto/mdc2/mdc2test.c +++ b/src/lib/libcrypto/mdc2/mdc2test.c @@ -76,10 +76,6 @@ int main(int argc, char *argv[]) #include #include -#ifdef CHARSET_EBCDIC -#include -#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)); diff --git a/src/lib/libcrypto/objects/obj_dat.c b/src/lib/libcrypto/objects/obj_dat.c index a597284c80..bced796e62 100644 --- a/src/lib/libcrypto/objects/obj_dat.c +++ b/src/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; icipher,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/src/lib/libcrypto/ripemd/rmdtest.c b/src/lib/libcrypto/ripemd/rmdtest.c index fb34e0e836..b32fda96ed 100644 --- a/src/lib/libcrypto/ripemd/rmdtest.c +++ b/src/lib/libcrypto/ripemd/rmdtest.c @@ -72,10 +72,6 @@ int main(int argc, char *argv[]) #include #include -#ifdef CHARSET_EBCDIC -#include -#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/src/lib/libcrypto/sha/sha1test.c b/src/lib/libcrypto/sha/sha1test.c index 6feb3964c7..ad9e3dc407 100644 --- a/src/lib/libcrypto/sha/sha1test.c +++ b/src/lib/libcrypto/sha/sha1test.c @@ -72,10 +72,6 @@ int main(int argc, char *argv[]) #include #include -#ifdef CHARSET_EBCDIC -#include -#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/src/lib/libcrypto/sha/shatest.c b/src/lib/libcrypto/sha/shatest.c index 27614646d1..6c93c39590 100644 --- a/src/lib/libcrypto/sha/shatest.c +++ b/src/lib/libcrypto/sha/shatest.c @@ -72,10 +72,6 @@ int main(int argc, char *argv[]) #include #include -#ifdef CHARSET_EBCDIC -#include -#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/src/lib/libcrypto/x509/x509_obj.c b/src/lib/libcrypto/x509/x509_obj.c index 21fed9f838..bcc1e7429e 100644 --- a/src/lib/libcrypto/x509/x509_obj.c +++ b/src/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 '~')) { @@ -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/src/lib/libcrypto/x509v3/v3_ia5.c b/src/lib/libcrypto/x509v3/v3_ia5.c index 4ff12b52b5..ab1c5188b8 100644 --- a/src/lib/libcrypto/x509v3/v3_ia5.c +++ b/src/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/src/lib/libcrypto/x509v3/v3_prn.c b/src/lib/libcrypto/x509v3/v3_prn.c index 3146218708..2124b447b4 100644 --- a/src/lib/libcrypto/x509v3/v3_prn.c +++ b/src/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/src/lib/libcrypto/x509v3/v3_utl.c b/src/lib/libcrypto/x509v3/v3_utl.c index e030234540..c4b6143eff 100644 --- a/src/lib/libcrypto/x509v3/v3_utl.c +++ b/src/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/src/lib/libssl/src/apps/passwd.c b/src/lib/libssl/src/apps/passwd.c index 473fe46cbd..9eabeb488c 100644 --- a/src/lib/libssl/src/apps/passwd.c +++ b/src/lib/libssl/src/apps/passwd.c @@ -1,6 +1,6 @@ /* apps/passwd.c */ -#if defined OPENSSL_NO_MD5 || defined CHARSET_EBCDIC +#if defined OPENSSL_NO_MD5 # define NO_MD5CRYPT_1 #endif @@ -440,10 +440,6 @@ static int do_passwd(int passed_salt, char **salt_p, char **salt_malloc_p, (*salt_p)[0] = cov_2char[(*salt_p)[0] & 0x3f]; /* 6 bits */ (*salt_p)[1] = cov_2char[(*salt_p)[1] & 0x3f]; /* 6 bits */ (*salt_p)[2] = 0; -#ifdef CHARSET_EBCDIC - ascii2ebcdic(*salt_p, *salt_p, 2); /* des_crypt will convert - * back to ASCII */ -#endif } #endif /* !OPENSSL_NO_DES */ diff --git a/src/lib/libssl/src/apps/req.c b/src/lib/libssl/src/apps/req.c index f1f412887d..4b5c813cef 100644 --- a/src/lib/libssl/src/apps/req.c +++ b/src/lib/libssl/src/apps/req.c @@ -1397,20 +1397,12 @@ static int auto_info(X509_REQ *req, STACK_OF(CONF_VALUE) *dn_sk, * multiple instances */ for(p = v->name; *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 (*p == '+') -#else - if (*p == os_toascii['+']) -#endif { p++; mval = -1; @@ -1486,9 +1478,6 @@ start: return(0); } buf[--i]='\0'; -#ifdef CHARSET_EBCDIC - ebcdic2ascii(buf, buf, i); -#endif if(!req_check_len(i, n_min, n_max)) goto start; if (!X509_NAME_add_entry_by_NID(n,nid, chtype, (unsigned char *) buf, -1,-1,mval)) goto err; @@ -1545,9 +1534,6 @@ start: return(0); } buf[--i]='\0'; -#ifdef CHARSET_EBCDIC - ebcdic2ascii(buf, buf, i); -#endif if(!req_check_len(i, n_min, n_max)) goto start; if(!X509_REQ_add1_attr_by_NID(req, nid, chtype, diff --git a/src/lib/libssl/src/apps/s_client.c b/src/lib/libssl/src/apps/s_client.c index 78566a595e..87fd958cbd 100644 --- a/src/lib/libssl/src/apps/s_client.c +++ b/src/lib/libssl/src/apps/s_client.c @@ -1752,9 +1752,6 @@ SSL_set_tlsext_status_ids(con, ids); else if (!ssl_pending && FD_ISSET(fileno(stdout),&writefds)) #endif { -#ifdef CHARSET_EBCDIC - ascii2ebcdic(&(sbuf[sbuf_off]),&(sbuf[sbuf_off]),sbuf_len); -#endif i=raw_write_stdout(&(sbuf[sbuf_off]),sbuf_len); if (i <= 0) @@ -1885,9 +1882,6 @@ printf("read=%d pending=%d peek=%d\n",k,SSL_pending(con),SSL_peek(con,zbuf,10240 { cbuf_len=i; cbuf_off=0; -#ifdef CHARSET_EBCDIC - ebcdic2ascii(cbuf, cbuf, i); -#endif } write_ssl=1; diff --git a/src/lib/libssl/src/apps/s_server.c b/src/lib/libssl/src/apps/s_server.c index 53da15da23..de54aa6abd 100644 --- a/src/lib/libssl/src/apps/s_server.c +++ b/src/lib/libssl/src/apps/s_server.c @@ -567,156 +567,6 @@ static void sv_usage(void) static int local_argc=0; static char **local_argv; -#ifdef CHARSET_EBCDIC -static int ebcdic_new(BIO *bi); -static int ebcdic_free(BIO *a); -static int ebcdic_read(BIO *b, char *out, int outl); -static int ebcdic_write(BIO *b, const char *in, int inl); -static long ebcdic_ctrl(BIO *b, int cmd, long num, void *ptr); -static int ebcdic_gets(BIO *bp, char *buf, int size); -static int ebcdic_puts(BIO *bp, const char *str); - -#define BIO_TYPE_EBCDIC_FILTER (18|0x0200) -static BIO_METHOD methods_ebcdic= - { - BIO_TYPE_EBCDIC_FILTER, - "EBCDIC/ASCII filter", - ebcdic_write, - ebcdic_read, - ebcdic_puts, - ebcdic_gets, - ebcdic_ctrl, - ebcdic_new, - ebcdic_free, - }; - -typedef struct -{ - size_t alloced; - char buff[1]; -} EBCDIC_OUTBUFF; - -BIO_METHOD *BIO_f_ebcdic_filter() -{ - return(&methods_ebcdic); -} - -static int ebcdic_new(BIO *bi) -{ - EBCDIC_OUTBUFF *wbuf; - - wbuf = (EBCDIC_OUTBUFF *)OPENSSL_malloc(sizeof(EBCDIC_OUTBUFF) + 1024); - wbuf->alloced = 1024; - wbuf->buff[0] = '\0'; - - bi->ptr=(char *)wbuf; - bi->init=1; - bi->flags=0; - return(1); -} - -static int ebcdic_free(BIO *a) -{ - if (a == NULL) return(0); - if (a->ptr != NULL) - OPENSSL_free(a->ptr); - a->ptr=NULL; - a->init=0; - a->flags=0; - return(1); -} - -static int ebcdic_read(BIO *b, char *out, int outl) -{ - int ret=0; - - if (out == NULL || outl == 0) return(0); - if (b->next_bio == NULL) return(0); - - ret=BIO_read(b->next_bio,out,outl); - if (ret > 0) - ascii2ebcdic(out,out,ret); - return(ret); -} - -static int ebcdic_write(BIO *b, const char *in, int inl) -{ - EBCDIC_OUTBUFF *wbuf; - int ret=0; - int num; - unsigned char n; - - if ((in == NULL) || (inl <= 0)) return(0); - if (b->next_bio == NULL) return(0); - - wbuf=(EBCDIC_OUTBUFF *)b->ptr; - - if (inl > (num = wbuf->alloced)) - { - num = num + num; /* double the size */ - if (num < inl) - num = inl; - OPENSSL_free(wbuf); - wbuf=(EBCDIC_OUTBUFF *)OPENSSL_malloc(sizeof(EBCDIC_OUTBUFF) + num); - - wbuf->alloced = num; - wbuf->buff[0] = '\0'; - - b->ptr=(char *)wbuf; - } - - ebcdic2ascii(wbuf->buff, in, inl); - - ret=BIO_write(b->next_bio, wbuf->buff, inl); - - return(ret); -} - -static long ebcdic_ctrl(BIO *b, int cmd, long num, void *ptr) -{ - long ret; - - if (b->next_bio == NULL) return(0); - switch (cmd) - { - case BIO_CTRL_DUP: - ret=0L; - break; - default: - ret=BIO_ctrl(b->next_bio,cmd,num,ptr); - break; - } - return(ret); -} - -static int ebcdic_gets(BIO *bp, char *buf, int size) -{ - int i, ret=0; - if (bp->next_bio == NULL) return(0); -/* return(BIO_gets(bp->next_bio,buf,size));*/ - for (i=0; inext_bio == NULL) return(0); - return ebcdic_write(bp, str, strlen(str)); -} -#endif - #ifndef OPENSSL_NO_TLSEXT /* This is a context that we pass to callbacks */ @@ -2231,9 +2081,6 @@ static int sv_body(char *hostname, int s, unsigned char *context) print_stats(bio_s_out,SSL_get_SSL_CTX(con)); } } -#ifdef CHARSET_EBCDIC - ebcdic2ascii(buf,buf,i); -#endif l=k=0; for (;;) { @@ -2316,9 +2163,6 @@ again: switch (SSL_get_error(con,i)) { case SSL_ERROR_NONE: -#ifdef CHARSET_EBCDIC - ascii2ebcdic(buf,buf,i); -#endif raw_write_stdout(buf, (unsigned int)i); if (SSL_pending(con)) goto again; @@ -2612,9 +2456,6 @@ static int www_body(char *hostname, int s, unsigned char *context) /* SSL_set_fd(con,s); */ BIO_set_ssl(ssl_bio,con,BIO_CLOSE); BIO_push(io,ssl_bio); -#ifdef CHARSET_EBCDIC - io = BIO_push(BIO_new(BIO_f_ebcdic_filter()),io); -#endif if (s_debug) { diff --git a/src/lib/libssl/src/crypto/Makefile b/src/lib/libssl/src/crypto/Makefile index aa105e37a2..326915d520 100644 --- a/src/lib/libssl/src/crypto/Makefile +++ b/src/lib/libssl/src/crypto/Makefile @@ -35,13 +35,13 @@ GENERAL=Makefile README crypto-lib.com install.com LIB= $(TOP)/libcrypto.a SHARED_LIB= libcrypto$(SHLIB_EXT) LIBSRC= cryptlib.c mem.c mem_clr.c mem_dbg.c cversion.c ex_data.c cpt_err.c \ - ebcdic.c uid.c o_time.c o_str.c o_dir.c o_fips.c o_init.c fips_ers.c -LIBOBJ= cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o cpt_err.o ebcdic.o \ + uid.c o_time.c o_str.c o_dir.c o_fips.c o_init.c fips_ers.c +LIBOBJ= cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o cpt_err.o \ uid.o o_time.o o_str.o o_dir.o o_fips.o o_init.o fips_ers.o $(CPUID_OBJ) SRC= $(LIBSRC) -EXHEADER= crypto.h opensslv.h opensslconf.h ebcdic.h symhacks.h \ +EXHEADER= crypto.h opensslv.h opensslconf.h symhacks.h \ ossl_typ.h HEADER= cryptlib.h buildinf.h md32_common.h o_time.h o_str.h o_dir.h $(EXHEADER) diff --git a/src/lib/libssl/src/crypto/asn1/a_gentm.c b/src/lib/libssl/src/crypto/asn1/a_gentm.c index 04266e790a..4f312ee6c9 100644 --- a/src/lib/libssl/src/crypto/asn1/a_gentm.c +++ b/src/lib/libssl/src/crypto/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/src/lib/libssl/src/crypto/asn1/a_mbstr.c b/src/lib/libssl/src/crypto/asn1/a_mbstr.c index 264d8f677f..dc953c8325 100644 --- a/src/lib/libssl/src/crypto/asn1/a_mbstr.c +++ b/src/lib/libssl/src/crypto/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/src/lib/libssl/src/crypto/asn1/a_print.c b/src/lib/libssl/src/crypto/asn1/a_print.c index d18e772320..9eec5034e1 100644 --- a/src/lib/libssl/src/crypto/asn1/a_print.c +++ b/src/lib/libssl/src/crypto/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/src/lib/libssl/src/crypto/asn1/a_time.c b/src/lib/libssl/src/crypto/asn1/a_time.c index e2eb9b243e..4ade88f065 100644 --- a/src/lib/libssl/src/crypto/asn1/a_time.c +++ b/src/lib/libssl/src/crypto/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/src/lib/libssl/src/crypto/asn1/a_utctm.c b/src/lib/libssl/src/crypto/asn1/a_utctm.c index 615395b738..f2e7de16af 100644 --- a/src/lib/libssl/src/crypto/asn1/a_utctm.c +++ b/src/lib/libssl/src/crypto/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/src/lib/libssl/src/crypto/asn1/f_int.c b/src/lib/libssl/src/crypto/asn1/f_int.c index 9494e597ab..8b92fad9df 100644 --- a/src/lib/libssl/src/crypto/asn1/f_int.c +++ b/src/lib/libssl/src/crypto/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= '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/src/lib/libssl/src/crypto/asn1/f_string.c b/src/lib/libssl/src/crypto/asn1/f_string.c index 968698a798..f7d36adac7 100644 --- a/src/lib/libssl/src/crypto/asn1/f_string.c +++ b/src/lib/libssl/src/crypto/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/src/lib/libssl/src/crypto/asn1/t_x509.c b/src/lib/libssl/src/crypto/asn1/t_x509.c index edbb39a02f..bbf00c7a29 100644 --- a/src/lib/libssl/src/crypto/asn1/t_x509.c +++ b/src/lib/libssl/src/crypto/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/src/lib/libssl/src/crypto/bf/bftest.c b/src/lib/libssl/src/crypto/bf/bftest.c index 97e6634d37..20caf0f3f8 100644 --- a/src/lib/libssl/src/crypto/bf/bftest.c +++ b/src/lib/libssl/src/crypto/bf/bftest.c @@ -75,10 +75,6 @@ int main(int argc, char *argv[]) #else #include -#ifdef CHARSET_EBCDIC -#include -#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/src/lib/libssl/src/crypto/bio/b_dump.c b/src/lib/libssl/src/crypto/bio/b_dump.c index bea94969a2..32d523563e 100644 --- a/src/lib/libssl/src/crypto/bio/b_dump.c +++ b/src/lib/libssl/src/crypto/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/src/lib/libssl/src/crypto/conf/conf_def.h b/src/lib/libssl/src/crypto/conf/conf_def.h index 92a7d8ad77..b18e6e2728 100644 --- a/src/lib/libssl/src/crypto/conf/conf_def.h +++ b/src/lib/libssl/src/crypto/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/src/lib/libssl/src/crypto/conf/keysets.pl b/src/lib/libssl/src/crypto/conf/keysets.pl index 50ed67fa52..fe17be57fe 100644 --- a/src/lib/libssl/src/crypto/conf/keysets.pl +++ b/src/lib/libssl/src/crypto/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/src/lib/libssl/src/crypto/crypto.h b/src/lib/libssl/src/crypto/crypto.h index baeba25b99..351ccfd35b 100644 --- a/src/lib/libssl/src/crypto/crypto.h +++ b/src/lib/libssl/src/crypto/crypto.h @@ -130,10 +130,6 @@ #include #include -#ifdef CHARSET_EBCDIC -#include -#endif - #ifdef __cplusplus extern "C" { #endif diff --git a/src/lib/libssl/src/crypto/des/fcrypt.c b/src/lib/libssl/src/crypto/des/fcrypt.c index ccbdff250f..d02189b290 100644 --- a/src/lib/libssl/src/crypto/des/fcrypt.c +++ b/src/lib/libssl/src/crypto/des/fcrypt.c @@ -1,13 +1,5 @@ /* NOCW */ #include -#ifdef _OSD_POSIX -#ifndef CHARSET_EBCDIC -#define CHARSET_EBCDIC 1 -#endif -#endif -#ifdef CHARSET_EBCDIC -#include -#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/src/lib/libssl/src/crypto/ebcdic.c b/src/lib/libssl/src/crypto/ebcdic.c deleted file mode 100644 index 2ac26abc72..0000000000 --- a/src/lib/libssl/src/crypto/ebcdic.c +++ /dev/null @@ -1,221 +0,0 @@ -/* crypto/ebcdic.c */ - -#ifndef CHARSET_EBCDIC - -#include -#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 - * Adapted for OpenSSL-0.9.4 by - */ - -#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/src/lib/libssl/src/crypto/ebcdic.h b/src/lib/libssl/src/crypto/ebcdic.h deleted file mode 100644 index 6d65afcf9e..0000000000 --- a/src/lib/libssl/src/crypto/ebcdic.h +++ /dev/null @@ -1,19 +0,0 @@ -/* crypto/ebcdic.h */ - -#ifndef HEADER_EBCDIC_H -#define HEADER_EBCDIC_H - -#include - -/* 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/src/lib/libssl/src/crypto/evp/encode.c b/src/lib/libssl/src/crypto/evp/encode.c index 28546a84bc..7af9a2780b 100644 --- a/src/lib/libssl/src/crypto/evp/encode.c +++ b/src/lib/libssl/src/crypto/evp/encode.c @@ -60,19 +60,8 @@ #include "cryptlib.h" #include -#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/src/lib/libssl/src/crypto/hmac/hmactest.c b/src/lib/libssl/src/crypto/hmac/hmactest.c index 1b906b81af..282e06e53e 100644 --- a/src/lib/libssl/src/crypto/hmac/hmactest.c +++ b/src/lib/libssl/src/crypto/hmac/hmactest.c @@ -74,9 +74,6 @@ int main(int argc, char *argv[]) #include #endif -#ifdef CHARSET_EBCDIC -#include -#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/src/lib/libssl/src/crypto/md2/md2_one.c b/src/lib/libssl/src/crypto/md2/md2_one.c index f7fef5cc0a..cb8594e085 100644 --- a/src/lib/libssl/src/crypto/md2/md2_one.c +++ b/src/lib/libssl/src/crypto/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/src/lib/libssl/src/crypto/md2/md2test.c b/src/lib/libssl/src/crypto/md2/md2test.c index db5f5bc6d2..0195214036 100644 --- a/src/lib/libssl/src/crypto/md2/md2test.c +++ b/src/lib/libssl/src/crypto/md2/md2test.c @@ -72,10 +72,6 @@ int main(int argc, char *argv[]) #include #include -#ifdef CHARSET_EBCDIC -#include -#endif - static char *test[]={ "", "a", diff --git a/src/lib/libssl/src/crypto/md4/md4_one.c b/src/lib/libssl/src/crypto/md4/md4_one.c index bb64362638..ed6ce33650 100644 --- a/src/lib/libssl/src/crypto/md4/md4_one.c +++ b/src/lib/libssl/src/crypto/md4/md4_one.c @@ -61,10 +61,6 @@ #include #include -#ifdef CHARSET_EBCDIC -#include -#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/src/lib/libssl/src/crypto/md5/md5_one.c b/src/lib/libssl/src/crypto/md5/md5_one.c index 43fee89379..839e27e972 100644 --- a/src/lib/libssl/src/crypto/md5/md5_one.c +++ b/src/lib/libssl/src/crypto/md5/md5_one.c @@ -61,10 +61,6 @@ #include #include -#ifdef CHARSET_EBCDIC -#include -#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/src/lib/libssl/src/crypto/mdc2/mdc2test.c b/src/lib/libssl/src/crypto/mdc2/mdc2test.c index 017b31add2..cf8f65cf27 100644 --- a/src/lib/libssl/src/crypto/mdc2/mdc2test.c +++ b/src/lib/libssl/src/crypto/mdc2/mdc2test.c @@ -76,10 +76,6 @@ int main(int argc, char *argv[]) #include #include -#ifdef CHARSET_EBCDIC -#include -#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)); diff --git a/src/lib/libssl/src/crypto/objects/obj_dat.c b/src/lib/libssl/src/crypto/objects/obj_dat.c index a597284c80..bced796e62 100644 --- a/src/lib/libssl/src/crypto/objects/obj_dat.c +++ b/src/lib/libssl/src/crypto/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; icipher,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/src/lib/libssl/src/crypto/ripemd/rmdtest.c b/src/lib/libssl/src/crypto/ripemd/rmdtest.c index fb34e0e836..b32fda96ed 100644 --- a/src/lib/libssl/src/crypto/ripemd/rmdtest.c +++ b/src/lib/libssl/src/crypto/ripemd/rmdtest.c @@ -72,10 +72,6 @@ int main(int argc, char *argv[]) #include #include -#ifdef CHARSET_EBCDIC -#include -#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/src/lib/libssl/src/crypto/sha/sha1test.c b/src/lib/libssl/src/crypto/sha/sha1test.c index 6feb3964c7..ad9e3dc407 100644 --- a/src/lib/libssl/src/crypto/sha/sha1test.c +++ b/src/lib/libssl/src/crypto/sha/sha1test.c @@ -72,10 +72,6 @@ int main(int argc, char *argv[]) #include #include -#ifdef CHARSET_EBCDIC -#include -#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/src/lib/libssl/src/crypto/sha/shatest.c b/src/lib/libssl/src/crypto/sha/shatest.c index 27614646d1..6c93c39590 100644 --- a/src/lib/libssl/src/crypto/sha/shatest.c +++ b/src/lib/libssl/src/crypto/sha/shatest.c @@ -72,10 +72,6 @@ int main(int argc, char *argv[]) #include #include -#ifdef CHARSET_EBCDIC -#include -#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/src/lib/libssl/src/crypto/x509/x509_obj.c b/src/lib/libssl/src/crypto/x509/x509_obj.c index 21fed9f838..bcc1e7429e 100644 --- a/src/lib/libssl/src/crypto/x509/x509_obj.c +++ b/src/lib/libssl/src/crypto/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 '~')) { @@ -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/src/lib/libssl/src/crypto/x509v3/v3_ia5.c b/src/lib/libssl/src/crypto/x509v3/v3_ia5.c index 4ff12b52b5..ab1c5188b8 100644 --- a/src/lib/libssl/src/crypto/x509v3/v3_ia5.c +++ b/src/lib/libssl/src/crypto/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/src/lib/libssl/src/crypto/x509v3/v3_prn.c b/src/lib/libssl/src/crypto/x509v3/v3_prn.c index 3146218708..2124b447b4 100644 --- a/src/lib/libssl/src/crypto/x509v3/v3_prn.c +++ b/src/lib/libssl/src/crypto/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/src/lib/libssl/src/crypto/x509v3/v3_utl.c b/src/lib/libssl/src/crypto/x509v3/v3_utl.c index e030234540..c4b6143eff 100644 --- a/src/lib/libssl/src/crypto/x509v3/v3_utl.c +++ b/src/lib/libssl/src/crypto/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/src/lib/libssl/src/ssl/s2_lib.c b/src/lib/libssl/src/ssl/s2_lib.c index d3764ebbe9..76ed912927 100644 --- a/src/lib/libssl/src/ssl/s2_lib.c +++ b/src/lib/libssl/src/ssl/s2_lib.c @@ -475,10 +475,6 @@ ssl2_generate_key_material(SSL *s) md5 = EVP_md5(); -#ifdef CHARSET_EBCDIC - c = os_toascii['0']; /* Must be an ASCII '0', not EBCDIC '0', - see SSLv2 docu */ -#endif EVP_MD_CTX_init(&ctx); km = s->s2->key_material; diff --git a/src/lib/libssl/src/ssl/s3_enc.c b/src/lib/libssl/src/ssl/s3_enc.c index 4536ca5995..9ed5850e73 100644 --- a/src/lib/libssl/src/ssl/s3_enc.c +++ b/src/lib/libssl/src/ssl/s3_enc.c @@ -170,9 +170,6 @@ ssl3_generate_key_block(SSL *s, unsigned char *km, int num) unsigned char c = 'A'; unsigned int i, j, k; -#ifdef CHARSET_EBCDIC - c = os_toascii[c]; /*'A' in ASCII */ -#endif k = 0; EVP_MD_CTX_init(&m5); EVP_MD_CTX_set_flags(&m5, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW); @@ -796,15 +793,9 @@ ssl3_generate_master_secret(SSL *s, unsigned char *out, unsigned char *p, int len) { static const unsigned char *salt[3] = { -#ifndef CHARSET_EBCDIC (const unsigned char *)"A", (const unsigned char *)"BB", (const unsigned char *)"CCC", -#else - (const unsigned char *)"\x41", - (const unsigned char *)"\x42\x42", - (const unsigned char *)"\x43\x43\x43", -#endif }; unsigned char buf[EVP_MAX_MD_SIZE]; EVP_MD_CTX ctx; diff --git a/src/lib/libssl/src/ssl/ssl_ciph.c b/src/lib/libssl/src/ssl/ssl_ciph.c index 0e24e0a5c6..ed2e78bdcc 100644 --- a/src/lib/libssl/src/ssl/ssl_ciph.c +++ b/src/lib/libssl/src/ssl/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/src/lib/libssl/src/ssl/tls1.h b/src/lib/libssl/src/ssl/tls1.h index 95d6660ac3..43879f82af 100644 --- a/src/lib/libssl/src/ssl/tls1.h +++ b/src/lib/libssl/src/ssl/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; diff --git a/src/lib/libssl/ssl_ciph.c b/src/lib/libssl/ssl_ciph.c index 0e24e0a5c6..ed2e78bdcc 100644 --- a/src/lib/libssl/ssl_ciph.c +++ b/src/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/src/lib/libssl/tls1.h b/src/lib/libssl/tls1.h index 95d6660ac3..43879f82af 100644 --- a/src/lib/libssl/tls1.h +++ b/src/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; -- cgit v1.2.3-55-g6feb