summaryrefslogtreecommitdiffstats
path: root/tools/firmware-utils
diff options
context:
space:
mode:
authorjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2011-06-13 08:12:41 +0000
committerjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2011-06-13 08:12:41 +0000
commit02388a2e16611e9d78c1adcba1a23e5dac909e68 (patch)
tree7c69bd73bd703a547ec61ed0967c7abf84d6327e /tools/firmware-utils
parent63dccaf23b04b6afc98013df169255f100fb534e (diff)
tools/firmware-utils: fix buffalo csum calculation
Also print an error message if decryption fails. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@27167 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'tools/firmware-utils')
-rw-r--r--tools/firmware-utils/src/buffalo-enc.c4
-rw-r--r--tools/firmware-utils/src/buffalo-lib.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/tools/firmware-utils/src/buffalo-enc.c b/tools/firmware-utils/src/buffalo-enc.c
index 94de53e91..13d270b3f 100644
--- a/tools/firmware-utils/src/buffalo-enc.c
+++ b/tools/firmware-utils/src/buffalo-enc.c
@@ -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);
diff --git a/tools/firmware-utils/src/buffalo-lib.c b/tools/firmware-utils/src/buffalo-lib.c
index 00ad1a5c1..29aee9f88 100644
--- a/tools/firmware-utils/src/buffalo-lib.c
+++ b/tools/firmware-utils/src/buffalo-lib.c
@@ -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;