]> xmof Git - DeDRM.git/commitdiff
Merge pull request #1362 from ivan-m/pycrypto_rsa_long
authorApprentice Harper <apprenticeharper@gmail.com>
Mon, 23 Nov 2020 13:31:10 +0000 (13:31 +0000)
committerGitHub <noreply@github.com>
Mon, 23 Nov 2020 13:31:10 +0000 (13:31 +0000)
PyCrypto requires RSA values to be long not int (which is possible for small numbers)

1  2 
DeDRM_plugin/ineptepub.py

index 8d887337f16bb7c36cfea3d1ed37390860aeabcb,4817ca97090dc0c69bef96fb1d02d503ed67cc4e..f4665b2380a94fb8906abdd106384bee0a1ebe44
@@@ -311,10 -310,10 +311,10 @@@ def _load_crypto_pycrypto()
              total = 0
              for byte in bytes:
                  total = (total << 8) + byte
-             return total
+             return long(total)
  
          def decrypt(self, data):
 -            return self._rsa.decrypt(data)
 +            return _PKCS1_v1_5.new(self._rsa).decrypt(data, 172)
  
      return (AES, RSA)