LedgerHQ/blue-secure-sdk

problem loading NEO app onto ledger blue

Closed this issue · 1 comments

I was trying to build the NEO app and load it on my ledger blue.
The app build ran fine. I had to update the target id as per issue #2, but then it failed with a python error:

python3 -m ledgerblue.loadApp --path "44'/888'" --appFlags 0x40 --apdu --tlv --targetId 0x31010004 --delete --fileName bin/app.hex --appName "NEO" --appVersion 1.3.1 --dataSize `cat debug/app.map |grep _nvram_data_size | tr -s ' ' | cut -f2 -d' '`
Generated random root public key : b''
HID => e00400000431010004
HID <= 9000
HID => e050000008130e97b0d9b64430
HID <= 00000002c919dfedef2d1eb19000
Using test master key b'' 
HID => 
HID <= 9000
Using ephemeral key b''
HID => 
HID <= 9000
HID => e052000000
HID <= 
Broken certificate chain - loading from user key
HID => e052800000
HID <= 
HID => e053000000
HID <= 9000
Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.5/dist-packages/ledgerblue/loadApp.py", line 181, in <module>
    loader.deleteApp(args.appName)
  File "/usr/local/lib/python3.5/dist-packages/ledgerblue/hexLoader.py", line 356, in deleteApp
    self.exchange(self.cla, 0x00, 0x00, 0x00, data)						
  File "/usr/local/lib/python3.5/dist-packages/ledgerblue/hexLoader.py", line 188, in exchange
    data = self.scpWrap(data)
  File "/usr/local/lib/python3.5/dist-packages/ledgerblue/hexLoader.py", line 229, in scpWrap
    cipher = AES.new(self.key, AES.MODE_CBC, self.iv)
  File "/usr/local/lib/python3.5/dist-packages/Crypto/Cipher/AES.py", line 95, in new
    return AESCipher(key, *args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/Crypto/Cipher/AES.py", line 59, in __init__
    blockalgo.BlockAlgo.__init__(self, _AES, key, *args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/Crypto/Cipher/blockalgo.py", line 141, in __init__
    self._cipher = factory.new(key, *args, **kwargs)
TypeError: a bytes-like object is required, not 'NoneType'

(removed long hex strings to format better, can put them back if needed)

This is linked to the ledgerblue python library, you should update it to its last version and this error will disappear.