if (tmpbuf == NULL)
{
- tmpbuf=(unsigned char *)Malloc(BSIZE);
+ tmpbuf=Malloc(BSIZE);
if (tmpbuf == NULL) return(-1);
}
if (net == NULL)
{
- net=(unsigned char *)Malloc(BSIZE);
+ net=Malloc(BSIZE);
if (net == NULL) return(-1);
}
if (unnet == NULL)
{
- unnet=(unsigned char *)Malloc(BSIZE);
+ unnet=Malloc(BSIZE);
if (unnet == NULL) return(-1);
}
/* left over data from last decrypt */
/* first - get the length */
while (net_num < HDRSIZE)
{
- i=read(fd,&(net[net_num]),(unsigned int)HDRSIZE-net_num);
+ i=read(fd,&(net[net_num]),HDRSIZE-net_num);
#ifdef EINTR
if ((i == -1) && (errno == EINTR)) continue;
#endif
net_num=0;
while (net_num < rnum)
{
- i=read(fd,&(net[net_num]),(unsigned int)rnum-net_num);
+ i=read(fd,&(net[net_num]),rnum-net_num);
#ifdef EINTR
if ((i == -1) && (errno == EINTR)) continue;
#endif
else
{
if (des_rw_mode & DES_PCBC_MODE)
- des_pcbc_encrypt(net,(unsigned char*)buf,num,
- sched,iv,DES_DECRYPT);
+ des_pcbc_encrypt(net,buf,num,sched,iv,
+ DES_DECRYPT);
else
- des_cbc_encrypt(net,(unsigned char*)buf,num,
- sched,iv,DES_DECRYPT);
+ des_cbc_encrypt(net,buf,num,sched,iv,
+ DES_DECRYPT);
}
}
return((int)num);
if (outbuf == NULL)
{
- outbuf=(unsigned char *)Malloc(BSIZE+HDRSIZE);
+ outbuf=Malloc(BSIZE+HDRSIZE);
if (outbuf == NULL) return(-1);
}
/* If we are sending less than 8 bytes, the same char will look
if (start)
{
start=0;
- srandom((unsigned int)time(NULL));
+ srandom(time(NULL));
}
/* lets recurse if we want to send the data in small chunks */
if (len < 8)
{
cp=shortbuf;
- memcpy(shortbuf,buf,(unsigned int)len);
+ memcpy(shortbuf,buf,len);
for (i=len; i<8; i++)
shortbuf[i]=random();
rnum=8;
DES_ENCRYPT);
/* output */
- outnum=(int)rnum+HDRSIZE;
+ outnum=rnum+HDRSIZE;
for (j=0; j<outnum; j+=i)
{
/* eay 26/08/92 I was not doing writing from where we
* got upto. */
- i=write(fd,&(outbuf[j]),(unsigned int)(outnum-j));
+ i=write(fd,&(outbuf[j]),outnum-j);
if (i == -1)
{
if (errno == EINTR)