From 0a3c5a605bc3fa5028921722ecc59635603a2f61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Colas?= Date: Fri, 28 Aug 2020 11:59:02 +0200 Subject: [PATCH 1/3] Update protocol version with Ledger's HW --- src/device/device_ledger.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/device/device_ledger.cpp b/src/device/device_ledger.cpp index 4e89f835d..b0ccb329e 100644 --- a/src/device/device_ledger.cpp +++ b/src/device/device_ledger.cpp @@ -259,7 +259,7 @@ namespace hw { static int device_id = 0; - #define PROTOCOL_VERSION 3 + #define PROTOCOL_VERSION 4 #define INS_NONE 0x00 #define INS_RESET 0x02 From 333ae55fefb7e48ffff3d78ec4c14c14516139c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Colas?= Date: Fri, 28 Aug 2020 12:00:25 +0200 Subject: [PATCH 2/3] Update minimal Ledger Monero app version --- src/device/device_ledger.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/device/device_ledger.hpp b/src/device/device_ledger.hpp index d3ec08288..5cb834e02 100644 --- a/src/device/device_ledger.hpp +++ b/src/device/device_ledger.hpp @@ -44,8 +44,8 @@ namespace hw { /* Minimal supported version */ #define MINIMAL_APP_VERSION_MAJOR 1 - #define MINIMAL_APP_VERSION_MINOR 3 - #define MINIMAL_APP_VERSION_MICRO 1 + #define MINIMAL_APP_VERSION_MINOR 6 + #define MINIMAL_APP_VERSION_MICRO 0 #define VERSION(M,m,u) ((M)<<16|(m)<<8|(u)) #define VERSION_MAJOR(v) (((v)>>16)&0xFF) From 975ae22211ad7b674dd20bb4ffa9d67d11e06ba5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Colas?= Date: Fri, 28 Aug 2020 12:01:57 +0200 Subject: [PATCH 3/3] Fix send scalar z in plaintext The scalar z has not been generated on the HW thus it can't be sent encrypted. The value is derived from the exported private view key. --- src/device/device_ledger.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/device/device_ledger.cpp b/src/device/device_ledger.cpp index b0ccb329e..3e0afeb65 100644 --- a/src/device/device_ledger.cpp +++ b/src/device/device_ledger.cpp @@ -2126,7 +2126,7 @@ namespace hw { AUTO_LOCK_CMD(); #ifdef DEBUG_HWDEVICE const rct::key p_x = hw::ledger::decrypt(p); - const rct::key z_x = hw::ledger::decrypt(z); + const rct::key z_x = z; rct::key I_x; rct::key D_x; const rct::key H_x = H; @@ -2146,7 +2146,8 @@ namespace hw { //p this->send_secret(p.bytes, offset); //z - this->send_secret(z.bytes, offset); + memmove(this->buffer_send+offset, z.bytes, 32); + offset += 32; //H memmove(this->buffer_send+offset, H.bytes, 32); offset += 32; @@ -2225,7 +2226,7 @@ namespace hw { const rct::key c_x = c; const rct::key a_x = hw::ledger::decrypt(a); const rct::key p_x = hw::ledger::decrypt(p); - const rct::key z_x = hw::ledger::decrypt(z); + const rct::key z_x = z; const rct::key mu_P_x = mu_P; const rct::key mu_C_x = mu_C; rct::key s_x; @@ -2249,7 +2250,8 @@ namespace hw { //p this->send_secret(p.bytes, offset); //z - this->send_secret(z.bytes, offset); + memmove(this->buffer_send+offset, z.bytes, 32); + offset += 32; //mu_P memmove(this->buffer_send+offset, mu_P.bytes, 32); offset += 32;