image: add support for Netgear encrypted image
authorWenli Looi <wlooi@ucalgary.ca>
Sat, 2 Jul 2022 20:16:21 +0000 (20:16 +0000)
committerChristian Marangi <ansuelsmth@gmail.com>
Thu, 21 Jul 2022 14:58:00 +0000 (16:58 +0200)
commitd5858c6d97366f545e4efc50c2656b0cd3ac2928
tree03ca80b523f373a4308de3b90f1846ab9c2360bc
parenta1068f77c90244c38ff54e94a43837b4c65cbf72
image: add support for Netgear encrypted image

Netgear encrypted image is used in various devices including WAX202,
WAX206, and EX6400v3. This image format also requires a dummy squashfs4
image which is added here as well.

References in WAX202 GPL source:
https://www.downloads.netgear.com/files/GPL/WAX202_V1.0.5.1_Source.rar

* openwrt/bootloader/u-boot-mt7621-2018.09-gitb178829-20200526/board/ralink/common/dual_image.c
  Bootloader code that verifies the presence of a squashfs4 image, thus
  a dummy image is added here.

* openwrt/tools/imgencoder/src/gj_enc.c
  Contains code that generates the encrypted image. There is support for
  adding an RSA signature, but it does not look like the signature is
  verified by the stock firmware or bootloader.

* openwrt/tools/imgencoder/src/imagekey.h
  Contains the encryption key and IV. It appears the same key/IV is used
  for other Netgear devices including WAX206 and EX6400v3.

Signed-off-by: Wenli Looi <wlooi@ucalgary.ca>
(cherry picked from commit efca76ffce5cf464e82d8269d79877f442209a0a)
include/image-commands.mk
scripts/netgear-encrypted-factory.py [new file with mode: 0755]