- passphrase logic: remove backward compatibility for 2.4.3, code cleanup. - fix LibUSB cmake for static builds on OSX - tests: all tests now work with passphrase logic enabled. Passphrase test added with different passphrase. no_passphrase test added, Trezor pin test added. Testing wallet opening with correct and incorrect passphrase. Trezor test chain revamp, cleanup. Smaller chain, chain file versioning added. - tests: Trezor tests support TEST_MINING_ENABLED, TEST_MINING_TIMEOUT env vars to change mining-related tests behaviour. - requires protobuf@21 on osx for now (c++14), building with unlinked protobuf: `CMAKE_PREFIX_PATH=$(find /opt/homebrew/Cellar/protobuf@21 -maxdepth 1 -type d -name "21.*" -print -quit) \ make debug-test-trezor -j8`pull/8752/head
parent
056c996703
commit
c444a7e002
@ -0,0 +1,12 @@
|
||||
--- a/libusb/os/darwin_usb.h 2023-03-19 12:07:53
|
||||
+++ b/libusb/os/darwin_usb.h 2023-03-19 12:07:47
|
||||
@@ -165,7 +165,8 @@
|
||||
#define __has_builtin(x) 0 // Compatibility with non-clang compilers.
|
||||
#endif
|
||||
#if __has_builtin(__builtin_available)
|
||||
- #define HAS_CAPTURE_DEVICE() __builtin_available(macOS 10.10, *)
|
||||
+// #define HAS_CAPTURE_DEVICE() __builtin_available(macOS 10.10, *)
|
||||
+ #define HAS_CAPTURE_DEVICE() 0
|
||||
#else
|
||||
#define HAS_CAPTURE_DEVICE() 0
|
||||
#endif
|
@ -1,159 +0,0 @@
|
||||
--- src/google/protobuf/descriptor.cc.O 2018-07-30 22:16:10.000000000 +0000
|
||||
+++ src/google/protobuf/descriptor.cc 2022-05-06 13:38:14.827309092 +0000
|
||||
@@ -32,6 +32,9 @@
|
||||
// Based on original Protocol Buffers design by
|
||||
// Sanjay Ghemawat, Jeff Dean, and others.
|
||||
|
||||
+#if defined(__APPLE__) && defined(__arm64__)
|
||||
+#pragma GCC visibility push(hidden)
|
||||
+#endif
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include <google/protobuf/stubs/hash.h>
|
||||
@@ -7274,3 +7277,6 @@
|
||||
|
||||
} // namespace protobuf
|
||||
} // namespace google
|
||||
+#if defined(__APPLE__) && defined(__arm64__)
|
||||
+#pragma GCC visibility pop
|
||||
+#endif
|
||||
--- src/google/protobuf/extension_set.cc.O 2018-07-23 20:56:42.000000000 +0000
|
||||
+++ src/google/protobuf/extension_set.cc 2022-05-06 14:48:55.369877050 +0000
|
||||
@@ -32,6 +32,9 @@
|
||||
// Based on original Protocol Buffers design by
|
||||
// Sanjay Ghemawat, Jeff Dean, and others.
|
||||
|
||||
+#if defined(__APPLE__) && defined(__arm64__)
|
||||
+#pragma GCC visibility push(hidden)
|
||||
+#endif
|
||||
#include <google/protobuf/stubs/hash.h>
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
@@ -1914,3 +1917,6 @@
|
||||
} // namespace internal
|
||||
} // namespace protobuf
|
||||
} // namespace google
|
||||
+#if defined(__APPLE__) && defined(__arm64__)
|
||||
+#pragma GCC visibility pop
|
||||
+#endif
|
||||
--- src/google/protobuf/extension_set_heavy.cc.O 2018-07-30 22:16:10.000000000 +0000
|
||||
+++ src/google/protobuf/extension_set_heavy.cc 2022-05-06 14:14:27.847320946 +0000
|
||||
@@ -35,6 +35,10 @@
|
||||
// Contains methods defined in extension_set.h which cannot be part of the
|
||||
// lite library because they use descriptors or reflection.
|
||||
|
||||
+#if defined(__APPLE__) && defined(__arm64__)
|
||||
+#pragma GCC visibility push(hidden)
|
||||
+#endif
|
||||
+
|
||||
#include <google/protobuf/stubs/casts.h>
|
||||
#include <google/protobuf/descriptor.pb.h>
|
||||
#include <google/protobuf/io/coded_stream.h>
|
||||
@@ -814,3 +818,6 @@
|
||||
} // namespace internal
|
||||
} // namespace protobuf
|
||||
} // namespace google
|
||||
+#if defined(__APPLE__) && defined(__arm64__)
|
||||
+#pragma GCC visibility pop
|
||||
+#endif
|
||||
--- src/google/protobuf/generated_message_reflection.cc.O 2018-07-23 20:56:42.000000000 +0000
|
||||
+++ src/google/protobuf/generated_message_reflection.cc 2022-05-06 13:38:49.655540772 +0000
|
||||
@@ -32,6 +32,9 @@
|
||||
// Based on original Protocol Buffers design by
|
||||
// Sanjay Ghemawat, Jeff Dean, and others.
|
||||
|
||||
+#if defined(__APPLE__) && defined(__arm64__)
|
||||
+#pragma GCC visibility push(hidden)
|
||||
+#endif
|
||||
#include <algorithm>
|
||||
#include <set>
|
||||
|
||||
@@ -2420,3 +2423,6 @@
|
||||
} // namespace internal
|
||||
} // namespace protobuf
|
||||
} // namespace google
|
||||
+#if defined(__APPLE__) && defined(__arm64__)
|
||||
+#pragma GCC visibility pop
|
||||
+#endif
|
||||
--- src/google/protobuf/map_field.cc.O 2018-07-23 20:56:42.000000000 +0000
|
||||
+++ src/google/protobuf/map_field.cc 2022-05-06 13:34:44.913905697 +0000
|
||||
@@ -28,6 +28,10 @@
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
+#if defined(__APPLE__) && defined(__arm64__)
|
||||
+#pragma GCC visibility push(hidden)
|
||||
+#endif
|
||||
+
|
||||
#include <google/protobuf/map_field.h>
|
||||
#include <google/protobuf/map_field_inl.h>
|
||||
|
||||
@@ -462,3 +466,6 @@
|
||||
} // namespace internal
|
||||
} // namespace protobuf
|
||||
} // namespace google
|
||||
+#if defined(__APPLE__) && defined(__arm64__)
|
||||
+#pragma GCC visibility pop
|
||||
+#endif
|
||||
--- src/google/protobuf/text_format.cc.O 2018-07-30 22:16:11.000000000 +0000
|
||||
+++ src/google/protobuf/text_format.cc 2022-05-06 13:34:58.881999517 +0000
|
||||
@@ -32,6 +32,10 @@
|
||||
// Based on original Protocol Buffers design by
|
||||
// Sanjay Ghemawat, Jeff Dean, and others.
|
||||
|
||||
+#if defined(__APPLE__) && defined(__arm64__)
|
||||
+#pragma GCC visibility push(hidden)
|
||||
+#endif
|
||||
+
|
||||
#include <algorithm>
|
||||
#include <float.h>
|
||||
#include <math.h>
|
||||
@@ -2258,3 +2262,6 @@
|
||||
|
||||
} // namespace protobuf
|
||||
} // namespace google
|
||||
+#if defined(__APPLE__) && defined(__arm64__)
|
||||
+#pragma GCC visibility pop
|
||||
+#endif
|
||||
--- src/google/protobuf/wire_format.cc.O 2018-07-23 20:56:42.000000000 +0000
|
||||
+++ src/google/protobuf/wire_format.cc 2022-05-06 13:06:23.294219228 +0000
|
||||
@@ -32,6 +32,10 @@
|
||||
// Based on original Protocol Buffers design by
|
||||
// Sanjay Ghemawat, Jeff Dean, and others.
|
||||
|
||||
+#if defined(__APPLE__) && defined(__arm64__)
|
||||
+#pragma GCC visibility push(hidden)
|
||||
+#endif
|
||||
+
|
||||
#include <stack>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@@ -1445,3 +1449,7 @@
|
||||
} // namespace internal
|
||||
} // namespace protobuf
|
||||
} // namespace google
|
||||
+
|
||||
+#if defined(__APPLE__) && defined(__arm64__)
|
||||
+#pragma GCC visibility pop
|
||||
+#endif
|
||||
--- src/google/protobuf/stubs/status.cc.O 2018-07-23 20:56:42.000000000 +0000
|
||||
+++ src/google/protobuf/stubs/status.cc 2022-05-06 15:18:53.393208814 +0000
|
||||
@@ -27,6 +27,11 @@
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
+
|
||||
+#if defined(__APPLE__) && defined(__arm64__)
|
||||
+#pragma GCC visibility push(hidden)
|
||||
+#endif
|
||||
+
|
||||
#include <google/protobuf/stubs/status.h>
|
||||
|
||||
#include <ostream>
|
||||
@@ -132,3 +137,6 @@
|
||||
} // namespace util
|
||||
} // namespace protobuf
|
||||
} // namespace google
|
||||
+#if defined(__APPLE__) && defined(__arm64__)
|
||||
+#pragma GCC visibility pop
|
||||
+#endif
|
@ -1 +1 @@
|
||||
Subproject commit bff7fdfe436c727982cc553bdfb29a9021b423b0
|
||||
Subproject commit bc28c316d05bf1e9ebfe3d7df1ab25831d98d168
|
@ -0,0 +1,74 @@
|
||||
# Trezor hardware wallet support
|
||||
|
||||
This module adds [Trezor] hardware support to Monero.
|
||||
|
||||
|
||||
## Basic information
|
||||
|
||||
Trezor integration is based on the following original proposal: https://github.com/ph4r05/monero-trezor-doc
|
||||
|
||||
A custom high-level transaction signing protocol uses Trezor in a similar way a cold wallet is used.
|
||||
Transaction is build incrementally on the device.
|
||||
|
||||
Trezor implements the signing protocol in [trezor-firmware] repository, in the [monero](https://github.com/trezor/trezor-firmware/tree/master/core/src/apps/monero) application.
|
||||
Please, refer to [monero readme](https://github.com/trezor/trezor-firmware/blob/master/core/src/apps/monero/README.md) for more information.
|
||||
|
||||
## Dependencies
|
||||
|
||||
Trezor uses [Protobuf](https://protobuf.dev/) library. As Monero is compiled with C++14, the newest Protobuf library version cannot be compiled because it requires C++17 (through its dependency Abseil library).
|
||||
This can result in a compilation failure.
|
||||
|
||||
Protobuf v21 is the latest compatible protobuf version.
|
||||
|
||||
If you want to compile Monero with Trezor support, please make sure the Protobuf v21 is installed.
|
||||
|
||||
More about this limitation: [PR #8752](https://github.com/monero-project/monero/pull/8752),
|
||||
[1](https://github.com/monero-project/monero/pull/8752#discussion_r1246174755), [2](https://github.com/monero-project/monero/pull/8752#discussion_r1246480393)
|
||||
|
||||
### OSX
|
||||
|
||||
To build with installed, but not linked protobuf:
|
||||
|
||||
```bash
|
||||
CMAKE_PREFIX_PATH=$(find /opt/homebrew/Cellar/protobuf@21 -maxdepth 1 -type d -name "21.*" -print -quit) \
|
||||
make release
|
||||
```
|
||||
|
||||
or to install and link as a default protobuf version:
|
||||
```bash
|
||||
# Either install all requirements as
|
||||
brew update && brew bundle --file=contrib/brew/Brewfile
|
||||
|
||||
# or install protobufv21 specifically
|
||||
brew install protobuf@21 && brew link protobuf@21
|
||||
```
|
||||
|
||||
### MSYS32
|
||||
|
||||
```bash
|
||||
curl -O https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-protobuf-c-1.4.1-1-any.pkg.tar.zst
|
||||
curl -O https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-protobuf-21.9-1-any.pkg.tar.zst
|
||||
pacman --noconfirm -U mingw-w64-x86_64-protobuf-c-1.4.1-1-any.pkg.tar.zst mingw-w64-x86_64-protobuf-21.9-1-any.pkg.tar.zst
|
||||
```
|
||||
|
||||
### Other systems
|
||||
|
||||
- install protobufv21
|
||||
- point `CMAKE_PREFIX_PATH` environment variable to Protobuf v21 installation.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
To disable Trezor support, set `USE_DEVICE_TREZOR=OFF`, e.g.:
|
||||
|
||||
```shell
|
||||
USE_DEVICE_TREZOR=OFF make release
|
||||
```
|
||||
|
||||
## Resources:
|
||||
|
||||
- First pull request https://github.com/monero-project/monero/pull/4241
|
||||
- Integration proposal https://github.com/ph4r05/monero-trezor-doc
|
||||
- Integration readme in trezor-firmware https://github.com/trezor/trezor-firmware/blob/master/core/src/apps/monero/README.md
|
||||
|
||||
[Trezor]: https://trezor.io/
|
||||
[trezor-firmware]: https://github.com/trezor/trezor-firmware/
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue