scripts: Support compressed about_os_credits.html.

BUG=b:187790036
BRANCH=none
TEST=ensure_not_tainted_license.sh /path/to/chromiumos_test_image.bin

Signed-off-by: Miriam Zimmerman <mutexlox@google.com>
Change-Id: Id3ad6535b1bc9635050d467208614f97e0aeca35
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/4467627
Commit-Queue: Miriam Zimmerman <mutexlox@chromium.org>
Tested-by: Miriam Zimmerman <mutexlox@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/scripts/image_signing/ensure_not_tainted_license.sh b/scripts/image_signing/ensure_not_tainted_license.sh
index f289cde..28b71d1 100755
--- a/scripts/image_signing/ensure_not_tainted_license.sh
+++ b/scripts/image_signing/ensure_not_tainted_license.sh
@@ -33,7 +33,7 @@
     mount_loop_image_partition_ro "${loopdev}" 3 "${rootfs}"
   fi
 
-  local license_dir license tainted_tag tainted_status
+  local license_dir license license_gz tainted_tag tainted_status
   license_dir="${rootfs}/opt/google/chrome/"
   if [[ ! -d "${license_dir}" ]]; then
     echo "Directory ${license_dir} does not exist. Skipping the tainted check."
@@ -41,6 +41,13 @@
   fi
 
   license=$(find "${license_dir}" -name about_os_credits.html 2>/dev/null)
+  license_gz=$(find "${license_dir}" -name about_os_credits.html.gz 2>/dev/null)
+  if [[ -n "${license_gz}" ]]; then
+    local tmpfile
+    tmpfile=$(make_temp_file)
+    gunzip --stdout "${license_gz}" > "${tmpfile}"
+    license="${tmpfile}"
+  fi
   if [[ -z "${license}" ]]; then
     echo "License file about_os_credits.html not found in ${license_dir}."
     echo "Skipping the check of tainted license."