summaryrefslogtreecommitdiff
path: root/patches/monero/0006-add-dummy-device-for-ledger.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/monero/0006-add-dummy-device-for-ledger.patch')
-rw-r--r--patches/monero/0006-add-dummy-device-for-ledger.patch75
1 files changed, 38 insertions, 37 deletions
diff --git a/patches/monero/0006-add-dummy-device-for-ledger.patch b/patches/monero/0006-add-dummy-device-for-ledger.patch
index 816ad5d..db9512c 100644
--- a/patches/monero/0006-add-dummy-device-for-ledger.patch
+++ b/patches/monero/0006-add-dummy-device-for-ledger.patch
@@ -1,7 +1,7 @@
-From eb9ffa912fb31dd2bddf96d7d55d5e5f9d8219b4 Mon Sep 17 00:00:00 2001
+From 8dc2464244e60bf03f0605360663e2e62864bf02 Mon Sep 17 00:00:00 2001
From: Czarek Nakamoto <cyjan@mrcyjanek.net>
Date: Thu, 8 May 2025 13:14:23 +0200
-Subject: [PATCH 06/20] add dummy device for ledger
+Subject: [PATCH 06/17] add dummy device for ledger
---
CMakeLists.txt | 19 ++--
@@ -11,20 +11,20 @@ Subject: [PATCH 06/20] add dummy device for ledger
src/device/device_io_dummy.cpp | 161 ++++++++++++++++++++++++++++++
src/device/device_io_dummy.hpp | 82 +++++++++++++++
src/device/device_ledger.cpp | 6 +-
- src/device/device_ledger.hpp | 7 +-
+ src/device/device_ledger.hpp | 9 +-
src/wallet/api/wallet.cpp | 100 +++++++++++++++++++
src/wallet/api/wallet.h | 14 +++
src/wallet/api/wallet2_api.h | 13 +++
src/wallet/api/wallet_manager.cpp | 12 ++-
- 12 files changed, 411 insertions(+), 31 deletions(-)
+ 12 files changed, 412 insertions(+), 32 deletions(-)
create mode 100644 src/device/device_io_dummy.cpp
create mode 100644 src/device/device_io_dummy.hpp
diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 268339201..eb0d12225 100644
+index ee46cabcd..dbd0b2d48 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
-@@ -692,16 +692,21 @@ include_directories(${LMDB_INCLUDE})
+@@ -664,16 +664,21 @@ include_directories(${LMDB_INCLUDE})
include_directories(${LIBUNWIND_INCLUDE})
link_directories(${LIBUNWIND_LIBRARY_DIRS})
@@ -54,7 +54,7 @@ index 268339201..eb0d12225 100644
include(CheckTrezor)
diff --git a/src/device/CMakeLists.txt b/src/device/CMakeLists.txt
-index e4f1159b5..14d398f87 100644
+index e8901cd4c..a0cdcdd1d 100644
--- a/src/device/CMakeLists.txt
+++ b/src/device/CMakeLists.txt
@@ -29,10 +29,11 @@
@@ -84,7 +84,7 @@ index e4f1159b5..14d398f87 100644
${device_headers}
device_ledger.hpp
diff --git a/src/device/device.cpp b/src/device/device.cpp
-index e6cd358b6..dd0701e0c 100644
+index e6c39c0b4..8a5d14c41 100644
--- a/src/device/device.cpp
+++ b/src/device/device.cpp
@@ -29,7 +29,7 @@
@@ -122,7 +122,7 @@ index e6cd358b6..dd0701e0c 100644
return *device->second;
}
diff --git a/src/device/device.hpp b/src/device/device.hpp
-index 392703a24..ffd419779 100644
+index f91ae1ddf..9e262b62a 100644
--- a/src/device/device.hpp
+++ b/src/device/device.hpp
@@ -34,17 +34,7 @@
@@ -401,19 +401,19 @@ index 000000000..87a5f109f
+
+#endif // HAVE_HIDAPI
diff --git a/src/device/device_ledger.cpp b/src/device/device_ledger.cpp
-index 7e4be6347..ee330ba59 100644
+index 45a01abd0..a30082e80 100644
--- a/src/device/device_ledger.cpp
+++ b/src/device/device_ledger.cpp
-@@ -41,7 +41,7 @@ namespace hw {
+@@ -38,7 +38,7 @@ namespace hw {
namespace ledger {
- #ifdef WITH_DEVICE_LEDGER
+ #if defined(WITH_DEVICE_LEDGER) || defined(HIDAPI_DUMMY)
- #undef MONERO_DEFAULT_LOG_CATEGORY
- #define MONERO_DEFAULT_LOG_CATEGORY "device.ledger"
-@@ -299,7 +299,7 @@ namespace hw {
+ namespace {
+ bool apdu_verbose =true;
+@@ -300,7 +300,7 @@ namespace hw {
device_ledger::device_ledger(): hw_device(0x0101, 0x05, 64, 2000) {
this->id = device_id++;
@@ -422,7 +422,7 @@ index 7e4be6347..ee330ba59 100644
this->mode = NONE;
this->has_view_key = false;
this->tx_in_progress = false;
-@@ -534,7 +534,9 @@ namespace hw {
+@@ -536,7 +536,9 @@ namespace hw {
bool device_ledger::connect(void) {
this->disconnect();
@@ -433,7 +433,7 @@ index 7e4be6347..ee330ba59 100644
#ifdef DEBUG_HWDEVICE
cryptonote::account_public_address pubkey;
diff --git a/src/device/device_ledger.hpp b/src/device/device_ledger.hpp
-index 61ac6f9c8..44a1af6c8 100644
+index 2634454a7..fe60dffc1 100644
--- a/src/device/device_ledger.hpp
+++ b/src/device/device_ledger.hpp
@@ -35,6 +35,7 @@
@@ -441,10 +441,10 @@ index 61ac6f9c8..44a1af6c8 100644
#include "log.hpp"
#include "device_io_hid.hpp"
+#include "device_io_dummy.hpp"
- #include <boost/thread/mutex.hpp>
- #include <boost/thread/recursive_mutex.hpp>
+ #include <mutex>
-@@ -56,7 +57,7 @@ namespace hw {
+ namespace hw {
+@@ -55,7 +56,7 @@ namespace hw {
void register_all(std::map<std::string, std::unique_ptr<device>> &registry);
@@ -453,24 +453,25 @@ index 61ac6f9c8..44a1af6c8 100644
// Origin: https://github.com/LedgerHQ/ledger-app-monero/blob/master/src/monero_types.h
#define SW_OK 0x9000
-@@ -148,7 +149,11 @@ namespace hw {
- mutable boost::mutex command_locker;
+@@ -143,7 +144,11 @@ namespace hw {
+ mutable std::mutex command_locker;
//IO
-+#if defined(HIDAPI_DUMMY) && !defined(HAVE_HIDAPI)
-+ hw::io::device_io_dummy hw_device;
-+#else
- hw::io::device_io_hid hw_device;
-+#endif
+- hw::io::device_io_hid hw_device;
++ #if defined(HIDAPI_DUMMY) && !defined(HAVE_HIDAPI)
++ hw::io::device_io_dummy hw_device;
++ #else
++ hw::io::device_io_hid hw_device;
++ #endif
unsigned int length_send;
unsigned char buffer_send[BUFFER_SEND_SIZE];
unsigned int length_recv;
diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp
-index d179e502b..fb71a0521 100644
+index b1ffe77a7..819982528 100644
--- a/src/wallet/api/wallet.cpp
+++ b/src/wallet/api/wallet.cpp
-@@ -48,6 +48,9 @@
- #include <boost/locale.hpp>
+@@ -52,6 +52,9 @@
+
#include <boost/filesystem.hpp>
#include "bc-ur/src/bc-ur.hpp"
+#if defined(HIDAPI_DUMMY) && !defined(HAVE_HIDAPI)
@@ -479,7 +480,7 @@ index d179e502b..fb71a0521 100644
using namespace std;
using namespace cryptonote;
-@@ -3177,4 +3180,101 @@ uint64_t WalletImpl::getBytesSent()
+@@ -3136,4 +3139,101 @@ uint64_t WalletImpl::getBytesSent()
return m_wallet->get_bytes_sent();
}
@@ -582,10 +583,10 @@ index d179e502b..fb71a0521 100644
+
} // namespace
diff --git a/src/wallet/api/wallet.h b/src/wallet/api/wallet.h
-index edf8bb8ce..6bfb61cb8 100644
+index a50983a69..194f21ebe 100644
--- a/src/wallet/api/wallet.h
+++ b/src/wallet/api/wallet.h
-@@ -301,6 +301,20 @@ private:
+@@ -302,6 +302,20 @@ private:
// cache connection status to avoid unnecessary RPC calls
mutable std::atomic<bool> m_is_connected;
boost::optional<epee::net_utils::http::login> m_daemon_login{};
@@ -607,10 +608,10 @@ index edf8bb8ce..6bfb61cb8 100644
diff --git a/src/wallet/api/wallet2_api.h b/src/wallet/api/wallet2_api.h
-index 764adbfbf..f433b064f 100644
+index 308bcad4b..302f6b082 100644
--- a/src/wallet/api/wallet2_api.h
+++ b/src/wallet/api/wallet2_api.h
-@@ -1150,6 +1150,19 @@ struct Wallet
+@@ -1146,6 +1146,19 @@ struct Wallet
//! get bytes sent
virtual uint64_t getBytesSent() = 0;
@@ -631,10 +632,10 @@ index 764adbfbf..f433b064f 100644
/**
diff --git a/src/wallet/api/wallet_manager.cpp b/src/wallet/api/wallet_manager.cpp
-index e81b8f83a..277be6ac9 100644
+index b18333e8f..bd92f7829 100644
--- a/src/wallet/api/wallet_manager.cpp
+++ b/src/wallet/api/wallet_manager.cpp
-@@ -188,10 +188,14 @@ bool WalletManagerImpl::verifyWalletPassword(const std::string &keys_file_name,
+@@ -184,10 +184,14 @@ bool WalletManagerImpl::verifyWalletPassword(const std::string &keys_file_name,
bool WalletManagerImpl::queryWalletDevice(Wallet::Device& device_type, const std::string &keys_file_name, const std::string &password, uint64_t kdf_rounds) const
{
@@ -654,5 +655,5 @@ index e81b8f83a..277be6ac9 100644
std::vector<std::string> WalletManagerImpl::findWallets(const std::string &path)
--
-2.50.1 (Apple Git-155)
+2.51.0