Do not return obfuscated files for decryption
authorChristian Weiske <[email protected]>
Mon, 3 Jan 2022 21:20:55 +0000 (22:20 +0100)
committerChristian Weiske <[email protected]>
Mon, 3 Jan 2022 21:20:55 +0000 (22:20 +0100)
src/Command/Decrypt.php

index a49d0894baffb59b9d30a4238801cbe422c35baa..5a49dde112cee0266a88c26af41db02bab94aae1 100644 (file)
@@ -67,10 +67,6 @@ class Decrypt
                     $content
                 );
 
-            } else if ($algoUrl == 'http://www.idpf.org/2008/embedding') {
-                //obfuscation algorithm; skip
-                continue;
-
             } else {
                 $this->logger->error('Unsupported encryption algorithm: ' . $algoUrl);
                 continue;
@@ -150,6 +146,11 @@ class Decrypt
             $filePath = (string) $sxEncData->CipherData->CipherReference['URI'];
             $algoUrl  = (string) $sxEncData->EncryptionMethod['Algorithm'];
 
+            if ($algoUrl == 'http://www.idpf.org/2008/embedding') {
+                //obfuscation algorithm; skip
+                continue;
+            }
+
             if (isset($sxEncData->EncryptionProperties->EncryptionProperty->Compression)) {
                 $compressionMethod = (string) $sxEncData->EncryptionProperties->EncryptionProperty->Compression['Method'];
                 $originalLength = (string) $sxEncData->EncryptionProperties->EncryptionProperty->Compression['OriginalLength'];