projects
/
oweals
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Better description of the behaviour of SSL_shutdown() as it is now, broken
[oweals/openssl.git]
/
crypto
/
des
/
enc_read.c
diff --git
a/crypto/des/enc_read.c
b/crypto/des/enc_read.c
index 23768daeefee9bf136f1208e5b66d05acf48bedf..5881caf3d54cf4ab0c73073790d58db2af41cdd5 100644
(file)
--- a/
crypto/des/enc_read.c
+++ b/
crypto/des/enc_read.c
@@
-63,7
+63,7
@@
/* This has some uglies in it but it works - even over sockets. */
/*extern int errno;*/
/* This has some uglies in it but it works - even over sockets. */
/*extern int errno;*/
-
int des_rw_mode
=DES_PCBC_MODE;
+
OPENSSL_IMPLEMENT_GLOBAL(int,des_rw_mode)
=DES_PCBC_MODE;
/*
/*
@@
-84,8
+84,8
@@
int des_rw_mode=DES_PCBC_MODE;
*/
*/
-int des_enc_read(int fd,
char *buf, int len, des_key_schedule
sched,
-
des_cblock
iv)
+int des_enc_read(int fd,
void *buf, int len, des_key_schedule *
sched,
+
des_cblock *
iv)
{
/* data to be unencrypted */
int net_num=0;
{
/* data to be unencrypted */
int net_num=0;
@@
-103,17
+103,17
@@
int des_enc_read(int fd, char *buf, int len, des_key_schedule sched,
if (tmpbuf == NULL)
{
if (tmpbuf == NULL)
{
- tmpbuf=
M
alloc(BSIZE);
+ tmpbuf=
OPENSSL_m
alloc(BSIZE);
if (tmpbuf == NULL) return(-1);
}
if (net == NULL)
{
if (tmpbuf == NULL) return(-1);
}
if (net == NULL)
{
- net=
M
alloc(BSIZE);
+ net=
OPENSSL_m
alloc(BSIZE);
if (net == NULL) return(-1);
}
if (unnet == NULL)
{
if (net == NULL) return(-1);
}
if (unnet == NULL)
{
- unnet=
M
alloc(BSIZE);
+ unnet=
OPENSSL_m
alloc(BSIZE);
if (unnet == NULL) return(-1);
}
/* left over data from last decrypt */
if (unnet == NULL) return(-1);
}
/* left over data from last decrypt */
@@
-125,7
+125,7
@@
int des_enc_read(int fd, char *buf, int len, des_key_schedule sched,
* with the number of bytes we have - should always
* check the return value */
memcpy(buf,&(unnet[unnet_start]),
* with the number of bytes we have - should always
* check the return value */
memcpy(buf,&(unnet[unnet_start]),
-
(unsigned int)
unnet_left);
+ unnet_left);
/* eay 26/08/92 I had the next 2 lines
* reversed :-( */
i=unnet_left;
/* eay 26/08/92 I had the next 2 lines
* reversed :-( */
i=unnet_left;
@@
-133,7
+133,7
@@
int des_enc_read(int fd, char *buf, int len, des_key_schedule sched,
}
else
{
}
else
{
- memcpy(buf,&(unnet[unnet_start]),
(unsigned int)
len);
+ memcpy(buf,&(unnet[unnet_start]),len);
unnet_start+=len;
unnet_left-=len;
i=len;
unnet_start+=len;
unnet_left-=len;
i=len;
@@
-147,7
+147,7
@@
int des_enc_read(int fd, char *buf, int len, des_key_schedule sched,
/* first - get the length */
while (net_num < HDRSIZE)
{
/* first - get the length */
while (net_num < HDRSIZE)
{
- i=read(fd,&(net[net_num]),HDRSIZE-net_num);
+ i=read(fd,
(void *)
&(net[net_num]),HDRSIZE-net_num);
#ifdef EINTR
if ((i == -1) && (errno == EINTR)) continue;
#endif
#ifdef EINTR
if ((i == -1) && (errno == EINTR)) continue;
#endif
@@
-169,7
+169,7
@@
int des_enc_read(int fd, char *buf, int len, des_key_schedule sched,
net_num=0;
while (net_num < rnum)
{
net_num=0;
while (net_num < rnum)
{
- i=read(fd,&(net[net_num]),rnum-net_num);
+ i=read(fd,
(void *)
&(net[net_num]),rnum-net_num);
#ifdef EINTR
if ((i == -1) && (errno == EINTR)) continue;
#endif
#ifdef EINTR
if ((i == -1) && (errno == EINTR)) continue;
#endif
@@
-184,9
+184,9
@@
int des_enc_read(int fd, char *buf, int len, des_key_schedule sched,
des_pcbc_encrypt(net,unnet,num,sched,iv,DES_DECRYPT);
else
des_cbc_encrypt(net,unnet,num,sched,iv,DES_DECRYPT);
des_pcbc_encrypt(net,unnet,num,sched,iv,DES_DECRYPT);
else
des_cbc_encrypt(net,unnet,num,sched,iv,DES_DECRYPT);
- memcpy(buf,unnet,
(unsigned int)
len);
+ memcpy(buf,unnet,len);
unnet_start=len;
unnet_start=len;
- unnet_left=
(int)
num-len;
+ unnet_left=num-len;
/* The following line is done because we return num
* as the number of bytes read. */
/* The following line is done because we return num
* as the number of bytes read. */
@@
-211,7
+211,7
@@
int des_enc_read(int fd, char *buf, int len, des_key_schedule sched,
/* eay 26/08/92 fix a bug that returned more
* bytes than you asked for (returned len bytes :-( */
/* eay 26/08/92 fix a bug that returned more
* bytes than you asked for (returned len bytes :-( */
- memcpy(buf,tmpbuf,
(unsigned int)
num);
+ memcpy(buf,tmpbuf,num);
}
else
{
}
else
{
@@
-223,6
+223,6
@@
int des_enc_read(int fd, char *buf, int len, des_key_schedule sched,
DES_DECRYPT);
}
}
DES_DECRYPT);
}
}
- return
((int)num)
;
+ return
num
;
}
}