Commit graph

95 commits

Author SHA1 Message Date
moneromooo-monero e4b2c3089b Integrate CLSAGs into loki
They are allowed from v16, and MLSAGs are rejected from v16 + 10 blocks.
2020-09-16 20:43:12 -03:00
Jason Rhinelander 0de3c64a77 Post-merge: Serialization updates
Updates some old serialization code that crept in with the Monero
upstream merge.
2020-07-02 12:52:13 -03:00
Jason Rhinelander 89afcad468 Post-merge: locks/mutexes
Replaces boost mutexes/locks added upstream with std::equivalents.
2020-07-02 12:52:13 -03:00
Jason Rhinelander 778cb89620 Post-merge updates: std::optional 2020-07-02 12:52:13 -03:00
Jason Rhinelander 96354a0e0f boost::optional -> std::optional 2020-07-02 12:52:12 -03:00
Jason Rhinelander 83dd656e74 C++17
Switch loki dev branch to C++17 compilation, and update the code with
various C++17 niceties.

- stop including the (deprecated) lokimq/string_view.h header and
instead switch everything to use std::string_view and `""sv` instead of
`""_sv`.

- std::string_view is much nicer than epee::span, so updated various
loki-specific code to use it instead.

- made epee "portable storage" serialization accept a std::string_view
instead of const lvalue std::string so that we can avoid copying.

- switched from mapbox::variant to std::variant

- use `auto [a, b] = whatever()` instead of `T1 a; T2 b; std::tie(a, b)
= whatever()` in a couple places (in the wallet code).

- switch to std::lock(...) instead of boost::lock(...) for simultaneous
lock acquisition.  boost::lock() won't compile in C++17 mode when given
locks of different types.

- removed various pre-C++17 workarounds, e.g. for fold expressions,
unused argument attributes, and byte-spannable object detection.

- class template deduction means lock types no longer have to specify
the mutex, so `std::unique_lock<std::mutex> lock{mutex}` can become
`std::unique_lock lock{mutex}`.  This will make switching any mutex
types (e.g. from boost to std mutexes) far easier as you just have to
update the type in the header and everything should work.  This also
makes the tools::unique_lock and tools::shared_lock methods redundant
(which were a sort of poor-mans-pre-C++17 way to eliminate the
redundancy) so they are now gone and replaced with direct unique_lock or
shared_lock constructions.

- Redid the LNS validation using a string_view; instead of using raw
char pointers the code now uses a string view and chops off parts of the
view as it validates.  So, for instance, it starts with "abcd.loki",
validates the ".loki" and chops the view to "abcd", then validates the
first character and chops to "bcd", validates the last and chops to
"bc", then can just check everything remaining for is-valid-middle-char.

- LNS validation gained a couple minor validation checks in the process:
  - slightly tightened the requirement on lokinet addresses to require
    that the last character of the mapped address is 'y' or 'o' (the
    last base32z char holds only one significant bit).
  - In parse_owner_to_generic_owner made sure that the owner value has
    the correct size (otherwise we could up end not filling or
    overfilling the pubkey buffer).

- Replaced base32z/base64/hex conversions with lokimq's versions which
have a nicer interface, are better optimized, and don't depend on epee.
2020-07-02 12:52:12 -03:00
Doyle a5e21b3c24 Merge commit '688a3e87e712123d182ae6715610c461988f9e74' into MergeUpstream3 2020-05-29 10:50:19 +10:00
Doyle abb8dfc48e Merge commit 'c4f75fe' into MergeUpstream3 2020-05-28 15:29:00 +10:00
Doyle 83662e0ab4 Merge commit '7caa2b0' into MergeUpstream3 2020-05-25 15:26:29 +10:00
Doyle e3e3990fa8 Merge commit '15dabf7d18244ec5e592f2ad4cfe49495c4d1c80' into MergeUpstream3 2020-05-21 13:38:08 +10:00
Doyle 90d53cac90 Merge commit 'f68512e9e41fa9447508dedefe6aec94c94cf6df' into MergeUpstream3 2020-05-18 16:16:29 +10:00
cslashm 688a3e87e7 Add timelock verification on device 2020-04-08 11:12:32 +02:00
xiphon 29b7cd1351 device_ledger: include status code name in error message 2020-02-08 01:46:39 +00:00
Jason Rhinelander 8a276b362f Store loki version as std::array<u16,3> everywhere
Currently we store it as various different things: 3 separate ints, 2
u16s, 3 separate u16s, and a vector of u16s.  This unifies all version
values to a `std::array<uint16_t,3>`.

- LOKI_VERSION_{MAJOR,MINOR,PATCH} are now just LOKI_VERSION
- The previous LOKI_VERSION (C-string of the version) is now renamed
  LOKI_VERSION_STR

A related change included here is that the restricted RPC now returns
the major version in the get_info rpc call instead of an empty string
(e.g. "5" instead of "").  There is almost certainly enough difference
in the RPC results to distinguish major versions already so this doesn't
seem like it actually leaks anything significant.
2019-11-27 14:07:52 -04:00
xiphon 296ec7c9bb device: bounds checking in Ledger send_secret/receive_secret 2019-10-25 13:13:23 +00:00
cslashm 32febd277d Fix debug feature 2019-10-03 16:05:40 +02:00
cslashm 235b94eb59 Revert PR #5835 (export view key) 2019-10-03 16:05:40 +02:00
cslashm 34f28a79bc Add display address 2019-10-03 16:05:32 +02:00
cslashm d25acd7a1d Add hmac over encrypted value during transaction 2019-10-03 16:01:34 +02:00
luigi1111 4ef3848423
Merge pull request #5835
26f7a26 device: fix ledger requesting secret keys export twice (xiphon)
2019-09-08 19:42:49 -05:00
moneromooo-monero 7c894fc7fd
device_ledger: add paranoid buffer overflow check
Coverity 200183
2019-08-26 12:50:26 +00:00
xiphon 26f7a26ee3 device: fix ledger requesting secret keys export twice 2019-08-20 16:08:09 +00:00
Jason Rhinelander c509198c00 Silence unused variable warnings (#692)
These all produce compilation warnings and look perfectly safe to
remove.
2019-07-01 10:10:03 +10:00
Doyle 639d7456f7 Merge commit '1d5e8f4' into LokiMergeUpstream 2019-06-26 13:04:37 +10:00
moneromooo-monero 35c20c4332
Fix GCC 9.1 build warnings
GCC wants operator= aand copy ctor to be both defined, or neither
2019-06-09 09:39:18 +00:00
Doyle 80de6f0825 Fix ledger re-declaration of is_change 2019-05-07 15:52:17 +10:00
Doyle f7e7bebd17 Update MONERO #defines to LOKI 2019-05-07 14:48:07 +10:00
Doyle 721fd318d5 Merge commit '5db72d1' into LokiMergeUpstream 2019-04-12 18:41:07 +10:00
Doyle 9d1df98f37 Merge commit '4308a2e' into LokiMergeUpstream 2019-04-12 18:00:11 +10:00
Doyle 892469ded1 Update monero copyright to 2019 pre-emptively to make merge simpler 2019-04-12 14:36:43 +10:00
Doyle 8130b24e44 Merge commit '5fb4a9719cb799ae59e04cda0a3d760be969d7e8' into LokiMergeUpstream 2019-04-10 16:00:32 +10:00
cslashm 83fc45a413 Add NanoX support 2019-04-01 17:40:24 +02:00
cslashm 7c44091541 Add get_tx_proof support, needed for new sanity check
Enhance debug info
2019-03-28 18:26:15 +01:00
cslashm 98fdcb2aa5 Add support for V11 protocol with BulletProofV2 and short amount.
New scheme key destination contrfol
Fix dummy decryption in debug mode
2019-03-28 18:26:15 +01:00
cslashm 3a981a3313 Add application version compatibility check. 2019-03-28 18:26:15 +01:00
binaryFate 1f2930ce0b Update 2019 copyright 2019-03-05 22:05:34 +01:00
moneromooo-monero ef93b0995c
various: remove unused variables 2019-03-04 22:24:49 +00:00
Doyle a8b1db4f8c Fix #define hiding incorrect variable decl 2019-02-25 18:17:12 +11:00
cslashm d0e0e89651 New scheme key destination contrfol
Implies protocol version management.
2019-02-20 17:09:16 +11:00
cslashm 5656c6a3d5 fix log namespace 2019-02-20 16:28:43 +11:00
cslashm 3a6b8adae5 Add support for V10 protocol with BulletProofV2 and short amount. 2019-02-20 16:28:38 +11:00
cslashm 2dbc487ec0 Add support for V10 protocol with BulletProofV2 and short amount. 2019-02-08 17:02:55 +01:00
cslashm f0e55cebf7 fix log namespace 2019-02-08 17:02:55 +01:00
cslashm 460da140ec New scheme key destination contrfol
Implies protocol version management.
2019-02-08 17:02:44 +01:00
doy-lee 245c4b3ba0 Merge commit '4f104a0' into LokiMergeUpstream 2019-01-30 15:03:46 +11:00
doy-lee 6634d97e29 Merge commit '0daa00e' into LokiMergeUpstream 2019-01-30 13:05:20 +11:00
Riccardo Spagni 77e96d0948
Merge pull request #5055
6c060e6a device: proper handling of user input (selsta)
2019-01-28 21:27:10 +02:00
Riccardo Spagni 0c970fde1c
Merge pull request #5054
93c21644 device_ledger: remove full_name variable (selsta)
2019-01-28 21:26:44 +02:00
moneromooo-monero 99d946e619
ringct: encode 8 byte amount, saving 24 bytes per output
Found by knaccc
2019-01-22 23:17:31 +00:00
selsta 6c060e6aaa
device: proper handling of user input
(1) If the user denies something on the Ledger,
    a proper error message is now shown.
(2) Ledger doesn't time out anymore while waiting
    on user input.
(3) Lower the timeout to 2 seconds, this is enough for
    normal Ledger <-> System communication.
2019-01-09 15:45:06 +01:00