Skip to content

Commit

Permalink
Raise exception if no encryption type is specified
Browse files Browse the repository at this point in the history
  • Loading branch information
nolze committed Jan 18, 2022
1 parent 01c5b23 commit e6f1a34
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions msoffcrypto/format/xls97.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,8 @@ def decrypt(self, ofile):
dec = DocumentRC4.decrypt(self.key, self.salt, encrypted_buf, blocksize=1024)
elif self.type == "rc4_cryptoapi":
dec = DocumentRC4CryptoAPI.decrypt(self.key, self.salt, self.keySize, encrypted_buf, blocksize=1024)
else:
raise exceptions.DecryptionError("Unsupported encryption method")

for c in plain_buf:
if c == -1:
Expand Down

0 comments on commit e6f1a34

Please sign in to comment.