tools/firmware-utils: fix buffalo csum calculation
authorGabor Juhos <juhosg@openwrt.org>
Mon, 13 Jun 2011 08:12:41 +0000 (08:12 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Mon, 13 Jun 2011 08:12:41 +0000 (08:12 +0000)
Also print an error message if decryption fails.

SVN-Revision: 27167

tools/firmware-utils/src/buffalo-enc.c
tools/firmware-utils/src/buffalo-lib.c

index 94de53e91053cc2142f2f3de2da20c8b2d16a719..13d270b3f73598fa7d520318e6cb480f128f32ac 100644 (file)
@@ -87,8 +87,10 @@ static int decrypt_file(void)
        ep.key = (unsigned char *) crypt_key;
 
        err = decrypt_buf(&ep, buf, src_len);
-       if (err)
+       if (err) {
+               ERR("unable to decrypt '%s'", ifname);
                goto out;
+       }
 
        printf("Magic\t\t: '%s'\n", ep.magic);
        printf("Seed\t\t: 0x%02x\n", ep.seed);
index 00ad1a5c10f2ecaa92de9cf09124c473033d5603..29aee9f88dd44e874499ee5477d2a3a4b8cc9d87 100644 (file)
@@ -179,7 +179,7 @@ int bcrypt_buf(unsigned char seed, unsigned char *key, unsigned char *src,
 
 uint32_t buffalo_csum(uint32_t csum, void *buf, unsigned long len)
 {
-       unsigned char *p = buf;
+       char *p = buf;
 
        while (len--) {
                int i;