Skip to content

Commit

Permalink
Fix crash using bare sha1 symbol
Browse files Browse the repository at this point in the history
Use sha1 from hashlib, as it isn't imported globally, fixed crash trying to decrypt a eReader PDB file
  • Loading branch information
unwiredben authored and noDRM committed Nov 10, 2024
1 parent 34c4c06 commit 05fff52
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion DeDRM_plugin/erdr2pml.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def unshuff(data, shuf):
encrypted_key = r[172:172+8]
encrypted_key_sha = r[56:56+20]
self.content_key = des.decrypt(encrypted_key)
if sha1(self.content_key).digest() != encrypted_key_sha:
if hashlib.sha1(self.content_key).digest() != encrypted_key_sha:
raise ValueError('Incorrect Name and/or Credit Card')

def getNumImages(self):
Expand Down

0 comments on commit 05fff52

Please sign in to comment.