0.9.4claws42
[claws.git] / src / common / passcrypt.c
index 7481e1a6f73d12de1de3b903962fd065edf9f4b8..3d37cfe1b3b1c9d46ca537e8adda9dbb3c630779 100644 (file)
@@ -30,7 +30,7 @@
 
 #include "passcrypt.h"
 
-void crypt_cfb_buf(const char key[8], void *buf, unsigned len,
+void crypt_cfb_buf(const char key[8], unsigned char *buf, unsigned len,
                   unsigned chunksize, int decrypt);
 static void crypt_cfb_shift(unsigned char *to,
                            const unsigned char *from, unsigned len);
@@ -55,7 +55,7 @@ unsigned char crypt_cfb_iv[64];
 int crypt_cfb_blocksize = 8;   /* 8 for DES */
 
 void
-crypt_cfb_buf(const char key[8], void *buf, unsigned len,
+crypt_cfb_buf(const char key[8], unsigned char *buf, unsigned len,
              unsigned chunksize, int decrypt)
 {
        unsigned char temp[64];
@@ -76,12 +76,10 @@ crypt_cfb_buf(const char key[8], void *buf, unsigned len,
                if (chunksize > len)
                        chunksize = len;
                if (decrypt)
-                       crypt_cfb_shift(crypt_cfb_iv,
-                                       (unsigned char *) buf, chunksize);
+                       crypt_cfb_shift(crypt_cfb_iv, buf, chunksize);
                crypt_cfb_xor((unsigned char *) buf, temp, chunksize);
                if (!decrypt)
-                       crypt_cfb_shift(crypt_cfb_iv,
-                                       (unsigned char *) buf, chunksize);
+                       crypt_cfb_shift(crypt_cfb_iv, buf, chunksize);
                len -= chunksize;
                buf += chunksize;
        }