summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/des/enc_writ.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/des/enc_writ.c')
-rw-r--r--src/lib/libcrypto/des/enc_writ.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/lib/libcrypto/des/enc_writ.c b/src/lib/libcrypto/des/enc_writ.c
index ba3f0822ef..4d3452724e 100644
--- a/src/lib/libcrypto/des/enc_writ.c
+++ b/src/lib/libcrypto/des/enc_writ.c
@@ -130,12 +130,12 @@ int des_enc_write(int fd, const void *_buf, int len,
130 { 130 {
131 cp=shortbuf; 131 cp=shortbuf;
132 memcpy(shortbuf,buf,len); 132 memcpy(shortbuf,buf,len);
133 RAND_bytes(shortbuf+len, 8-len); 133 RAND_pseudo_bytes(shortbuf+len, 8-len);
134 rnum=8; 134 rnum=8;
135 } 135 }
136 else 136 else
137 { 137 {
138 cp=(unsigned char*)buf; 138 cp=buf;
139 rnum=((len+7)/8*8); /* round up to nearest eight */ 139 rnum=((len+7)/8*8); /* round up to nearest eight */
140 } 140 }
141 141
@@ -152,13 +152,16 @@ int des_enc_write(int fd, const void *_buf, int len,
152 for (j=0; j<outnum; j+=i) 152 for (j=0; j<outnum; j+=i)
153 { 153 {
154 /* eay 26/08/92 I was not doing writing from where we 154 /* eay 26/08/92 I was not doing writing from where we
155 * got upto. */ 155 * got up to. */
156 i=write(fd,&(outbuf[j]),outnum-j); 156 i=write(fd,(void *)&(outbuf[j]),outnum-j);
157 if (i == -1) 157 if (i == -1)
158 { 158 {
159#ifdef EINTR
159 if (errno == EINTR) 160 if (errno == EINTR)
160 i=0; 161 i=0;
161 else /* This is really a bad error - very bad 162 else
163#endif
164 /* This is really a bad error - very bad
162 * It will stuff-up both ends. */ 165 * It will stuff-up both ends. */
163 return(-1); 166 return(-1);
164 } 167 }