From 9200bb13d15da4b2a23e6bc92c20e95b74aa2113 Mon Sep 17 00:00:00 2001 From: beck <> Date: Fri, 15 Dec 2000 02:58:47 +0000 Subject: openssl-engine-0.9.6 merge --- src/lib/libcrypto/des/Makefile.ssl | 17 +++++++++++------ src/lib/libcrypto/des/des.c | 4 ++-- src/lib/libcrypto/des/des.h | 9 ++++----- src/lib/libcrypto/des/enc_read.c | 6 +++--- src/lib/libcrypto/des/enc_writ.c | 2 +- src/lib/libcrypto/des/qud_cksm.c | 12 +++++++++++- src/lib/libcrypto/des/read_pwd.c | 20 ++++++++++++++------ 7 files changed, 46 insertions(+), 24 deletions(-) (limited to 'src/lib/libcrypto/des') diff --git a/src/lib/libcrypto/des/Makefile.ssl b/src/lib/libcrypto/des/Makefile.ssl index 3eb0738b7b..34a360b7ab 100644 --- a/src/lib/libcrypto/des/Makefile.ssl +++ b/src/lib/libcrypto/des/Makefile.ssl @@ -162,16 +162,19 @@ ede_cbcm_enc.o: ../../include/openssl/opensslconf.h des_locl.h enc_read.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h enc_read.o: ../../include/openssl/crypto.h ../../include/openssl/des.h enc_read.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h -enc_read.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h +enc_read.o: ../../include/openssl/err.h ../../include/openssl/lhash.h +enc_read.o: ../../include/openssl/opensslconf.h enc_read.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h -enc_read.o: ../../include/openssl/stack.h ../cryptlib.h des_locl.h +enc_read.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h +enc_read.o: ../cryptlib.h des_locl.h enc_writ.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h enc_writ.o: ../../include/openssl/crypto.h ../../include/openssl/des.h enc_writ.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h -enc_writ.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h +enc_writ.o: ../../include/openssl/err.h ../../include/openssl/lhash.h +enc_writ.o: ../../include/openssl/opensslconf.h enc_writ.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h enc_writ.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h -enc_writ.o: ../cryptlib.h des_locl.h +enc_writ.o: ../../include/openssl/symhacks.h ../cryptlib.h des_locl.h fcrypt.o: ../../include/openssl/des.h ../../include/openssl/e_os2.h fcrypt.o: ../../include/openssl/opensslconf.h des_locl.h fcrypt_b.o: ../../include/openssl/des.h ../../include/openssl/e_os2.h @@ -193,9 +196,11 @@ read2pwd.o: ../../include/openssl/opensslconf.h des_locl.h read_pwd.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h read_pwd.o: ../../include/openssl/crypto.h ../../include/openssl/des.h read_pwd.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h -read_pwd.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h +read_pwd.o: ../../include/openssl/err.h ../../include/openssl/lhash.h +read_pwd.o: ../../include/openssl/opensslconf.h read_pwd.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h -read_pwd.o: ../../include/openssl/stack.h ../cryptlib.h des_locl.h +read_pwd.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h +read_pwd.o: ../cryptlib.h des_locl.h rpc_enc.o: ../../include/openssl/des.h ../../include/openssl/e_os2.h rpc_enc.o: ../../include/openssl/opensslconf.h des_locl.h des_ver.h rpc_des.h set_key.o: ../../include/openssl/des.h ../../include/openssl/e_os2.h diff --git a/src/lib/libcrypto/des/des.c b/src/lib/libcrypto/des/des.c index 0197489c9e..215d7413c0 100644 --- a/src/lib/libcrypto/des/des.c +++ b/src/lib/libcrypto/des/des.c @@ -374,8 +374,8 @@ void doencryption(void) if (buf == NULL) { - if ( (( buf=Malloc(BUFSIZE+8)) == NULL) || - ((obuf=Malloc(BUFSIZE+8)) == NULL)) + if ( (( buf=OPENSSL_malloc(BUFSIZE+8)) == NULL) || + ((obuf=OPENSSL_malloc(BUFSIZE+8)) == NULL)) { fputs("Not enough memory\n",stderr); Exit=10; diff --git a/src/lib/libcrypto/des/des.h b/src/lib/libcrypto/des/des.h index ead67986d9..2db9748cb4 100644 --- a/src/lib/libcrypto/des/des.h +++ b/src/lib/libcrypto/des/des.h @@ -59,10 +59,6 @@ #ifndef HEADER_DES_H #define HEADER_DES_H -#ifdef __cplusplus -extern "C" { -#endif - #ifdef NO_DES #error DES is disabled. #endif @@ -71,10 +67,13 @@ extern "C" { #error replaces . #endif -#include #include /* DES_LONG */ #include /* OPENSSL_EXTERN */ +#ifdef __cplusplus +extern "C" { +#endif + typedef unsigned char des_cblock[8]; typedef /* const */ unsigned char const_des_cblock[8]; /* With "const", gcc 2.8.1 on Solaris thinks that des_cblock * diff --git a/src/lib/libcrypto/des/enc_read.c b/src/lib/libcrypto/des/enc_read.c index 7399ff7269..af2d9177d2 100644 --- a/src/lib/libcrypto/des/enc_read.c +++ b/src/lib/libcrypto/des/enc_read.c @@ -103,17 +103,17 @@ int des_enc_read(int fd, void *buf, int len, des_key_schedule sched, if (tmpbuf == NULL) { - tmpbuf=Malloc(BSIZE); + tmpbuf=OPENSSL_malloc(BSIZE); if (tmpbuf == NULL) return(-1); } if (net == NULL) { - net=Malloc(BSIZE); + net=OPENSSL_malloc(BSIZE); if (net == NULL) return(-1); } if (unnet == NULL) { - unnet=Malloc(BSIZE); + unnet=OPENSSL_malloc(BSIZE); if (unnet == NULL) return(-1); } /* left over data from last decrypt */ diff --git a/src/lib/libcrypto/des/enc_writ.c b/src/lib/libcrypto/des/enc_writ.c index 4d3452724e..cc2b50fb50 100644 --- a/src/lib/libcrypto/des/enc_writ.c +++ b/src/lib/libcrypto/des/enc_writ.c @@ -95,7 +95,7 @@ int des_enc_write(int fd, const void *_buf, int len, if (outbuf == NULL) { - outbuf=Malloc(BSIZE+HDRSIZE); + outbuf=OPENSSL_malloc(BSIZE+HDRSIZE); if (outbuf == NULL) return(-1); } /* If we are sending less than 8 bytes, the same char will look diff --git a/src/lib/libcrypto/des/qud_cksm.c b/src/lib/libcrypto/des/qud_cksm.c index 5f0ec5387f..9fff989edb 100644 --- a/src/lib/libcrypto/des/qud_cksm.c +++ b/src/lib/libcrypto/des/qud_cksm.c @@ -81,13 +81,17 @@ DES_LONG des_quad_cksum(const unsigned char *input, des_cblock output[], long l; const unsigned char *cp; #ifdef _CRAY - short *lp; + struct lp_st { int a:32; int b:32; } *lp; #else DES_LONG *lp; #endif if (out_count < 1) out_count=1; +#ifdef _CRAY + lp = (struct lp_st *) &(output[0])[0]; +#else lp = (DES_LONG *) &(output[0])[0]; +#endif z0=Q_B0((*seed)[0])|Q_B1((*seed)[1])|Q_B2((*seed)[2])|Q_B3((*seed)[3]); z1=Q_B0((*seed)[4])|Q_B1((*seed)[5])|Q_B2((*seed)[6])|Q_B3((*seed)[7]); @@ -120,8 +124,14 @@ DES_LONG des_quad_cksum(const unsigned char *input, des_cblock output[], { /* The MIT library assumes that the checksum is * composed of 2*out_count 32 bit ints */ +#ifdef _CRAY + (*lp).a = z0; + (*lp).b = z1; + lp++; +#else *lp++ = z0; *lp++ = z1; +#endif } } return(z0); diff --git a/src/lib/libcrypto/des/read_pwd.c b/src/lib/libcrypto/des/read_pwd.c index fa2d67da64..c27ec336e7 100644 --- a/src/lib/libcrypto/des/read_pwd.c +++ b/src/lib/libcrypto/des/read_pwd.c @@ -161,7 +161,7 @@ #include #endif -#ifdef MSDOS +#if defined(MSDOS) && !defined(__CYGWIN32__) #include #define fgets(a,b,c) noecho_fgets(a,b,c) #endif @@ -265,13 +265,17 @@ int des_read_pw(char *buf, char *buff, int size, const char *prompt, is_a_tty=1; tty=NULL; -#ifndef MSDOS - if ((tty=fopen("/dev/tty","r")) == NULL) - tty=stdin; -#else /* MSDOS */ +#ifdef MSDOS if ((tty=fopen("con","r")) == NULL) tty=stdin; -#endif /* MSDOS */ +#elif defined(MAC_OS_pre_X) + tty=stdin; +#else +#ifndef MPE + if ((tty=fopen("/dev/tty","r")) == NULL) +#endif + tty=stdin; +#endif #if defined(TTY_get) && !defined(VMS) if (TTY_get(fileno(tty),&tty_orig) == -1) @@ -310,8 +314,12 @@ int des_read_pw(char *buf, char *buff, int size, const char *prompt, #if defined(TTY_set) && !defined(VMS) if (is_a_tty && (TTY_set(fileno(tty),&tty_new) == -1)) +#ifdef MPE + ; /* MPE lies -- echo really has been disabled */ +#else return(-1); #endif +#endif #ifdef VMS tty_new[0] = tty_orig[0]; tty_new[1] = tty_orig[1] | TT$M_NOECHO; -- cgit v1.2.3-55-g6feb