Commit Graph
100 Commits
Author SHA1 Message Date
Lee *!* Clagett 3f3229a9a7 Add byte_stream value_type and data() 2024-10-23 15:47:22 -04:00
Lee Clagett 8b29ae4885 Relax static_asserts in src/lmdb 2024-10-09 16:48:34 -04:00
Lee Clagett 1f733fb868 Make wallet2::estimate_fee static 2024-08-07 17:43:03 -04:00
Lee *!* Clagett c5ad937cc1 Fix ZMQ DaemonInfo:
* top_block_hash was never set in handler
  * wide_difficulty was never sent in JSON
  * wide_cumulative_difficulty was never sent in JSON
2024-06-24 20:06:33 -04:00
Lee Clagett e875a587e2 Fix ZMQ Tx Pruning 2024-06-21 21:37:31 -04:00
Lee *!* Clagett 7686af7acf Skip privacy networks (on tx sends) that don't have outgoing connections 2024-03-29 15:30:14 -04:00
Lee *!* Clagett 052df1b28c Zero initialize rctSigBase elements 2024-02-06 13:23:10 -05:00
Lee Clagett 98ee46f249 Disable/fix ports with I2P 2024-01-30 13:36:21 -05:00
Lee *!* Clagett f5b86342e8 Add <cstdint> to aligned test 2024-01-29 21:40:50 -05:00
Lee Clagett 47d8899c90 Fix missing checks for IsObject in ZMQ jsonrpc reading 2023-11-28 18:05:15 -05:00
Lee *!* Clagett fe746dca4e Fix EAGAIN bug in ZMQ-RPC/ZMQ-PUB 2023-11-04 13:57:28 -04:00
Lee *!* Clagett aed36a25d6 Set SSL SNI even when server verification is disabled 2023-06-16 19:16:30 -04:00
Lee Clagett c6530d2f5d Add CLSAG serialization to ZMQ code 2023-06-16 19:00:12 -04:00
Lee Clagett 1bb5d25e31 Fix dandelion++ fluff/stem bug with local txes 2022-10-25 16:01:09 -04:00
Lee *!* Clagett 2a8a51129f Quicker resource cleanup on p2p socks timeout 2021-07-29 08:54:13 +00:00
Lee Clagett 9867a913dc Store RPC SSL key/cert for consistent authentication between runs 2021-02-13 20:26:26 +00:00
Lee Clagett bd129849f0 Remove copies from foreach loops (thanks to Clang) 2021-01-28 23:42:40 -05:00
Lee Clagett 1572df9e26 Removing unused namespace alias 2021-01-28 23:40:57 -05:00
Lee Clagett 2a20434705 Fix monerod --rpc-ssl disabled 2021-01-28 17:53:47 +00:00
Lee Clagett 08e4497c6e Improve cryptonote (block and tx) binary read performance 2021-01-23 06:23:39 +00:00
Lee Clagett 545b9825d6 Remove unnecessary atomic operations in levin code 2021-01-19 04:44:03 +00:00
Lee Clagett 679d05567d Remove payload copy in all outgoing p2p messages 2021-01-19 02:22:32 +00:00
Lee Clagett 0f2b5af0dd Reduced executable size; reduced call sequence to "allowed" log function 2021-01-16 22:55:41 +00:00
Lee Clagett 23aae5571b Remove payload copy in all outgoing p2p messages 2021-01-16 22:53:28 +00:00
Lee Clagett 927141bcc4 Command max_bytes moved from dynamic map to static switch 2020-12-22 20:54:16 +00:00
Lee Clagett 187b4d7521 Restrict duplicate keys in epee binary format 2020-12-20 03:47:32 +00:00
Lee Clagett 61b6e4cc67 Add aggressive restrictions to pre-handshake p2p buffer limit 2020-12-17 00:36:10 +00:00
Lee Clagett 4978f69d7a Fix byte_stream::put_n 2020-12-14 14:45:24 -05:00
Lee Clagett b10878f108 Change Dandelion++ fluff probability to 20%, and embargo timeout to 39s
A 20% fluff probability increases the precision of a spy connected to
every node by 10% on average, compared to a network using 0% fluff
probability. The current value (10% fluff) should increase precision by
~5% compared to baseline.

This decreases the expected stem length from 10 to 5. The embargo
timeout was therefore lowered to 39s; the fifth node in a stem is
expected to have a 90% chance of being the first to timeout, which is
the same probability we currently have with an expected stem length of
10 nodes.
2020-11-17 21:45:37 -05:00
Lee Clagett d73cb95dfa Fix timeout checks for forwarded and Dandelion++ stem txes 2020-11-15 00:08:10 -05:00
Lee Clagett be84f678b9 Switch to Dandelion++ fluff mode if no out connections for stem mode 2020-11-03 13:58:14 -05:00
Lee Clagett aad780bcfa Fix CLI and unrestricted RPC relay_tx with stempool 2020-10-29 00:17:55 -04:00
Lee Clagett 2abdbf63cf Add support for i2p and tor seed nodes 2020-10-19 13:13:07 +00:00
Lee Clagett 13350f79df Do not use peer_id tracking method over i2p/tor 2020-10-15 16:47:59 +00:00
Lee Clagett 08eb0949f3 Change to more efficient allocation strategy in byte_stream 2020-10-13 15:10:54 +00:00
Lee Clagett 249eae5f4a Allow byte_stream->byte_slice conversion to shrink unused buffer space 2020-10-13 15:09:18 +00:00
Lee Clagett 7414e2bac1 Change epee binary output from std::stringstream to byte_stream 2020-10-10 15:28:40 +00:00
Lee Clagett 386ef03be3 Add TLSA support to DNSSEC fetching 2020-10-07 15:43:31 +00:00
Lee Clagett dff1d8067c Fix tx flush callback queueing 2020-10-06 16:07:49 +00:00
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