From 99ff607c5fb774866afce47e17abac0c87724a85 Mon Sep 17 00:00:00 2001 From: Christian Herdtweck Date: Thu, 28 Feb 2019 16:29:57 +0100 Subject: [PATCH] crypto: Provide crypt-based errors and new constant --- oletools/crypto.py | 8 ++++++++ 1 file changed, 8 insertions(+), 0 deletions(-) diff --git a/oletools/crypto.py b/oletools/crypto.py index fc45d8d..0b32c12 100644 --- a/oletools/crypto.py +++ b/oletools/crypto.py @@ -88,6 +88,9 @@ import struct import os from os.path import splitext, isfile from tempfile import mkstemp +from oletools.common.errors import CryptoErrorBase, WrongEncryptionPassword, \ + UnsupportedEncryptionError, MaxCryptoNestingReached +from olefile import OleFileIO try: import msoffcrypto @@ -95,6 +98,11 @@ except ImportError: msoffcrypto = None +#: if there is an encrypted file embedded in an encrypted file, +#: how deep down do we go +MAX_NESTING_DEPTH = 10 + + def is_encrypted(olefile): """ Determine whether document contains encrypted content. -- libgit2 0.21.4