crypt-take-voids-20041005
authorJim Rees <rees@umich.edu>
Tue, 5 Oct 2004 21:40:59 +0000 (21:40 +0000)
committerJim Rees <rees@umich.edu>
Tue, 5 Oct 2004 21:40:59 +0000 (21:40 +0000)
make various crypt/decrypt routines take void * args to eliminate more
compiler warnings

src/des/cbc_encrypt.c
src/des/des.c
src/des/des_prototypes.h
src/des/pcbc_encrypt.c
src/rxkad/rxkad_prototypes.h

index 5583f03..a2c8a52 100644 (file)
@@ -61,7 +61,7 @@ RCSID
     des_cblock *iv;            * 8 bytes of ivec *
 */
 afs_int32
-des_cbc_encrypt(des_cblock * in, des_cblock * out, register afs_int32 length,
+des_cbc_encrypt(void * in, void * out, register afs_int32 length,
                des_key_schedule key, des_cblock * iv, int encrypt)
 {
     register afs_uint32 *input = (afs_uint32 *) in;
index 732e266..d6d6522 100644 (file)
@@ -72,7 +72,7 @@ pthread_mutex_t rxkad_stats_mutex;
 /* encrypt == 0  ==> decrypt, else encrypt */
 
 afs_int32
-des_ecb_encrypt(afs_uint32 * clear, afs_uint32 * cipher,
+des_ecb_encrypt(void * clear, void * cipher,
                register des_key_schedule schedule, int encrypt)
 {
     /* better pass 8 bytes, length not checked here */
@@ -137,11 +137,11 @@ des_ecb_encrypt(afs_uint32 * clear, afs_uint32 * cipher,
 #endif
     {
        if (clear)
-           L1 = *clear++;
+           L1 = *((afs_int32 *)clear)++;
        else
            L1 = 0;
        if (clear)
-           R1 = *clear;
+           R1 = *((afs_int32 *)clear);
        else
            R1 = 0;
     }
@@ -446,8 +446,8 @@ des_ecb_encrypt(afs_uint32 * clear, afs_uint32 * cipher,
     } else
 #endif
     {
-       *cipher++ = L2;
-       *cipher = R2;
+       *((afs_int32 *)cipher)++ = L2;
+       *((afs_int32 *)cipher) = R2;
     }
 
 #ifdef DEBUG
index d7871d2..dee7c20 100644 (file)
@@ -18,19 +18,19 @@ extern void test_set(FILE * stream, const char *src, int testbit,
 extern int des_debug;
 
 /* cbc_encrypt.c */
-extern afs_int32 des_cbc_encrypt(des_cblock * in, des_cblock * out,
+extern afs_int32 des_cbc_encrypt(void * in, void * out,
                                 register afs_int32 length,
                                 des_key_schedule key, des_cblock * iv,
                                 int encrypt);
 
 /* pcbc_encrypt.c */
-extern afs_int32 des_pcbc_encrypt(des_cblock * in, des_cblock * out,
+extern afs_int32 des_pcbc_encrypt(void * in, void * out,
                                  register afs_int32 length,
                                  des_key_schedule key, des_cblock * iv,
                                  int encrypt);
 
 /* des.c */
-extern afs_int32 des_ecb_encrypt(afs_uint32 * clear, afs_uint32 * cipher,
+extern afs_int32 des_ecb_encrypt(void * clear, void * cipher,
                                 register des_key_schedule schedule,
                                 int encrypt);
 
index 854d3b0..12a22a8 100644 (file)
@@ -74,7 +74,7 @@ RCSID
     des_cblock *iv;             * 8 bytes of ivec *
 */
 afs_int32
-des_pcbc_encrypt(des_cblock * in, des_cblock * out, register afs_int32 length,
+des_pcbc_encrypt(void * in, void * out, register afs_int32 length,
                 des_key_schedule key, des_cblock * iv, int encrypt)
 {
     register afs_uint32 *input = (afs_uint32 *) in;
index adffe54..471b8ac 100644 (file)
@@ -28,9 +28,9 @@ extern afs_int32 rxkad_EncryptPacket(const struct rx_connection *conn,
 /* domestic/fcrypt.c */
 extern int fc_keysched(struct ktc_encryptionKey *key,
                       fc_KeySchedule schedule);
-extern afs_int32 fc_ecb_encrypt(afs_uint32 * clear, afs_uint32 * cipher,
+extern afs_int32 fc_ecb_encrypt(void * clear, void * cipher,
                                fc_KeySchedule schedule, int encrypt);
-extern afs_int32 fc_cbc_encrypt(char *input, char *output, afs_int32 length,
+extern afs_int32 fc_cbc_encrypt(void *input, void *output, afs_int32 length,
                                fc_KeySchedule key, afs_uint32 * xor,
                                int encrypt);