From edf0bfb52b46bb9c8bf44e9c486be60c7087618c Mon Sep 17 00:00:00 2001 From: Bodo Möller Date: Sun, 16 May 1999 12:26:16 +0000 Subject: Change type of various DES function arguments from des_cblock (meaning pointer to char) to des_cblock * (meaning pointer to array with 8 char elements), which allows the compiler to do more typechecking. (The changed argument types were of type des_cblock * back in SSLeay, and a lot of ugly casts were used then to turn them into pointers to elements; but it can be done without those casts.) Introduce new type const_des_cblock -- before, the pointers rather than the elements pointed to were declared const, and for some reason gcc did not complain about this (but some other compilers did). --- crypto/des/str2key.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'crypto/des/str2key.c') diff --git a/crypto/des/str2key.c b/crypto/des/str2key.c index 674079b14b..24841452f1 100644 --- a/crypto/des/str2key.c +++ b/crypto/des/str2key.c @@ -60,7 +60,7 @@ OPENSSL_EXTERN int des_check_key; -void des_string_to_key(const char *str, des_cblock key) +void des_string_to_key(const char *str, des_cblock *key) { des_key_schedule ks; int i,length; @@ -70,20 +70,20 @@ void des_string_to_key(const char *str, des_cblock key) length=strlen(str); #ifdef OLD_STR_TO_KEY for (i=0; i>4)&0x0f); j=((j<<2)&0xcc)|((j>>2)&0x33); j=((j<<1)&0xaa)|((j>>1)&0x55); - key[7-(i%8)]^=j; + (*key)[7-(i%8)]^=j; } } #endif @@ -97,7 +97,7 @@ void des_string_to_key(const char *str, des_cblock key) des_set_odd_parity(key); } -void des_string_to_2keys(const char *str, des_cblock key1, des_cblock key2) +void des_string_to_2keys(const char *str, des_cblock *key1, des_cblock *key2) { des_key_schedule ks; int i,length; @@ -111,7 +111,7 @@ void des_string_to_2keys(const char *str, des_cblock key1, des_cblock key2) { for (i=0; i>2)&0x33); j=((j<<1)&0xaa)|((j>>1)&0x55); if ((i%16) < 8) - key1[7-(i%8)]^=j; + (*key1)[7-(i%8)]^=j; else - key2[7-(i%8)]^=j; + (*key2)[7-(i%8)]^=j; } } if (length <= 8) memcpy(key2,key1,8); -- cgit v1.2.3