[OpenWrt-Devel] [PATCH RESEND] firmware-utils/mkdir615h1: fix magic XOR calculation

Forest Crossman cyrozap at gmail.com
Wed Jul 2 22:14:22 EDT 2014


Someone changed this patch's state to accepted, but I haven't seen it
appear in SVN yet. Is there something I still need to do? Or does it
just take a while for a patch to go from "Accepted" to "Committed"? I
ask because I have some more patches to add that will make this code
more efficient and generic because it actually applies to most if not
all Senao-produced boards.

--
Forest Crossman


On Sun, Jun 22, 2014 at 4:33 PM, Forest Crossman <cyrozap at gmail.com> wrote:
> Signed-off-by: Forest Crossman <cyrozap at gmail.com>
> ---
>  tools/firmware-utils/src/mkdir615h1.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/firmware-utils/src/mkdir615h1.c b/tools/firmware-utils/src/mkdir615h1.c
> index 84692aa..d9fb35c 100644
> --- a/tools/firmware-utils/src/mkdir615h1.c
> +++ b/tools/firmware-utils/src/mkdir615h1.c
> @@ -199,7 +199,7 @@ static int encode_image(const char *input_file_name,
>                 }
>
>                 for (i = 0; i < bytes_read; i++)
> -                       buf[i] ^= magic >> ((((i >> 60) + i) & 7) - (i >> 60));
> +                       buf[i] ^= magic >> (i % 8) & 0xff;
>                 fwrite(&buf, bytes_read, 1, fp_output);
>         }
>
> @@ -254,7 +254,7 @@ int decode_image(const char *input_file_name, const char *output_file_name)
>
>                 bytes_read = fread(&buf, 1, BUF_SIZE, fp_input);
>                 for (i = 0; i < bytes_read; i++)
> -                       buf[i] ^= header.magic >> ((((i >> 60) + i) & 7) - (i >> 60));
> +                       buf[i] ^= header.magic >> (i % 8) & 0xff;
>
>                 /*
>                  * Handle padded source file
> --
> 1.9.2
>
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list