summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/des/enc_writ.c
diff options
context:
space:
mode:
authorbeck <>2000-03-19 11:13:58 +0000
committerbeck <>2000-03-19 11:13:58 +0000
commit796d609550df3a33fc11468741c5d2f6d3df4c11 (patch)
tree6c6d539061caa20372dad0ac4ddb1dfae2fbe7fe /src/lib/libcrypto/des/enc_writ.c
parent5be3114c1fd7e0dfea1e38d3abb4cbba75244419 (diff)
downloadopenbsd-796d609550df3a33fc11468741c5d2f6d3df4c11.tar.gz
openbsd-796d609550df3a33fc11468741c5d2f6d3df4c11.tar.bz2
openbsd-796d609550df3a33fc11468741c5d2f6d3df4c11.zip
OpenSSL 0.9.5 merge
*warning* this bumps shared lib minors for libssl and libcrypto from 2.1 to 2.2 if you are using the ssl26 packages for ssh and other things to work you will need to get new ones (see ~beck/libsslsnap/<arch>) on cvs or ~beck/src-patent.tar.gz on cvs
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 }