summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/des
diff options
context:
space:
mode:
authorbeck <>2000-12-15 02:58:47 +0000
committerbeck <>2000-12-15 02:58:47 +0000
commit9200bb13d15da4b2a23e6bc92c20e95b74aa2113 (patch)
tree5c52d628ec1e34be76e7ef2a4235d248b7c44d24 /src/lib/libcrypto/des
parente131d25072e3d4197ba4b9bcc0d1b27d34d6488d (diff)
downloadopenbsd-9200bb13d15da4b2a23e6bc92c20e95b74aa2113.tar.gz
openbsd-9200bb13d15da4b2a23e6bc92c20e95b74aa2113.tar.bz2
openbsd-9200bb13d15da4b2a23e6bc92c20e95b74aa2113.zip
openssl-engine-0.9.6 merge
Diffstat (limited to 'src/lib/libcrypto/des')
-rw-r--r--src/lib/libcrypto/des/Makefile.ssl17
-rw-r--r--src/lib/libcrypto/des/des.c4
-rw-r--r--src/lib/libcrypto/des/des.h9
-rw-r--r--src/lib/libcrypto/des/enc_read.c6
-rw-r--r--src/lib/libcrypto/des/enc_writ.c2
-rw-r--r--src/lib/libcrypto/des/qud_cksm.c12
-rw-r--r--src/lib/libcrypto/des/read_pwd.c20
7 files changed, 46 insertions, 24 deletions
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
162enc_read.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 162enc_read.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
163enc_read.o: ../../include/openssl/crypto.h ../../include/openssl/des.h 163enc_read.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
164enc_read.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 164enc_read.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
165enc_read.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 165enc_read.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
166enc_read.o: ../../include/openssl/opensslconf.h
166enc_read.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 167enc_read.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
167enc_read.o: ../../include/openssl/stack.h ../cryptlib.h des_locl.h 168enc_read.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
169enc_read.o: ../cryptlib.h des_locl.h
168enc_writ.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 170enc_writ.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
169enc_writ.o: ../../include/openssl/crypto.h ../../include/openssl/des.h 171enc_writ.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
170enc_writ.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 172enc_writ.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
171enc_writ.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 173enc_writ.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
174enc_writ.o: ../../include/openssl/opensslconf.h
172enc_writ.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h 175enc_writ.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
173enc_writ.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 176enc_writ.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
174enc_writ.o: ../cryptlib.h des_locl.h 177enc_writ.o: ../../include/openssl/symhacks.h ../cryptlib.h des_locl.h
175fcrypt.o: ../../include/openssl/des.h ../../include/openssl/e_os2.h 178fcrypt.o: ../../include/openssl/des.h ../../include/openssl/e_os2.h
176fcrypt.o: ../../include/openssl/opensslconf.h des_locl.h 179fcrypt.o: ../../include/openssl/opensslconf.h des_locl.h
177fcrypt_b.o: ../../include/openssl/des.h ../../include/openssl/e_os2.h 180fcrypt_b.o: ../../include/openssl/des.h ../../include/openssl/e_os2.h
@@ -193,9 +196,11 @@ read2pwd.o: ../../include/openssl/opensslconf.h des_locl.h
193read_pwd.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 196read_pwd.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
194read_pwd.o: ../../include/openssl/crypto.h ../../include/openssl/des.h 197read_pwd.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
195read_pwd.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 198read_pwd.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
196read_pwd.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 199read_pwd.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
200read_pwd.o: ../../include/openssl/opensslconf.h
197read_pwd.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 201read_pwd.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
198read_pwd.o: ../../include/openssl/stack.h ../cryptlib.h des_locl.h 202read_pwd.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
203read_pwd.o: ../cryptlib.h des_locl.h
199rpc_enc.o: ../../include/openssl/des.h ../../include/openssl/e_os2.h 204rpc_enc.o: ../../include/openssl/des.h ../../include/openssl/e_os2.h
200rpc_enc.o: ../../include/openssl/opensslconf.h des_locl.h des_ver.h rpc_des.h 205rpc_enc.o: ../../include/openssl/opensslconf.h des_locl.h des_ver.h rpc_des.h
201set_key.o: ../../include/openssl/des.h ../../include/openssl/e_os2.h 206set_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)
374 374
375 if (buf == NULL) 375 if (buf == NULL)
376 { 376 {
377 if ( (( buf=Malloc(BUFSIZE+8)) == NULL) || 377 if ( (( buf=OPENSSL_malloc(BUFSIZE+8)) == NULL) ||
378 ((obuf=Malloc(BUFSIZE+8)) == NULL)) 378 ((obuf=OPENSSL_malloc(BUFSIZE+8)) == NULL))
379 { 379 {
380 fputs("Not enough memory\n",stderr); 380 fputs("Not enough memory\n",stderr);
381 Exit=10; 381 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 @@
59#ifndef HEADER_DES_H 59#ifndef HEADER_DES_H
60#define HEADER_DES_H 60#define HEADER_DES_H
61 61
62#ifdef __cplusplus
63extern "C" {
64#endif
65
66#ifdef NO_DES 62#ifdef NO_DES
67#error DES is disabled. 63#error DES is disabled.
68#endif 64#endif
@@ -71,10 +67,13 @@ extern "C" {
71#error <openssl/des.h> replaces <kerberos/des.h>. 67#error <openssl/des.h> replaces <kerberos/des.h>.
72#endif 68#endif
73 69
74#include <stdio.h>
75#include <openssl/opensslconf.h> /* DES_LONG */ 70#include <openssl/opensslconf.h> /* DES_LONG */
76#include <openssl/e_os2.h> /* OPENSSL_EXTERN */ 71#include <openssl/e_os2.h> /* OPENSSL_EXTERN */
77 72
73#ifdef __cplusplus
74extern "C" {
75#endif
76
78typedef unsigned char des_cblock[8]; 77typedef unsigned char des_cblock[8];
79typedef /* const */ unsigned char const_des_cblock[8]; 78typedef /* const */ unsigned char const_des_cblock[8];
80/* With "const", gcc 2.8.1 on Solaris thinks that des_cblock * 79/* 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,
103 103
104 if (tmpbuf == NULL) 104 if (tmpbuf == NULL)
105 { 105 {
106 tmpbuf=Malloc(BSIZE); 106 tmpbuf=OPENSSL_malloc(BSIZE);
107 if (tmpbuf == NULL) return(-1); 107 if (tmpbuf == NULL) return(-1);
108 } 108 }
109 if (net == NULL) 109 if (net == NULL)
110 { 110 {
111 net=Malloc(BSIZE); 111 net=OPENSSL_malloc(BSIZE);
112 if (net == NULL) return(-1); 112 if (net == NULL) return(-1);
113 } 113 }
114 if (unnet == NULL) 114 if (unnet == NULL)
115 { 115 {
116 unnet=Malloc(BSIZE); 116 unnet=OPENSSL_malloc(BSIZE);
117 if (unnet == NULL) return(-1); 117 if (unnet == NULL) return(-1);
118 } 118 }
119 /* left over data from last decrypt */ 119 /* 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,
95 95
96 if (outbuf == NULL) 96 if (outbuf == NULL)
97 { 97 {
98 outbuf=Malloc(BSIZE+HDRSIZE); 98 outbuf=OPENSSL_malloc(BSIZE+HDRSIZE);
99 if (outbuf == NULL) return(-1); 99 if (outbuf == NULL) return(-1);
100 } 100 }
101 /* If we are sending less than 8 bytes, the same char will look 101 /* 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[],
81 long l; 81 long l;
82 const unsigned char *cp; 82 const unsigned char *cp;
83#ifdef _CRAY 83#ifdef _CRAY
84 short *lp; 84 struct lp_st { int a:32; int b:32; } *lp;
85#else 85#else
86 DES_LONG *lp; 86 DES_LONG *lp;
87#endif 87#endif
88 88
89 if (out_count < 1) out_count=1; 89 if (out_count < 1) out_count=1;
90#ifdef _CRAY
91 lp = (struct lp_st *) &(output[0])[0];
92#else
90 lp = (DES_LONG *) &(output[0])[0]; 93 lp = (DES_LONG *) &(output[0])[0];
94#endif
91 95
92 z0=Q_B0((*seed)[0])|Q_B1((*seed)[1])|Q_B2((*seed)[2])|Q_B3((*seed)[3]); 96 z0=Q_B0((*seed)[0])|Q_B1((*seed)[1])|Q_B2((*seed)[2])|Q_B3((*seed)[3]);
93 z1=Q_B0((*seed)[4])|Q_B1((*seed)[5])|Q_B2((*seed)[6])|Q_B3((*seed)[7]); 97 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[],
120 { 124 {
121 /* The MIT library assumes that the checksum is 125 /* The MIT library assumes that the checksum is
122 * composed of 2*out_count 32 bit ints */ 126 * composed of 2*out_count 32 bit ints */
127#ifdef _CRAY
128 (*lp).a = z0;
129 (*lp).b = z1;
130 lp++;
131#else
123 *lp++ = z0; 132 *lp++ = z0;
124 *lp++ = z1; 133 *lp++ = z1;
134#endif
125 } 135 }
126 } 136 }
127 return(z0); 137 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 @@
161#include <sys/ioctl.h> 161#include <sys/ioctl.h>
162#endif 162#endif
163 163
164#ifdef MSDOS 164#if defined(MSDOS) && !defined(__CYGWIN32__)
165#include <conio.h> 165#include <conio.h>
166#define fgets(a,b,c) noecho_fgets(a,b,c) 166#define fgets(a,b,c) noecho_fgets(a,b,c)
167#endif 167#endif
@@ -265,13 +265,17 @@ int des_read_pw(char *buf, char *buff, int size, const char *prompt,
265 is_a_tty=1; 265 is_a_tty=1;
266 tty=NULL; 266 tty=NULL;
267 267
268#ifndef MSDOS 268#ifdef MSDOS
269 if ((tty=fopen("/dev/tty","r")) == NULL)
270 tty=stdin;
271#else /* MSDOS */
272 if ((tty=fopen("con","r")) == NULL) 269 if ((tty=fopen("con","r")) == NULL)
273 tty=stdin; 270 tty=stdin;
274#endif /* MSDOS */ 271#elif defined(MAC_OS_pre_X)
272 tty=stdin;
273#else
274#ifndef MPE
275 if ((tty=fopen("/dev/tty","r")) == NULL)
276#endif
277 tty=stdin;
278#endif
275 279
276#if defined(TTY_get) && !defined(VMS) 280#if defined(TTY_get) && !defined(VMS)
277 if (TTY_get(fileno(tty),&tty_orig) == -1) 281 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,
310 314
311#if defined(TTY_set) && !defined(VMS) 315#if defined(TTY_set) && !defined(VMS)
312 if (is_a_tty && (TTY_set(fileno(tty),&tty_new) == -1)) 316 if (is_a_tty && (TTY_set(fileno(tty),&tty_new) == -1))
317#ifdef MPE
318 ; /* MPE lies -- echo really has been disabled */
319#else
313 return(-1); 320 return(-1);
314#endif 321#endif
322#endif
315#ifdef VMS 323#ifdef VMS
316 tty_new[0] = tty_orig[0]; 324 tty_new[0] = tty_orig[0];
317 tty_new[1] = tty_orig[1] | TT$M_NOECHO; 325 tty_new[1] = tty_orig[1] | TT$M_NOECHO;