Commit Graph
99 Commits
Author SHA1 Message Date
Lee Clagett bdc6b10d62 Fix ZMQ pruned bulletproof transactions 2020-08-19 00:36:06 -04:00
Lee Clagett b641e0a2c0 Add clear method to byte_stream 2020-08-17 21:30:34 -04:00
Lee Clagett 4e2377995d Change ZMQ-JSON txextra to hex and remove unnecessary base fields 2020-08-14 23:01:00 +00:00
Lee Clagett 98c151ecb8 Optimize ZMQ-JSON vector reading; GetBlocksFast reads 24%+ faster 2020-08-14 19:47:19 +00:00
Lee Clagett 60627c9f24 Switch to insitu parsing for ZMQ-JSON; GetBlocksFast reads 13%+ faster 2020-08-14 19:46:59 +00:00
Lee Clagett fe96e66ebe Fix pruned tx for ZMQ's GetBlocksFast 2020-08-14 19:46:33 +00:00
Lee Clagett 4d8d121462 Fix D++ block template check 2020-06-12 22:05:52 -04:00
Lee Clagett 7aeb503547 Fix boost <1.60 compilation and fix boost 1.73+ warnings 2020-05-31 21:18:11 -04:00
Lee Clagett a11ec4ac1d Support for supercop ASM in wallet, and benchmark for supercop 2020-05-16 10:25:17 +00:00
Lee Clagett 67ade80055 Add randomized delay when forwarding txes from i2p/tor -> ipv4/6 2020-05-15 07:57:35 +00:00
Lee Clagett 29e563bb1e Fixed bugs for take_slice and byte_stream->byte_slice 2020-05-12 01:26:37 -04:00
Lee Clagett e5214a2ca2 Adding ZMQ/Pub support for txpool_add and chain_main events 2020-05-04 02:06:35 +00:00
Lee Clagett feee455c9f Fixes for ZMQ JSON-RPC endpoint names for raw tx 2020-04-29 01:07:27 -04:00
Lee Clagett ee58362b1f Used legacy category to match insert_key_images behavior 2020-04-24 20:19:37 -04:00
Lee Clagett afe5a55e96 Revert functional test changes in babf25d2e and 571546067 2020-04-24 18:30:23 -04:00
Lee Clagett c26c93019a Add byte_stream for zero-copy serialization, and add support in ZMQ-JSON. 2020-04-11 04:12:11 +00:00
Lee Clagett da99157462 Use byte_slice for sending zmq messages - removes data copy within zmq 2020-04-03 01:56:17 +00:00
Lee Clagett 571546067f Always reject duplicate key-images from second txid 2020-03-30 17:52:42 +00:00
Lee Clagett babf25d2ec Allow unrestricted rpc calls to get full txpool info 2020-03-30 17:52:42 +00:00
Lee Clagett f9441c5759 Fixed string_ref usage bug in epee::from_hex::vector 2020-03-30 16:53:34 +00:00
Lee Clagett 0c29e17581 Fix network unit tests after epee changes 2020-03-28 13:30:22 -04:00
Lee Clagett 02d887c2e5 Adding Dandelion++ support to public networks:
- New flag in NOTIFY_NEW_TRANSACTION to indicate stem mode
  - Stem loops detected in tx_pool.cpp
  - Embargo timeout for a blackhole attack during stem phase
2020-03-26 15:01:30 +00:00
Lee Clagett ad13a4b2ac Fixing static_asserts in ZMQ JSON 2020-03-19 19:49:51 -04:00
Lee Clagett 5de2295f3c Correct key image check in tx_pool 2020-03-14 19:17:15 +00:00
Lee Clagett e719760253 Fix receive order leakage with tx fluffing 2020-03-10 22:30:07 -04:00
Lee Clagett 3387f0e327 Reduce template bloat in hex->bin for ZMQ json 2020-03-09 17:55:55 +00:00
Lee Clagett 5fcc23ae0a Move hex->bin conversion to monero copyright files and with less includes 2020-03-09 05:23:59 +00:00
Lee Clagett 81c5943453 Remove temporary std::string creation in some hex->bin calls 2020-03-09 05:23:59 +00:00
Lee Clagett ebf3c10fcb Added logging for dropped local txes with no i2p/tor connections 2020-03-07 00:03:17 +00:00
Lee Clagett 0f78b06e8c Various improvements to the ZMQ JSON-RPC handling:
- Finding handling function in ZMQ JSON-RPC now uses binary search
  - Temporary `std::vector`s in JSON output now use `epee::span` to
    prevent allocations.
  - Binary -> hex in JSON output no longer allocates temporary buffer
  - C++ structs -> JSON skips intermediate DOM creation, and instead
    write directly to an output stream.
2020-03-05 14:20:56 +00:00
Lee Clagett 68a6507c3f Fixed bug in ZMQ JSON-RPC method field 2019-11-18 12:59:41 +00:00
Lee Clagett 70c9cd3c9c Change to Tx diffusion (Dandelion++ fluff) instead of flooding 2019-11-04 09:23:20 +00:00
Lee Clagett a9bdc6e4c4 Improved performance for epee serialization:
- Removed copy of field names in binary deserialization
  - Removed copy of array values in binary deserialization
  - Removed copy of string values in json deserialization
  - Removed unhelpful allocation in json string value parsing
  - Removed copy of blob data on binary and json serialization
2019-11-04 01:46:41 +00:00
Lee Clagett 5d7ae2d279 Adding support for hidden (anonymity) txpool 2019-11-02 20:36:03 +00:00
Lee Clagett 65e8a89e1c Change monerod --proxy to --tx-proxy 2019-10-24 21:06:31 -04:00
Lee ClagettandiDunk5400 73f22c48e1 depends: fix MacOS build with Clang 3.7.1 2019-09-08 22:49:11 +02:00
Lee Clagett 2a7d91523b Fixed i2p/tor tx flooding bug (white noise disabled) 2019-07-29 12:27:00 +00:00
Lee Clagett f91a06c6d7 Dropping cppzmq dependency; adding some zmq utils 2019-07-22 06:37:16 +00:00
Lee Clagett 3b24b1d082 Added support for "noise" over I1P/Tor to mask Tx transmission. 2019-07-17 14:22:37 +00:00
Lee Clagett bdfc63ae4d Add ref-counted buffer byte_slice. Currently used for sending TCP data. 2019-07-16 16:30:35 +00:00
Lee Clagett 9bfa4c20ca Fix allow any cert mode in wallet rpc when configured over rpc 2019-05-22 00:15:14 -04:00
Lee Clagett 3544596f9f Add ssl_options support to monerod's rpc mode. 2019-05-22 00:09:11 -04:00
Lee Clagett c9aaccf346 Fix configuration bug; wallet2 --daemon-ssl-allow-any-cert now works. 2019-05-21 15:43:27 -04:00
Lee Clagett 55aae6a9a3 Fix socks tests in windows and handle errors better 2019-04-19 01:10:02 -04:00
Lee Clagett 2e578b8214 Enabling daemon-rpc SSL now requires non-system CA verification
If `--daemon-ssl enabled` is set in the wallet, then a user certificate,
fingerprint, or onion/i2p address must be provided.
2019-04-07 13:02:43 -04:00
Lee Clagett d58f368289 Require manual override for user chain certificates.
An override for the wallet to daemon connection is provided, but not for
other SSL contexts. The intent is to prevent users from supplying a
system CA as the "user" whitelisted certificate, which is less secure
since the key is controlled by a third party.
2019-04-07 00:44:37 -04:00
Lee Clagett 97cd1fa98d Only check top-level certificate against fingerprint list.
This allows "chain" certificates to be used with the fingerprint
whitelist option. A user can get a system-ca signature as backup while
clients explicitly whitelist the server certificate. The user specified
CA can also be combined with fingerprint whitelisting.
2019-04-07 00:44:37 -04:00
Lee Clagett 7c388fb358 Call use_certificate_chain_file instead of use_certificate_file
The former has the same behavior with single self signed certificates
while allowing the server to have separate short-term authentication
keys with long-term authorization keys.
2019-04-07 00:44:37 -04:00
Lee Clagett eca0fea45a Perform RFC 2818 hostname verification in client SSL handshakes
If the verification mode is `system_ca`, clients will now do hostname
verification. Thus, only certificates from expected hostnames are
allowed when SSL is enabled. This can be overridden by forcible setting
the SSL mode to autodetect.

Clients will also send the hostname even when `system_ca` is not being
performed. This leaks possible metadata, but allows servers providing
multiple hostnames to respond with the correct certificate. One example
is cloudflare, which getmonero.org is currently using.
2019-04-07 00:44:37 -04:00
Lee Clagett 0416764cae Require server verification when SSL is enabled.
If SSL is "enabled" via command line without specifying a fingerprint or
certificate, the system CA list is checked for server verification and
_now_ fails the handshake if that check fails. This change was made to
remain consistent with standard SSL/TLS client behavior. This can still
be overridden by using the allow any certificate flag.

If the SSL behavior is autodetect, the system CA list is still checked
but a warning is logged if this fails. The stream is not rejected
because a re-connect will be attempted - its better to have an
unverified encrypted stream than an unverified + unencrypted stream.
2019-04-07 00:44:37 -04:00
Lee Clagett 96d602ac84 Add verify_fail_if_no_cert option for proper client authentication
Using `verify_peer` on server side requests a certificate from the
client. If no certificate is provided, the server silently accepts the
connection and rejects if the client sends an unexpected certificate.
Adding `verify_fail_if_no_cert` has no affect on client and for server
requires that the peer sends a certificate or fails the handshake. This
is the desired behavior when the user specifies a fingerprint or CA file.
2019-04-07 00:44:37 -04:00
Lee Clagett 21eb1b0725 Pass SSL arguments via one class and use shared_ptr instead of reference 2019-04-07 00:44:37 -04:00
Lee Clagett 1f5ed328aa Change default SSL to "enabled" if user specifies fingerprint/certificate
Currently if a user specifies a ca file or fingerprint to verify peer,
the default behavior is SSL autodetect which allows for mitm downgrade
attacks. It should be investigated whether a manual override should be
allowed - the configuration is likely always invalid.
2019-04-06 23:47:07 -04:00
Lee Clagett f18a069fcc Do not require client certificate unless server has some whitelisted.
Currently a client must provide a certificate, even if the server is
configured to allow all certificates. This drops that requirement from
the client - unless the server is configured to use a CA file or
fingerprint(s) for verification - which is the standard behavior for SSL
servers.

The "system-wide" CA is not being used as a "fallback" to verify clients
before or after this patch.
2019-04-06 23:47:06 -04:00
Lee Clagett a3b0284837 Change SSL certificate file list to OpenSSL builtin load_verify_location
Specifying SSL certificates for peer verification does an exact match,
making it a not-so-obvious alias for the fingerprints option. This
changes the checks to OpenSSL which loads concatenated certificate(s)
from a single file and does a certificate-authority (chain of trust)
check instead. There is no drop in security - a compromised exact match
fingerprint has the same worse case failure. There is increased security
in allowing separate long-term CA key and short-term SSL server keys.

This also removes loading of the system-default CA files if a custom
CA file or certificate fingerprint is specified.
2019-04-06 23:47:06 -04:00
Lee Clagett 7acfa9f3cc Added socks proxy (tor/i2pd/kovri) support to wallet 2019-03-25 01:35:13 +00:00
Lee Clagett 0c7e7bce18 Adding classes, functions, and utilities for common LMDB operations. 2019-03-19 17:52:26 +00:00
Lee Clagett 4d3b61a31b Use io_service::work in epee tcp server 2019-02-10 13:40:32 -05:00
Lee Clagett 973403bc9f Adding initial support for broadcasting transactions over Tor
- Support for ".onion" in --add-exclusive-node and --add-peer
  - Add --anonymizing-proxy for outbound Tor connections
  - Add --anonymous-inbounds for inbound Tor connections
  - Support for sharing ".onion" addresses over Tor connections
  - Support for broadcasting transactions received over RPC exclusively
    over Tor (else broadcast over public IP when Tor not enabled).
2019-01-28 23:56:33 +00:00
Lee Clagett a5ffc2d5ad Remove boost::lexical_cast for uuid and unused uuid function 2018-12-23 11:11:30 +00:00
Lee Clagett 6097472a19 Update ZMQ fee estimate and add ZMQ output distribution 2018-10-23 23:46:31 -04:00
Lee Clagett 9b6dd9348c Providing user supplied default constructor for expect<void> 2018-10-15 23:42:29 -04:00
Lee Clagett f3cd51a12b cryptonote tweak v2.2 2018-09-22 03:47:50 +00:00
Lee Clagett 55c7cd1458 Adding expect<T> - a value-or-error implementation 2018-09-12 22:44:34 +00:00
Lee Clagett 26a42fe54a Added features to epee::span<T> :
- Support for classes
  - Added `remove_prefix` function
  - Added `to_mut_span` and `as_mut_byte_span`
2018-08-03 20:33:07 -04:00
Lee Clagett 4616cf2641 Fixed ZMQ-RPC for transactions and GET_BLOCKS_FAST 2018-08-02 07:30:20 +00:00
Lee Clagettandmoneromooo-monero e136bc6b8a tweaks to the monerov1 cryptonight algorithm 2018-03-05 18:18:45 +00:00
Lee Clagett 951716146f Remove is_pod trait, and replace with is_standard_layout requirement 2018-01-18 02:26:19 -05:00
Lee Clagett 161401ddca Fix JSON-RPC response object over ZMQ 2017-10-26 17:25:14 -04:00
Lee Clagett 8b00687735 Upgrades to epee::net_utils::network_address
- internal nullptr checks
  - prevent modifications to network_address (shallow copy issues)
  - automagically works with any type containing interface functions
  - removed fnv1a hashing
  - ipv4_network_address now flattened with no base class
2017-10-05 11:57:09 -04:00
Lee Clagett 5890829552 Fixes static_assert on arm and ppc builds 2017-09-19 10:57:01 -04:00
Lee Clagett 9c83f8063d Do not create file when RPC user/pass is given and use file locking 2017-08-30 17:39:59 -04:00
Lee Clagett 7199fc8373 Removed some unused epee functions 2017-04-25 16:07:32 -04:00
Lee Clagett 93e10f1cc4 Simplified the implementation and features of span 2017-04-11 16:35:14 -04:00
Lee Clagett 4a8f96f95d Improvements for epee binary to hex functions:
- Performance improvements
  - Added `span` for zero-copy pointer+length arguments
  - Added `std::ostream` overload for direct writing to output buffers
  - Removal of unused `string_tools::buff_to_hex`
2017-04-11 16:35:00 -04:00
Lee Clagett 287ef36ed8 Fix freebsd build 2017-03-21 10:41:21 -04:00
Lee Clagett 50cd179a60 Removed boost/asio.hpp include from epee/string_tools.h 2017-03-18 22:05:14 -04:00
Lee Clagett 8c84d48caa Updated default RPC timeout from 5 seconds to 15 seconds 2017-02-24 12:55:17 -05:00
Lee Clagett 2cde2c02ca switch to boost::thread for mingw build 2017-02-16 20:10:23 -05:00
Lee Clagett 6ea3e3ccc7 Fix race in setThreadName/getThreadName 2017-02-07 21:33:26 -05:00
Lee Clagett ce7fcbb4ae Add server auth to monerod, and client auth to wallet-cli and wallet-rpc 2017-02-06 01:15:41 -05:00
Lee Clagett c02e1cb943 Updates to epee HTTP client code
- http_simple_client now uses std::chrono for timeouts
  - http_simple_client accepts timeouts per connect / invoke call
  - shortened names of epee http invoke functions
  - invoke command functions only take relative path, connection
    is not automatically performed
2017-01-25 15:39:32 -05:00
Lee Clagett d81cb08704 Added (not yet enabled) HTTP client authentication 2017-01-11 03:21:17 -05:00
Lee Clagett fa0ee42cc9 Workarounds for gcc 4.8 2016-12-30 02:14:06 -05:00
Lee Clagett 522ab79e9c Fixed HTTP auth tests for gcc 4.9 2016-12-21 13:23:15 -05:00
Lee Clagett d55e2266ca Fixed uninitialized valgrind errors in serialization tests 2016-12-20 12:51:27 -05:00
Lee Clagett 81702b5451 Fixes for google test < 1.8 2016-12-19 20:48:11 -05:00
Lee Clagett 2bddb8ebee Refactored password prompting for wallets 2016-12-19 20:00:43 -05:00
Lee Clagett e3639f5cc3 Removed unused functions 2016-12-19 14:47:26 -05:00
Lee Clagett 427054c3d5 Enabled HTTP auth support for monero-wallet-rpc 2016-12-16 23:59:46 -05:00
Lee Clagett bdc3d7496f Adding HTTP Digest Auth (but not yet enabled) 2016-12-13 00:19:54 -05:00
Lee Clagett 18462aa065 Added confirmation before binding wallet-rpc to external IP 2016-12-05 21:45:11 -05:00
Lee Clagett 91ffb61c25 Added command_line::is_yes 2016-11-25 21:57:27 -05:00
Lee Clagett 8dadf02c4f Fixed undefined behavior in TestDB 2016-11-23 17:22:35 -05:00
Lee Clagett f025198f19 Added task_region - a fork/join task implementation 2016-11-23 14:41:25 -05:00
Lee Clagett 265e4605ec Fixed generate-from-json bug introduced in 358e068 2016-11-12 21:55:08 -05:00
Lee Clagett 358e068e87 Created monero-wallet-rpc, moving functionality from monero-wallet-cli 2016-11-10 16:39:27 -05:00
Lee Clagett 64094e5f4e adding thread_group for managing async tasks 2016-11-02 19:21:55 -04:00
Lee Clagett 4869db702a adding static_assert to pod functions in string tools 2016-10-31 13:22:21 -04:00