summaryrefslogtreecommitdiff
path: root/secure/lib/libdes/enc_writ.c
diff options
context:
space:
mode:
authorMark Murray <markm@FreeBSD.org>1996-07-28 08:18:06 +0000
committerMark Murray <markm@FreeBSD.org>1996-07-28 08:18:06 +0000
commit9f2bc96e404f71130e59e6fb73114d7976c1e626 (patch)
tree4462567f6eb34de1cc9570e7ccd0c7fbd5f8f3e9 /secure/lib/libdes/enc_writ.c
parent6a1ae88452437db30412d3568cdf34ccb652917b (diff)
parentde59bba0c50ad5885f6f8699e2cf16f5fe63b2af (diff)
Notes
Diffstat (limited to 'secure/lib/libdes/enc_writ.c')
-rw-r--r--secure/lib/libdes/enc_writ.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/secure/lib/libdes/enc_writ.c b/secure/lib/libdes/enc_writ.c
index e0d50751f7ed..0b7a50be9d23 100644
--- a/secure/lib/libdes/enc_writ.c
+++ b/secure/lib/libdes/enc_writ.c
@@ -1,5 +1,5 @@
-/* lib/des/enc_writ.c */
-/* Copyright (C) 1995 Eric Young (eay@mincom.oz.au)
+/* crypto/des/enc_writ.c */
+/* Copyright (C) 1995-1996 Eric Young (eay@mincom.oz.au)
* All rights reserved.
*
* This file is part of an SSL implementation written
@@ -65,11 +65,16 @@ des_cblock (*iv);
long rnum;
int i,j,k,outnum;
- char outbuf[BSIZE+HDRSIZE];
+ char *outbuf=NULL;
char shortbuf[8];
char *p;
static int start=1;
+ if (outbuf == NULL)
+ {
+ outbuf=(char *)malloc(BSIZE+HDRSIZE);
+ if (outbuf == NULL) return(-1);
+ }
/* If we are sending less than 8 bytes, the same char will look
* the same if we don't pad it out with random bytes */
if (start)
@@ -114,14 +119,16 @@ des_cblock (*iv);
}
if (des_rw_mode & DES_PCBC_MODE)
- pcbc_encrypt((des_cblock *)p,(des_cblock *)&(outbuf[HDRSIZE]),
+ des_pcbc_encrypt((des_cblock *)p,
+ (des_cblock *)&(outbuf[HDRSIZE]),
(long)((len<8)?8:len),sched,iv,DES_ENCRYPT);
else
- cbc_encrypt((des_cblock *)p,(des_cblock *)&(outbuf[HDRSIZE]),
+ des_cbc_encrypt((des_cblock *)p,
+ (des_cblock *)&(outbuf[HDRSIZE]),
(long)((len<8)?8:len),sched,iv,DES_ENCRYPT);
/* output */
- outnum=rnum+HDRSIZE;
+ outnum=(int)rnum+HDRSIZE;
for (j=0; j<outnum; j+=i)
{