Commit 0dfa259fbd94c98cf99e8ca1f9c958d780572003

Authored by Christian Herdtweck
1 parent 5dfba516

crypto: declare specialiced is_encrypted private

Showing 1 changed file with 5 additions and 5 deletions
oletools/crypto.py
@@ -198,14 +198,14 @@ def is_encrypted(some_file): @@ -198,14 +198,14 @@ def is_encrypted(some_file):
198 """ 198 """
199 log.debug('is_encrypted') 199 log.debug('is_encrypted')
200 if isinstance(some_file, OleFileIO): 200 if isinstance(some_file, OleFileIO):
201 - return is_encrypted_ole(some_file) # assume it is OleFileIO 201 + return _is_encrypted_ole(some_file) # assume it is OleFileIO
202 if zipfile.is_zipfile(some_file): 202 if zipfile.is_zipfile(some_file):
203 - return is_encrypted_zip(some_file) 203 + return _is_encrypted_zip(some_file)
204 # otherwise assume it is the name of an ole file 204 # otherwise assume it is the name of an ole file
205 - return is_encrypted_ole(OleFileIO(some_file)) 205 + return _is_encrypted_ole(OleFileIO(some_file))
206 206
207 207
208 -def is_encrypted_zip(filename): 208 +def _is_encrypted_zip(filename):
209 """Specialization of :py:func:`is_encrypted` for zip-based files.""" 209 """Specialization of :py:func:`is_encrypted` for zip-based files."""
210 log.debug('is_encrypted_zip') 210 log.debug('is_encrypted_zip')
211 # TODO: distinguish OpenXML from normal zip files 211 # TODO: distinguish OpenXML from normal zip files
@@ -220,7 +220,7 @@ def is_encrypted_zip(filename): @@ -220,7 +220,7 @@ def is_encrypted_zip(filename):
220 return 'crypt' in str(rt_err) 220 return 'crypt' in str(rt_err)
221 221
222 222
223 -def is_encrypted_ole(ole): 223 +def _is_encrypted_ole(ole):
224 """Specialization of :py:func:`is_encrypted` for ole files.""" 224 """Specialization of :py:func:`is_encrypted` for ole files."""
225 log.debug('is_encrypted_ole') 225 log.debug('is_encrypted_ole')
226 # check well known property for password protection 226 # check well known property for password protection