projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
evp/e_aes_cbc_hmac_sha256.c: enable is on all AES-NI platforms, not only on AVX.
[openssl.git]
/
crypto
/
des
/
enc_writ.c
diff --git
a/crypto/des/enc_writ.c
b/crypto/des/enc_writ.c
index ea9e4b48ca3d83b43a741dc6c996aa3458632a60..2353ac1e892fd3310b68450293ad030cfc70147e 100644
(file)
--- a/
crypto/des/enc_writ.c
+++ b/
crypto/des/enc_writ.c
@@
-66,9
+66,9
@@
/*
* WARNINGS:
*
/*
* WARNINGS:
*
- * - The data format used by
des_enc_write() and des
_enc_read()
+ * - The data format used by
DES_enc_write() and DES
_enc_read()
* has a cryptographic weakness: When asked to write more
* has a cryptographic weakness: When asked to write more
- * than MAXWRITE bytes,
des
_enc_write will split the data
+ * than MAXWRITE bytes,
DES
_enc_write will split the data
* into several chunks that are all encrypted
* using the same IV. So don't use these functions unless you
* are sure you know what you do (in which case you might
* into several chunks that are all encrypted
* using the same IV. So don't use these functions unless you
* are sure you know what you do (in which case you might
@@
-77,9
+77,12
@@
* - This code cannot handle non-blocking sockets.
*/
* - This code cannot handle non-blocking sockets.
*/
-int
des
_enc_write(int fd, const void *_buf, int len,
-
des_key_schedule *sched, des
_cblock *iv)
+int
DES
_enc_write(int fd, const void *_buf, int len,
+
DES_key_schedule *sched, DES
_cblock *iv)
{
{
+#if defined(OPENSSL_NO_POSIX_IO)
+ return (-1);
+#else
#ifdef _LIBC
extern unsigned long time();
extern int write();
#ifdef _LIBC
extern unsigned long time();
extern int write();
@@
-111,7
+114,7
@@
int des_enc_write(int fd, const void *_buf, int len,
j=0;
for (i=0; i<len; i+=k)
{
j=0;
for (i=0; i<len; i+=k)
{
- k=
des
_enc_write(fd,&(buf[i]),
+ k=
DES
_enc_write(fd,&(buf[i]),
((len-i) > MAXWRITE)?MAXWRITE:(len-i),sched,iv);
if (k < 0)
return(k);
((len-i) > MAXWRITE)?MAXWRITE:(len-i),sched,iv);
if (k < 0)
return(k);
@@
-139,11
+142,11
@@
int des_enc_write(int fd, const void *_buf, int len,
rnum=((len+7)/8*8); /* round up to nearest eight */
}
rnum=((len+7)/8*8); /* round up to nearest eight */
}
- if (
des
_rw_mode & DES_PCBC_MODE)
-
des
_pcbc_encrypt(cp,&(outbuf[HDRSIZE]),(len<8)?8:len,sched,iv,
+ if (
DES
_rw_mode & DES_PCBC_MODE)
+
DES
_pcbc_encrypt(cp,&(outbuf[HDRSIZE]),(len<8)?8:len,sched,iv,
DES_ENCRYPT);
else
DES_ENCRYPT);
else
-
des
_cbc_encrypt(cp,&(outbuf[HDRSIZE]),(len<8)?8:len,sched,iv,
+
DES
_cbc_encrypt(cp,&(outbuf[HDRSIZE]),(len<8)?8:len,sched,iv,
DES_ENCRYPT);
/* output */
DES_ENCRYPT);
/* output */
@@
-153,7
+156,11
@@
int des_enc_write(int fd, const void *_buf, int len,
{
/* eay 26/08/92 I was not doing writing from where we
* got up to. */
{
/* eay 26/08/92 I was not doing writing from where we
* got up to. */
+#ifndef _WIN32
i=write(fd,(void *)&(outbuf[j]),outnum-j);
i=write(fd,(void *)&(outbuf[j]),outnum-j);
+#else
+ i=_write(fd,(void *)&(outbuf[j]),outnum-j);
+#endif
if (i == -1)
{
#ifdef EINTR
if (i == -1)
{
#ifdef EINTR
@@
-168,4
+175,5
@@
int des_enc_write(int fd, const void *_buf, int len,
}
return(len);
}
return(len);
+#endif /* OPENSSL_NO_POSIX_IO */
}
}