diff options
author | Ben Laurie <ben@openssl.org> | 1999-04-23 15:01:15 +0000 |
---|---|---|
committer | Ben Laurie <ben@openssl.org> | 1999-04-23 15:01:15 +0000 |
commit | 61f5b6f33807306d09bccbc2dcad474d1d04ca40 (patch) | |
tree | 1680fa648df5f730df11ec433a512a1fadf0facd /crypto/des | |
parent | 779cc0bca98e35830db455f34b986b86a2d2f822 (diff) |
Work with -pedantic!
Diffstat (limited to 'crypto/des')
-rw-r--r-- | crypto/des/Makefile.ssl | 52 | ||||
-rw-r--r-- | crypto/des/des.h | 4 | ||||
-rw-r--r-- | crypto/des/destest.c | 21 | ||||
-rw-r--r-- | crypto/des/enc_read.c | 16 | ||||
-rw-r--r-- | crypto/des/enc_writ.c | 8 |
5 files changed, 52 insertions, 49 deletions
diff --git a/crypto/des/Makefile.ssl b/crypto/des/Makefile.ssl index 1626f496fa..084934793e 100644 --- a/crypto/des/Makefile.ssl +++ b/crypto/des/Makefile.ssl @@ -136,35 +136,35 @@ errors: # DO NOT DELETE THIS LINE -- make depend depends on it. -cbc_cksm.o: des.h des_locl.h -cbc_enc.o: des.h des_locl.h -cfb64ede.o: des.h des_locl.h -cfb64enc.o: des.h des_locl.h -cfb_enc.o: des.h des_locl.h -des_enc.o: des.h des_locl.h -ecb3_enc.o: des.h des_locl.h -ecb_enc.o: ../opensslv.h des.h des_locl.h spr.h -ede_cbcm_enc.o: des.h des_locl.h +cbc_cksm.o: ../opensslconf.h des.h des_locl.h +cbc_enc.o: ../opensslconf.h des.h des_locl.h +cfb64ede.o: ../opensslconf.h des.h des_locl.h +cfb64enc.o: ../opensslconf.h des.h des_locl.h +cfb_enc.o: ../opensslconf.h des.h des_locl.h +des_enc.o: ../opensslconf.h des.h des_locl.h +ecb3_enc.o: ../opensslconf.h des.h des_locl.h +ecb_enc.o: ../opensslconf.h ../opensslv.h des.h des_locl.h spr.h +ede_cbcm_enc.o: ../opensslconf.h des.h des_locl.h enc_read.o: ../../include/bio.h ../../include/buffer.h ../../include/e_os.h enc_read.o: ../../include/err.h ../../include/stack.h ../cryptlib.h ../crypto.h -enc_read.o: ../opensslv.h des.h des_locl.h +enc_read.o: ../opensslconf.h ../opensslv.h des.h des_locl.h enc_writ.o: ../../include/bio.h ../../include/buffer.h ../../include/e_os.h enc_writ.o: ../../include/err.h ../../include/stack.h ../cryptlib.h ../crypto.h -enc_writ.o: ../opensslv.h des.h des_locl.h -fcrypt.o: des.h des.h des_locl.h des_locl.h -fcrypt_b.o: des.h des_locl.h -ofb64ede.o: des.h des_locl.h -ofb64enc.o: des.h des_locl.h -ofb_enc.o: des.h des_locl.h -pcbc_enc.o: des.h des_locl.h -qud_cksm.o: des.h des_locl.h -rand_key.o: des.h des_locl.h -read2pwd.o: des.h des_locl.h +enc_writ.o: ../opensslconf.h ../opensslv.h des.h des_locl.h +fcrypt.o: ../opensslconf.h ../opensslconf.h des.h des.h des_locl.h des_locl.h +fcrypt_b.o: ../opensslconf.h des.h des_locl.h +ofb64ede.o: ../opensslconf.h des.h des_locl.h +ofb64enc.o: ../opensslconf.h des.h des_locl.h +ofb_enc.o: ../opensslconf.h des.h des_locl.h +pcbc_enc.o: ../opensslconf.h des.h des_locl.h +qud_cksm.o: ../opensslconf.h des.h des_locl.h +rand_key.o: ../opensslconf.h des.h des_locl.h +read2pwd.o: ../opensslconf.h des.h des_locl.h read_pwd.o: ../../include/bio.h ../../include/buffer.h ../../include/e_os.h read_pwd.o: ../../include/err.h ../../include/stack.h ../cryptlib.h ../crypto.h -read_pwd.o: ../opensslv.h des.h des_locl.h -rpc_enc.o: des.h des_locl.h des_ver.h rpc_des.h -set_key.o: des.h des_locl.h podd.h sk.h -str2key.o: des.h des_locl.h -supp.o: des.h des_locl.h -xcbc_enc.o: des.h des_locl.h +read_pwd.o: ../opensslconf.h ../opensslv.h des.h des_locl.h +rpc_enc.o: ../opensslconf.h des.h des_locl.h des_ver.h rpc_des.h +set_key.o: ../opensslconf.h des.h des_locl.h podd.h sk.h +str2key.o: ../opensslconf.h des.h des_locl.h +supp.o: ../opensslconf.h des.h des_locl.h +xcbc_enc.o: ../opensslconf.h des.h des_locl.h diff --git a/crypto/des/des.h b/crypto/des/des.h index 64c9613886..54f18c7091 100644 --- a/crypto/des/des.h +++ b/crypto/des/des.h @@ -182,9 +182,9 @@ void des_ede3_ofb64_encrypt(const unsigned char *in,unsigned char *out, void des_xwhite_in2out(const des_cblock des_key,const des_cblock in_white, des_cblock out_white); -int des_enc_read(int fd,char *buf,int len,des_key_schedule sched, +int des_enc_read(int fd,void *buf,int len,des_key_schedule sched, des_cblock iv); -int des_enc_write(int fd,const char *buf,int len,des_key_schedule sched, +int des_enc_write(int fd,const void *buf,int len,des_key_schedule sched, des_cblock iv); char *des_fcrypt(const char *buf,const char *salt, char *ret); #if defined(PERL5) || defined(__FreeBSD__) diff --git a/crypto/des/destest.c b/crypto/des/destest.c index 61e8530465..746a284d43 100644 --- a/crypto/des/destest.c +++ b/crypto/des/destest.c @@ -363,7 +363,7 @@ int main(int argc, char *argv[]) memcpy(iv3,cbc_iv,sizeof(cbc_iv)); memset(iv2,'\0',sizeof iv2); des_ede3_cbcm_encrypt(cbc_out,cbc_in,i,ks,ks2,ks3,iv3,iv2,DES_DECRYPT); - if (memcmp(cbc_in,cbc_data,strlen(cbc_data)+1) != 0) + if (memcmp(cbc_in,cbc_data,strlen((char *)cbc_data)+1) != 0) { int n; @@ -531,7 +531,7 @@ int main(int argc, char *argv[]) memcpy(iv3,cbc_iv,sizeof(cbc_iv)); des_ede3_cbc_encrypt(cbc_out,cbc_in,i,ks,ks2,ks3,iv3,DES_DECRYPT); - if (memcmp(cbc_in,cbc_data,strlen(cbc_data)+1) != 0) + if (memcmp(cbc_in,cbc_data,strlen((char *)cbc_data)+1) != 0) { printf("des_ede3_cbc_encrypt decrypt error\n"); err=1; @@ -546,16 +546,16 @@ int main(int argc, char *argv[]) } memset(cbc_out,0,40); memset(cbc_in,0,40); - des_pcbc_encrypt(cbc_data,cbc_out,strlen(cbc_data)+1,ks,cbc_iv, + des_pcbc_encrypt(cbc_data,cbc_out,strlen((char *)cbc_data)+1,ks,cbc_iv, DES_ENCRYPT); if (memcmp(cbc_out,pcbc_ok,32) != 0) { printf("pcbc_encrypt encrypt error\n"); err=1; } - des_pcbc_encrypt(cbc_out,cbc_in,strlen(cbc_data)+1,ks,cbc_iv, + des_pcbc_encrypt(cbc_out,cbc_in,strlen((char *)cbc_data)+1,ks,cbc_iv, DES_DECRYPT); - if (memcmp(cbc_in,cbc_data,strlen(cbc_data)+1) != 0) + if (memcmp(cbc_in,cbc_data,strlen((char *)cbc_data)+1) != 0) { printf("pcbc_encrypt decrypt error\n"); err=1; @@ -683,7 +683,7 @@ plain[8+4], plain[8+5], plain[8+6], plain[8+7]); printf("Doing cbc_cksum\n"); des_key_sched(cbc_key,ks); - cs=des_cbc_cksum(cbc_data,cret,strlen(cbc_data),ks,cbc_iv); + cs=des_cbc_cksum(cbc_data,cret,strlen((char *)cbc_data),ks,cbc_iv); if (cs != cbc_cksum_ret) { printf("bad return value (%08lX), should be %08lX\n", @@ -701,7 +701,8 @@ plain[8+4], plain[8+5], plain[8+6], plain[8+7]); quad_cksum returns up to 4 groups of 8 bytes, this test gets it to produce 2 groups then treats them as 4 groups of 4 bytes. Ben 13 Feb 1999 */ - cs=quad_cksum(cbc_data,(des_cblocks)qret,strlen(cbc_data),2,cbc_iv); + cs=quad_cksum(cbc_data,(des_cblocks)qret,strlen((char *)cbc_data),2, + cbc_iv); { /* Big-endian fix */ static DES_LONG l=1; @@ -763,14 +764,16 @@ plain[8+4], plain[8+5], plain[8+6], plain[8+7]); for (i=0; i<4; i++) { printf(" %d",i); - des_ncbc_encrypt(&(cbc_out[i]),cbc_in,strlen(cbc_data)+1,ks, + des_ncbc_encrypt(&(cbc_out[i]),cbc_in, + strlen((char *)cbc_data)+1,ks, cbc_iv,DES_ENCRYPT); } printf("\noutput word alignment test"); for (i=0; i<4; i++) { printf(" %d",i); - des_ncbc_encrypt(cbc_out,&(cbc_in[i]),strlen(cbc_data)+1,ks, + des_ncbc_encrypt(cbc_out,&(cbc_in[i]), + strlen((char *)cbc_data)+1,ks, cbc_iv,DES_ENCRYPT); } printf("\n"); diff --git a/crypto/des/enc_read.c b/crypto/des/enc_read.c index 23768daeef..5e256d03c2 100644 --- a/crypto/des/enc_read.c +++ b/crypto/des/enc_read.c @@ -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; @@ -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]), - (unsigned int)unnet_left); + 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 { - memcpy(buf,&(unnet[unnet_start]),(unsigned int)len); + memcpy(buf,&(unnet[unnet_start]),len); unnet_start+=len; unnet_left-=len; i=len; @@ -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); - memcpy(buf,unnet,(unsigned int)len); + memcpy(buf,unnet,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. */ @@ -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 :-( */ - memcpy(buf,tmpbuf,(unsigned int)num); + memcpy(buf,tmpbuf,num); } else { @@ -223,6 +223,6 @@ int des_enc_read(int fd, char *buf, int len, des_key_schedule sched, DES_DECRYPT); } } - return((int)num); + return num; } diff --git a/crypto/des/enc_writ.c b/crypto/des/enc_writ.c index c2b407408b..763765ec39 100644 --- a/crypto/des/enc_writ.c +++ b/crypto/des/enc_writ.c @@ -76,8 +76,8 @@ * - This code cannot handle non-blocking sockets. */ -int des_enc_write(int fd, const char *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) { #ifdef _LIBC extern int srandom(); @@ -85,12 +85,12 @@ int des_enc_write(int fd, const char *buf, int len, des_key_schedule sched, extern int random(); extern int write(); #endif - + const unsigned char *buf=_buf; long rnum; int i,j,k,outnum; static unsigned char *outbuf=NULL; unsigned char shortbuf[8]; - char *p; + unsigned char *p; const unsigned char *cp; static int start=1; |