From: Gabor Juhos Date: Mon, 13 Jun 2011 08:12:41 +0000 (+0000) Subject: tools/firmware-utils: fix buffalo csum calculation X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=0d7a558f23b6bc421e9c0ab69c73576501523e68;p=openwrt%2Fstaging%2Frmilecki.git tools/firmware-utils: fix buffalo csum calculation Also print an error message if decryption fails. SVN-Revision: 27167 --- diff --git a/tools/firmware-utils/src/buffalo-enc.c b/tools/firmware-utils/src/buffalo-enc.c index 94de53e9105..13d270b3f73 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 00ad1a5c10f..29aee9f88dd 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;