Remove decrypt_message; no longer supported by Trezor or KeepKey

This commit is contained in:
Neil Booth 2017-10-17 18:18:03 +09:00
parent fbb5b23e78
commit 21e0cd9237
2 changed files with 4 additions and 11 deletions

View File

@ -230,7 +230,7 @@ class TrezorClientBase(GuiMixin, PrintError):
@staticmethod
def wrap_methods(cls):
for method in ['apply_settings', 'change_pin', 'decrypt_message',
for method in ['apply_settings', 'change_pin',
'get_address', 'get_public_node',
'load_device_by_mnemonic', 'load_device_by_xprv',
'recovery_device', 'reset_device', 'sign_message',

View File

@ -33,14 +33,7 @@ class TrezorCompatibleKeyStore(Hardware_KeyStore):
return self.plugin.get_client(self, force_pair)
def decrypt_message(self, sequence, message, password):
raise RuntimeError(_('Electrum and %s encryption and decryption are currently incompatible') % self.device)
client = self.get_client()
address_path = self.get_derivation() + "/%d/%d"%sequence
address_n = client.expand_path(address_path)
payload = base64.b64decode(message)
nonce, message, msg_hmac = payload[:33], payload[33:-8], payload[-8:]
result = client.decrypt_message(address_n, nonce, message, msg_hmac)
return result.message
raise RuntimeError(_('Encryption and decryption are not implemented by %s') % self.device)
def sign_message(self, sequence, message, password):
client = self.get_client()