Commit Graph

139 Commits

Author SHA1 Message Date
cslashm e745c1e38d Code modifications to integrate Ledger HW device into monero-wallet-cli.
The basic approach it to delegate all sensitive data (master key, secret
ephemeral key, key derivation, ....) and related operations to the device.
As device has low memory, it does not keep itself the values
(except for view/spend keys) but once computed there are encrypted (with AES
are equivalent) and return back to monero-wallet-cli. When they need to be
manipulated by the device, they are decrypted on receive.

Moreover, using the client for storing the value in encrypted form limits
the modification in the client code. Those values are transfered from one
C-structure to another one as previously.

The code modification has been done with the wishes to be open to any
other hardware wallet. To achieve that a C++ class hw::Device has been
introduced. Two initial implementations are provided: the "default", which
remaps all calls to initial Monero code, and  the "Ledger", which delegates
all calls to Ledger device.
2018-03-04 12:54:53 +01:00
iDunk5400 ed6c68db1b
crypto: add missing include (WIN32) 2018-02-16 19:35:31 +01:00
Riccardo Spagni f4a6bc79d9
Merge pull request #3226
e4646379 keccak: fix mdlen bounds sanity checking (moneromooo-monero)
2e3e90ac pass large parameters by const ref, not value (moneromooo-monero)
61defd89 blockchain: sanity check number of precomputed hash of hash blocks (moneromooo-monero)
9af6b2d1 ringct: fix infinite loop in unused h2b function (moneromooo-monero)
8cea8d0c simplewallet: double check a new multisig wallet is multisig (moneromooo-monero)
9b98a6ac threadpool: catch exceptions in dtor, to avoid terminate (moneromooo-monero)
24803ed9 blockchain_export: fix buffer overflow in exporter (moneromooo-monero)
f3f7da62 perf_timer: rewrite to make it clear there is no division by zero (moneromooo-monero)
c6ea3df0 performance_tests: remove add_arg call stray extra param (moneromooo-monero)
fa6b4566 fuzz_tests: fix an uninitialized var in setup (moneromooo-monero)
03887f11 keccak: fix sanity check bounds test (moneromooo-monero)
ad11db91 blockchain_db: initialize m_open in base class ctor (moneromooo-monero)
bece67f9 miner: restore std::cout precision after modification (moneromooo-monero)
1aabd14c db_lmdb: check hard fork info drop succeeded (moneromooo-monero)
2018-02-16 14:26:58 +01:00
Riccardo Spagni 666a76652b
Merge pull request #3187
851bd057 call _exit instead of abort in release mode (moneromooo-monero)
2018-02-16 14:20:31 +01:00
Riccardo Spagni ba22928d4b
Merge pull request #3180
1dfed567 Fixed #if instead of #ifdef (Matt Little)
7c442453 Support building cncrypto lib with msvc (Matt Little)
2018-02-16 14:19:42 +01:00
moneromooo-monero e4646379a6
keccak: fix mdlen bounds sanity checking
found by h908714124
2018-02-07 13:39:32 +00:00
moneromooo-monero 03887f1140
keccak: fix sanity check bounds test
Nothing calls this with those inputs
2018-02-02 15:48:06 +00:00
moneromooo-monero 851bd057ec
call _exit instead of abort in release mode
Avoids cores being created, as they're nowadays often piped
to some call home system
2018-02-01 13:32:46 +00:00
Riccardo Spagni 7de1685bd8
Merge pull request #3119
c4f43779 crypto: add a ge_p3_identity constant (moneromooo-monero)
13b4c90e crypto: add scalar mult functions returning ge_p3 instead of ge_p2 (moneromooo-monero)
2018-01-27 17:24:42 -08:00
xmr-eric 18216f19dd Update 2018 copyright 2018-01-26 10:03:20 -05:00
Matt Little 7c4424531f Support building cncrypto lib with msvc 2018-01-25 13:00:45 -07:00
moneromooo-monero c4f437796d
crypto: add a ge_p3_identity constant 2018-01-15 00:30:46 +00:00
moneromooo-monero 13b4c90e01
crypto: add scalar mult functions returning ge_p3 instead of ge_p2
ge_scalarmult_p3
ge_double_scalarmult_precomp_vartime2_p3
ge_double_scalarmult_base_vartime_p3

This makes it possible to reuse the result without having to
convert back to unsigned char[32] and back to ge types.
2018-01-15 00:30:26 +00:00
Riccardo Spagni 529ca39e9d
Merge pull request #2988
8a4610c3 blake256: fix wrong hash when computed in parts (moneromooo-monero)
2018-01-10 11:52:32 +01:00
stoffu 6d8b29ef28
fix some link errors in debug mode for macos 2018-01-10 01:57:56 +00:00
moneromooo-monero fdd4c5e577
move memwipe to epee to avoid common<->crypto circular dependencies 2018-01-10 01:57:54 +00:00
moneromooo-monero 1e5491e942
Add a chacha20 variant to go with chacha8 2017-12-25 19:28:03 +00:00
moneromooo-monero 8a4610c315
blake256: fix wrong hash when computed in parts
This does not happen when used by the monero code
2017-12-22 12:08:02 +00:00
moneromooo-monero 7193b89fe5 Scrub keys from memory just before scope end.
Partially implements #74.

Securely erases keys from memory after they are no longer needed. Might have a
performance impact, which I haven't measured (perf measurements aren't
generally reliable on laptops).

Thanks to @stoffu for the suggestion to specialize the pod_to_hex/hex_to_pod
functions. Using overloads + SFINAE instead generalizes it so other types can
be marked as scrubbed without adding more boilerplate.
2017-12-16 15:40:33 -07:00
Riccardo Spagni 6c0953b15a
Merge pull request #2860
3dffe71b new wipeable_string class to replace std::string passphrases (moneromooo-monero)
7a2a5741 utils: initialize easylogging++ in on_startup (moneromooo-monero)
54950829 use memwipe in a few relevant places (moneromooo-monero)
000666ff add a memwipe function (moneromooo-monero)
2017-12-16 23:19:27 +02:00
moneromooo-monero ada4291469
add a version of ge_double_scalarmult_precomp_vartime with A precomp 2017-12-07 19:23:10 +00:00
luigi1111 7ff07928ad
sc_mul and sc_muladd 2017-12-07 19:23:05 +00:00
moneromooo-monero 549508296d
use memwipe in a few relevant places 2017-11-27 22:15:37 +00:00
Riccardo Spagni 5c2dfe157b
Merge pull request #2771
e3e838d0 kaccak: remove unused return value (moneromooo-monero)
4877aca2 keccak: some paranoid "can't happen" checks (moneromooo-monero)
2017-11-15 11:22:56 +02:00
Pavel Maryanov a17efcb039
make this build on SunOS/Solaris 2017-11-14 17:03:48 +00:00
moneromooo-monero e3e838d0cf
kaccak: remove unused return value 2017-11-11 11:20:48 +00:00
moneromooo-monero 4877aca2b6
keccak: some paranoid "can't happen" checks 2017-11-07 14:02:37 +00:00
Riccardo Spagni 1740f0a13e
Merge pull request #2583
27fdaaa4 Fix building with -DARCH=default -DNO_AES=ON (moneromooo-monero)
2017-10-15 18:37:14 +02:00
kenshi84 53ad5a0f42
Subaddresses 2017-10-07 13:06:21 +09:00
moneromooo-monero 27fdaaa409
Fix building with -DARCH=default -DNO_AES=ON 2017-10-06 08:47:03 +01:00
moneromooo-monero 5d65a75b69
move checkpoints in a separate library 2017-09-25 21:16:26 +01:00
moneromooo-monero b5345ef4f0
crypto: use malloc instead of alloca 2017-08-23 13:38:03 +01:00
stoffu 8da82256d4
crypto: moved boost::lock_guard into a smaller scope 2017-06-22 18:11:15 +09:00
stoffu c9e0e944e9
Signature proving payment to destination by only revealing key derivation, not the actual tx secret key 2017-06-22 18:11:13 +09:00
Howard Chu 1dd524151d
Fix #1991 asm multiply again
Tweak temp variables and constraints. Was working before if not inlined
but newer gcc tends to inline it.
2017-06-08 21:46:40 +01:00
Gentian 4b932ff314 changed crypto to cncrypto so it generated libcncrypto
fix a cmakelist
2017-05-23 07:45:40 -04:00
hyc a467321800 Clean up ARMv8-a aes_expand_key()
The inline asm was lying about its parameters
2017-04-12 23:53:08 +01:00
Jaquee f5bd346573
IOS CMAKE build settings 2017-04-03 18:38:50 +02:00
Guillaume LE VAILLANT 93b32892f7 Silence warning about possibly uninitialized pointer 2017-03-25 13:53:14 +01:00
darentuzi 585c917691 Specify "524,288" iterations instead of "500,000"
CryptoNight does exactly 524,288 iterations over the scratchpad as defined in CNS008, saying 500,000 could be confusing. I know its meant to give a rough idea (around 500k) to the reader but if you are reading the code, might as well know the exact number.
2017-03-14 16:39:44 +02:00
Riccardo Spagni c3599fa7b9
update copyright year, fix occasional lack of newline at line end 2017-02-21 19:38:18 +02:00
NanoAkron 67693415ff
Fix compiler error about nested externs in slow_hash.c by moving declarations 2017-02-13 22:35:43 +00:00
Riccardo Spagni 2a996f492f
Merge pull request #1510
80abc3bc Build wallet with Android NDK (MoroccanMalinois)
2017-01-08 16:40:02 -08:00
MoroccanMalinois 80abc3bc4a Build wallet with Android NDK 2017-01-05 01:11:05 +00:00
fireice-uk 474c249c90 cleaner log calc algorithm 2016-12-22 20:29:41 +00:00
Antonio Huete Jimenez b00da61eab Preliminary support for DragonFly BSD
- It builds but no further testing has been done.
2016-12-15 02:27:53 -08:00
moneromooo-monero f6fcf0ef26
oaes_lib: fix a leak on OOM error path
found by coverity
2016-12-10 12:51:20 +00:00
moneromooo-monero c80f4d416d
wallet: fix output collision detection for view wallets
View wallets do not have the spend secret key, and are thus
unable to derive key images for incoming outputs. Moreover,
a previous patch set key images to zero as a means to mark
an output as having an unknown key image, so they could be
filled in when importing key images at a later time. That
later patch caused spurious collisions. We now use public
keys to detect duplicate outputs. Public keys obtained from
the blockchain are checked to be identical to the ones
derived locally, so can't be spoofed.
2016-11-07 18:59:30 +00:00
NanoAkron f71b06770b
Changed to ..._HASHBITS everywhere for consistency 2016-10-29 14:59:06 +01:00
Randi Joseph 9e54616924 Dropped "bit" from bitmonero. 2016-09-26 17:22:30 -04:00