parkerhoyes / bolos-app-otp2fa

Other
19 stars 1 forks source link

Installation error #3

Closed rotojp closed 6 years ago

rotojp commented 6 years ago

Installing bolos-app-otp2fa using the installation command

python -m ledgerblue.loadApp --targetId 0x31100002 --fileName bolos-app-otp2fa-v1.0.0-sdk-0x31100002-1313.hex --appName "OTP 2FA" --appFlags 0x00 --icon "0100000000ffffff00ffffffff3ffc1ff8cff3cff3cff307e007e087e187e007e007e0ffffffffffff"

gives the following error:

Generated random root public key : xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Using test master key xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Broken certificate chain - loading from user key Traceback (most recent call last): File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main "main", fname, loader, pkg_name) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/Users/xxxx/ledger/lib/python2.7/site-packages/ledgerblue/loadApp.py", line 174, in loader.createApp(args.appFlags, appLength, args.appName, icon, path, None, None, args.appVersion) File "/Users/xxxx/ledger/lib/python2.7/site-packages/ledgerblue/hexLoader.py", line 163, in createApp data = self.encryptAES(data) File "/Users/xxxx/ledger/lib/python2.7/site-packages/ledgerblue/hexLoader.py", line 95, in encryptAES encryptedData = cipher.encrypt(paddedData) File "/Users/xxxx/ledger/lib/python2.7/site-packages/Crypto/Cipher/blockalgo.py", line 244, in encrypt return self._cipher.encrypt(plaintext) TypeError: argument must be string or read-only buffer, not bytearray

rotojp commented 6 years ago

Nevermind, fixed the issue (for future reference):

  1. Open "/Users/xxxx/ledger/lib/python2.7/site-packages/Crypto/Cipher/blockalgo.py", where xxxx is you useraccount.
  2. Replace return self._cipher.encrypt(plaintext), (line 244) with return self._cipher.encrypt(bytes(plaintext))
parkerhoyes commented 6 years ago

This is likely caused by an outdated Python or pycrypto version. Updating to the latest versions of both should also solve this problem without having to edit the source.