Extract: Detect and report AES usage via UMA

Adds detection of AES encrypted content in a ZIP archive.

Adds a boolean to the mojo Info structure to return AES encryption
presence to the caller.

Adds a new enum value and fixes mismatch in enum values between
enums.xml and extract_io_task.h.

Bug: 953256
Tests: components_unittests --gtest_filter=UnzipTest.DetectAESArchive
Change-Id: I565464c59e51f25144eb80786ae56fdb30138b2b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3782515
Commit-Queue: Alex Danilo <adanilo@chromium.org>
Reviewed-by: Fran├žois Degros <fdegros@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Reviewed-by: Noel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1029601}
NOKEYCHECK=True
GitOrigin-RevId: 0fcd02b48834b4ea92613ffea7a57d35e742ad53
diff --git a/README.chromium b/README.chromium
index f0faeae..697542d 100644
--- a/README.chromium
+++ b/README.chromium
@@ -29,3 +29,4 @@
    contributor layout.
  - In sync with 1.2.12 release plus a few fixes from 'develop' branch.
  - ZIP reader modified to allow for progress callbacks during extraction.
+ - ZIP reader modified to add detection of AES encrypted content.
diff --git a/google/zip_reader.cc b/google/zip_reader.cc
index 2aa736a..075ba70 100644
--- a/google/zip_reader.cc
+++ b/google/zip_reader.cc
@@ -237,6 +237,12 @@
 
   // The file content of this entry is encrypted if flag bit 0 is set.
   entry_.is_encrypted = info.flag & 1;
+  if (entry_.is_encrypted) {
+    // Is the entry AES encrypted.
+    entry_.uses_aes_encryption = info.compression_method == 99;
+  } else {
+    entry_.uses_aes_encryption = false;
+  }
 
   // Construct the last modified time. The timezone info is not present in ZIP
   // archives, so we construct the time as UTC.
diff --git a/google/zip_reader.h b/google/zip_reader.h
index eb0a76a..286ddfd 100644
--- a/google/zip_reader.h
+++ b/google/zip_reader.h
@@ -128,14 +128,17 @@
 
     // True if the entry is a directory.
     // False if the entry is a file.
-    bool is_directory;
+    bool is_directory = false;
 
     // True if the entry path cannot be converted to a safe relative path. This
     // happens if a file entry (not a directory) has a filename "." or "..".
-    bool is_unsafe;
+    bool is_unsafe = false;
 
     // True if the file content is encrypted.
-    bool is_encrypted;
+    bool is_encrypted = false;
+
+    // True if the encryption scheme is AES.
+    bool uses_aes_encryption = false;
 
     // Entry POSIX permissions (POSIX systems only).
     int posix_mode;