tools/firmware-utils: fix buffalo csum calculation
Also print an error message if decryption fails. SVN-Revision: 27167
This commit is contained in:
@@ -87,8 +87,10 @@ static int decrypt_file(void)
|
|||||||
ep.key = (unsigned char *) crypt_key;
|
ep.key = (unsigned char *) crypt_key;
|
||||||
|
|
||||||
err = decrypt_buf(&ep, buf, src_len);
|
err = decrypt_buf(&ep, buf, src_len);
|
||||||
if (err)
|
if (err) {
|
||||||
|
ERR("unable to decrypt '%s'", ifname);
|
||||||
goto out;
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
printf("Magic\t\t: '%s'\n", ep.magic);
|
printf("Magic\t\t: '%s'\n", ep.magic);
|
||||||
printf("Seed\t\t: 0x%02x\n", ep.seed);
|
printf("Seed\t\t: 0x%02x\n", ep.seed);
|
||||||
|
|||||||
@@ -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)
|
uint32_t buffalo_csum(uint32_t csum, void *buf, unsigned long len)
|
||||||
{
|
{
|
||||||
unsigned char *p = buf;
|
char *p = buf;
|
||||||
|
|
||||||
while (len--) {
|
while (len--) {
|
||||||
int i;
|
int i;
|
||||||
|
|||||||
Reference in New Issue
Block a user