Browse Source

fix encryption

wapplay 6 years ago
parent
commit
725959d98f
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/PhpZip/Crypto/TraditionalPkwareEncryptionEngine.php

+ 2 - 2
src/PhpZip/Crypto/TraditionalPkwareEncryptionEngine.php

@@ -367,8 +367,8 @@ class TraditionalPkwareEncryptionEngine implements ZipEncryptionEngine
         $byte = 0;
 
         for ($i = 0; $i < self::STD_DEC_HDR_SIZE; $i++) {
-            $headerBytes[$i] = ($headerBytes[$i] ^ $this->decryptByte()) & 0xff;
-            $this->updateKeys($headerBytes[$i]);
+            $byte = ($headerBytes[$i] ^ $this->decryptByte()) & 0xff;
+            $this->updateKeys($byte);
         }
 
         if ($this->entry->getGeneralPurposeBitFlag(ZipEntry::GPBF_DATA_DESCRIPTOR)) {