Age | Commit message (Collapse) | Author | Files | Lines |
|
cf3be99 Template hash func to fix compiler error on < gcc-6 (j-berman)
|
|
|
|
|
|
|
|
6ef945d Doxygen: Hide anonymous namespaces from documentation by default (Jeffrey)
|
|
f7d50cb EPEE: Remove gzip_encoding.h (Jeffrey)
|
|
Bonus: little doc fix for net_ssl.h
|
|
|
|
reported by m31007
|
|
Relevant commit in old PR:
1b798a7042070cc8063bd341ebf7025da554b632
|
|
Relevant commit on old PR:
2499269696192ce30dd125ddee90a80d4326dff9
|
|
Relevant commits on the old cleanup PR:
36933c7f5c7778e2d7fbfea5361c11fb41070467
21e43de0f300ee47b7e597098908601bf591950b
3c678bb1cedfd7b865ac2e7aaf014de4bfb3eb3d
|
|
Actions:
1. Remove unused functions from misc_os_dependent.h
2. Move three remaining functions, get_gmt_time, get_ns_count, and get_tick_count into time_helper.h
3. Remove unused functions from time_helper.h
4. Refactor get_ns_count and get_internet_time_str and get_time_interval_string
5. Remove/add includes as needed
Relevant commits on the old PR:
a9fbe52b02ffab451e90c977459fea4642731cd1
9a59b131c4ed1be8afe238fff3780fe203c65a46
7fa9e2817df9b9ef3f0290f7f86357939829e588
|
|
Remove unused include statements or unused definitions.
|
|
Here lies dozens of unused files. This commit is ONLY file deletions except
for the removing of a couple of #includes and removing filenames from CmakeLists
where appropriate.
|
|
17772ef Eliminate dependence on boost::interprocess #8223 (Jeffrey)
|
|
da9aa1f Copyright: Update to 2022 (mj-xmr)
|
|
In this repo, `boost::interprocess` was being used soley to make `uint32_t` operations atomic. So I replaced each instance of
`boost::interprocess::ipcdetail::atomic(...)32` with `std::atomic` methods. I replaced member declarations as applicable. For example,
when I needed to change a `volatile uint32_t` into a `std::atomic<uint32_t>`. Sometimes, a member was being used a boolean flag, so
I replaced it with `std::atomic<bool>`.
You may notice that I didn't touch `levin_client_async.h`. That is because this file is entirely unused and will be deleted in PR monero-project#8211.
Additional changes from review:
* Make some local variables const
* Change postfix operators to prefix operators where value was not need
|
|
|
|
Fixes issues reported in #8120
|
|
|
|
|
|
679d055 Remove payload copy in all outgoing p2p messages (Lee Clagett)
|
|
|
|
This reverts commit 63c7ca07fba2f063c760f786a986fb3e02fb040e, reversing
changes made to 2218e23e84a89e9a1e4c0be5d50f891ab836754f.
|
|
23aae55 Remove payload copy in all outgoing p2p messages (Lee Clagett)
|
|
2935a0c async_protocol_handler_config: fix deadlock (anon)
c877705 async_protocol_handler_config: add deadlock demo (anon)
|
|
9867a91 Store RPC SSL key/cert for consistent authentication between runs (Lee Clagett)
|
|
daf023d epee: don't log raw packet data (moneromooo-monero)
|
|
|
|
556af11 epee: return HTTP error 400 (Bad request) on deserialization error (moneromooo-monero)
|
|
It's better than 404 (Not found)
|
|
|
|
545b982 Remove unnecessary atomic operations in levin code (Lee Clagett)
|
|
df2f00f boosted_tcp_server: fix connection lifetime (anon)
3833624 boosted_tcp_server: add segfault demo (anon)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fixes massive amounts of time spent on pathological inputs
Found by OSS-Fuzz
|
|
13eee1d6a rpc: reject wrong sized txid (moneromooo-monero)
92e6b7df2 easylogging++: fix crash with reentrant logging (moneromooo-monero)
6dd95d530 epee: guard against exceptions in RPC handlers (moneromooo-monero)
90016ad74 blockchain: guard against exceptions in add_new_block/children (moneromooo-monero)
|
|
86abf558c epee: Remove unused functions in local_ip.h (Jean Pierre Dudey)
|
|
|
|
Signed-off-by: Jean Pierre Dudey <me@jeandudey.tech>
|
|
|
|
8656a8c9f remove double includes (sumogr)
|
|
5ef0607da Update copyright year to 2020 (SomaticFanatic)
|
|
|
|
|
|
Update copyright year to 2020
|
|
e509ede trezor: adapt to new passphrase mechanism (ph4r05)
|
|
- choice where to enter passphrase is now made on the host
- use wipeable string in the comm stack
- wipe passphrase memory
- protocol optimizations, prepare for new firmware version
- minor fixes and improvements
- tests fixes, HF12 support
|
|
- Add abstract_http_client.h which http_client.h extends.
- Replace simple_http_client with abstract_http_client in wallet2,
message_store, message_transporter, and node_rpc_proxy.
- Import and export wallet data in wallet2.
- Use #if defined __EMSCRIPTEN__ directives to skip incompatible code.
|
|
c61abf8 remove empty statements (shopglobal)
|
|
When a handshake fails, it can fail due to timeout or destroyed
connection, in which case the connection will be, or already is,
closed, and we don't want to do it twice.
Additionally, when closing a connection directly from the top
level code, ensure the connection is gone from the m_connects
list so it won't be used again.
AFAICT this is now clean in netstat, /proc/PID/fd and print_cn.
This fixes a noisy (but harmless) exception.
|
|
352bd132 abstract_tcp_server2: guard against negative timeouts (moneromooo-monero)
|
|
4771a7ae p2p: remove obsolete local time in handshake (moneromooo-monero)
2fbbc4a2 p2p: avoid sending the same peer list over and over (moneromooo-monero)
3004835b epee: remove backward compatible endian specific address serialization (moneromooo-monero)
39a343d7 p2p: remove backward compatible peer list (moneromooo-monero)
60631802 p2p: simplify last_seen serialization now we have optional stores (moneromooo-monero)
9467b2e4 cryptonote_protocol: omit top 64 bits of difficulty when 0 (moneromooo-monero)
b595583f serialization: do not write optional fields with default value (moneromooo-monero)
5f98b46d p2p: remove obsolete local time from TIMED_SYNC (moneromooo-monero)
|
|
Cleaning up a little around the code base.
|
|
e896cca8 epee: reorder a couple init list fields to match declaration (moneromooo-monero)
|
|
|
|
6efeefbc epee: set application/json MIME type on json errors (moneromooo-monero)
|
|
|
|
This is a bug waiting to happen
|
|
|
|
This fixes rapid reconnections failing as the peer hasn't yet
worked out the other side is gone, and will reject "duplicate"
connections until a timeout.
|
|
9f3be3b epee: use SO_REUSEADDR on non-Windows targets (xiphon)
|
|
|
|
23ba69e epee: fix SSL server handshake, run_one() can block, use poll_one() (xiphon)
|
|
1080136 abstract_tcp_server2: move 'Trying to connect' from error to debug (moneromooo-monero)
|
|
|
|
e48dcb7 levin: armour against some 'should not happen' case (moneromooo-monero)
|
|
If adding a response handler after the protocol is released,
they could never be cancelled again, and would end up keeping
a ref that never goes away
|
|
c9cfbf7 epee: tcp server - set SO_LINGER instead of SO_REUSEADDR option (xiphon)
|
|
4b654f6 abstract_tcp_server2: log pointer, not contents, where appropriate (moneromooo-monero)
|
|
and fix the message grammar
|
|
4371791 epee: implement handshake timeout for SSL connections (xiphon)
|
|
7d81850 epee: fix network timeouts in blocked_mode_client (xiphon)
|
|
|
|
1b91beb abstract_tcp_server2: fix lingering connections (moneromooo-monero)
|
|
Coverity fixes [3a81639, 1bd962d, 2825f07, d099658, d46f701, cd57a10] (anonimal)
|
|
|
|
|
|
|
|
73f22c4 depends: fix MacOS build with Clang 3.7.1 (vtnerd)
|
|
Resetting the timer after shutdown was initiated would keep
a reference to the object inside ASIO, which would keep the
connection alive until the timer timed out
|
|
|
|
The problem actually exists in two parts:
1. When sending chunks over a connection, if the queue size is
greater than N, the seed is predictable across every monero node.
>"If rand() is used before any calls to srand(), rand() behaves as if
it was seeded with srand(1). Each time rand() is seeded with the same seed, it
must produce the same sequence of values."
2. The CID speaks for itself: "'rand' should not be used for security-related
applications, because linear congruential algorithms are too easy to break."
*But* this is an area of contention.
One could argue that a CSPRNG is warranted in order to fully mitigate any
potential timing attacks based on crafting chunk responses. Others could argue
that the existing LCG, or even an MTG, would suffice (if properly seeded). As a
compromise, I've used an MTG with a full bit space. This should give a healthy
balance of security and speed without relying on the existing crypto library
(which I'm told might break on some systems since epee is not (shouldn't be)
dependent upon the existing crypto library).
|
|
IP addresses are stored in network byte order even on little
endian hosts
|
|
IPv4 addresses are kept in network byte order in memory
|
|
2a41dc0 epee: fix connections not being properly closed in some instances (moneromooo-monero)
|
|
Fixed by Fixed by crCr62U0
|
|
fcbf7b3 p2p: propagate out peers limit to payload handler (moneromooo-monero)
098aadf p2p: close the right number of connections on setting max in/out peers (moneromooo-monero)
|
|
a182df2 Bans for RPC connections (hyc)
|
|
new cli options (RPC ones also apply to wallet):
--p2p-bind-ipv6-address (default = "::")
--p2p-bind-port-ipv6 (default same as ipv4 port for given nettype)
--rpc-bind-ipv6-address (default = "::1")
--p2p-use-ipv6 (default false)
--rpc-use-ipv6 (default false)
--p2p-require-ipv4 (default true, if ipv4 bind fails and this is
true, will not continue even if ipv6 bind
successful)
--rpc-require-ipv4 (default true, description as above)
ipv6 addresses are to be specified as "[xx:xx:xx::xx:xx]:port" except
in the cases of the cli args for bind address. For those the square
braces can be omitted.
|
|
9a6006b abstract_tcp_server2: move some things out of a lock (moneromooo-monero)
|
|
6abaaaa remove obsolete save_graph skeleton code (moneromooo-monero)
|
|
f61a315 net_utils: fix m_ssl type from time_t to bool (moneromooo-monero)
|
|
|
|
|
|
|
|
|
|
|
|
Make bans control RPC sessions too. And auto-ban some bad requests.
Drops HTTP connections whenever response code is 500.
|
|
|
|
b0a04f7 epee: fix SSL autodetect on reconnection (xiphon)
|
|
|
|
GCC wants operator= aand copy ctor to be both defined, or neither
|
|
|
|
The lock is meant for the network throttle object only,
and this should help coverity get unconfused
|
|
|
|
|
|
add two RSA based ciphers for Windows/depends compatibility
also enforce server cipher ordering
also set ECDH to auto because vtnerd says it is good :)
When built with the depends system, openssl does not include any
cipher on the current whitelist, so add this one, which fixes the
problem, and does seem sensible.
|
|
SHA1 is too close to bruteforceable
|
|
9956500d net_helper: clear recv buffer on eof (moneromooo-monero)
|
|
|
|
It can allocate a lot when getting a lot of connections
(in particular, the stress test on windows apparently pushes
that memory to actual use, rather than just allocated)
|
|
b18f0b10 wallet: new --offline option (moneromooo-monero)
|
|
61d63900 net_helper: avoid unnecessary memcpy (moneromooo-monero)
|
|
It will avoid connecting to a daemon (so useful for cold signing
using a RPC wallet), and not perform DNS queries.
|
|
|
|
When closing connections due to exiting, the IO service is
already gone, so the data exchange needed for a gracious SSL
shutdown cannot happen. We just close the socket in that case.
|
|
|
|
displays total sent and received bytes
|
|
If `--daemon-ssl enabled` is set in the wallet, then a user certificate,
fingerprint, or onion/i2p address must be provided.
|
|
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.
|
|
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.
|
|
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.
|
|
|
|
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.
|
|
59776a64 epee: some more minor JSON parsing speedup (moneromooo-monero)
|
|
c23ea796 New interactive daemon command 'print_net_stats': Global traffic stats (rbrunner7)
|
|
|
|
|
|
|
|
16590294 abstract_tcp_server2: fix crashy race on socket shutdown (moneromooo-monero)
|
|
get_io_service was deprecated, and got removed
|
|
|
|
1f2930ce Update 2019 copyright (binaryFate)
|
|
Use SSL API directly, skip boost layer
|
|
|
|
RPC connections now have optional tranparent SSL.
An optional private key and certificate file can be passed,
using the --{rpc,daemon}-ssl-private-key and
--{rpc,daemon}-ssl-certificate options. Those have as
argument a path to a PEM format private private key and
certificate, respectively.
If not given, a temporary self signed certificate will be used.
SSL can be enabled or disabled using --{rpc}-ssl, which
accepts autodetect (default), disabled or enabled.
Access can be restricted to particular certificates using the
--rpc-ssl-allowed-certificates, which takes a list of
paths to PEM encoded certificates. This can allow a wallet to
connect to only the daemon they think they're connected to,
by forcing SSL and listing the paths to the known good
certificates.
To generate long term certificates:
openssl genrsa -out /tmp/KEY 4096
openssl req -new -key /tmp/KEY -out /tmp/REQ
openssl x509 -req -days 999999 -sha256 -in /tmp/REQ -signkey /tmp/KEY -out /tmp/CERT
/tmp/KEY is the private key, and /tmp/CERT is the certificate,
both in PEM format. /tmp/REQ can be removed. Adjust the last
command to set expiration date, etc, as needed. It doesn't
make a whole lot of sense for monero anyway, since most servers
will run with one time temporary self signed certificates anyway.
SSL support is transparent, so all communication is done on the
existing ports, with SSL autodetection. This means you can start
using an SSL daemon now, but you should not enforce SSL yet or
nothing will talk to you.
|
|
|
|
4d3b61a3 Use io_service::work in epee tcp server (Lee Clagett)
|
|
7af4fbd4 epee: Add space after ':' in additional http response headers (Tom Smeding)
|
|
7c3ade44 network_throttle: use circular_buffer where appropriate (moneromooo-monero)
|
|
123fc2a2 i2p: initial support (Jethro Grassie)
|
|
|
|
|
|
RPC connections now have optional tranparent SSL.
An optional private key and certificate file can be passed,
using the --{rpc,daemon}-ssl-private-key and
--{rpc,daemon}-ssl-certificate options. Those have as
argument a path to a PEM format private private key and
certificate, respectively.
If not given, a temporary self signed certificate will be used.
SSL can be enabled or disabled using --{rpc}-ssl, which
accepts autodetect (default), disabled or enabled.
Access can be restricted to particular certificates using the
--rpc-ssl-allowed-certificates, which takes a list of
paths to PEM encoded certificates. This can allow a wallet to
connect to only the daemon they think they're connected to,
by forcing SSL and listing the paths to the known good
certificates.
To generate long term certificates:
openssl genrsa -out /tmp/KEY 4096
openssl req -new -key /tmp/KEY -out /tmp/REQ
openssl x509 -req -days 999999 -sha256 -in /tmp/REQ -signkey /tmp/KEY -out /tmp/CERT
/tmp/KEY is the private key, and /tmp/CERT is the certificate,
both in PEM format. /tmp/REQ can be removed. Adjust the last
command to set expiration date, etc, as needed. It doesn't
make a whole lot of sense for monero anyway, since most servers
will run with one time temporary self signed certificates anyway.
SSL support is transparent, so all communication is done on the
existing ports, with SSL autodetection. This means you can start
using an SSL daemon now, but you should not enforce SSL yet or
nothing will talk to you.
|
|
|
|
|
|
- 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).
|
|
|
|
The blockchain prunes seven eighths of prunable tx data.
This saves about two thirds of the blockchain size, while
keeping the node useful as a sync source for an eighth
of the blockchain.
No other data is currently pruned.
There are three ways to prune a blockchain:
- run monerod with --prune-blockchain
- run "prune_blockchain" in the monerod console
- run the monero-blockchain-prune utility
The first two will prune in place. Due to how LMDB works, this
will not reduce the blockchain size on disk. Instead, it will
mark parts of the file as free, so that future data will use
that free space, causing the file to not grow until free space
grows scarce.
The third way will create a second database, a pruned copy of
the original one. Since this is a new file, this one will be
smaller than the original one.
Once the database is pruned, it will stay pruned as it syncs.
That is, there is no need to use --prune-blockchain again, etc.
|
|
85665003 epee: better network buffer data structure (moneromooo-monero)
|
|
3cf85f0 Changed RECIEVED to RECEIVED in log messages. (normoes)
|
|
avoids pointless allocs and memcpy
|
|
|
|
bd98e99c Removed a lot of unnecessary includes (Martijn Otto)
|
|
|
|
7c298f5d No longer use a list for registering self references in the abstract tcp server (Martijn Otto)
|
|
b620443b epee: log HTTP/RPC calls at info level (moneromooo-monero)
|
|
|
|
server
Updated assert message
Use a local variable that won't destruct at the end of the if-branch
Updated comment
|
|
3381b651 abstract_tcp_server2: fix busy calling of idle IO service (moneromooo-monero)
|
|
It's useful info to have when investigating logs
|
|
00901e9c epee: initialize a few data members where it seems to be appropriate (moneromooo-monero)
144a6c32 abstract_tcp_server2: move m_period to subclass (moneromooo-monero)
758d7684 connection_basic: remove unused floating time start time (moneromooo-monero)
e5108a29 Catch more exceptions in dtors (moneromooo-monero)
|
|
|
|
|
|
This is where it is actually used, and initialized
|
|
|
|
bcf3f6af fuzz_tests: catch unhandled exceptions (moneromooo-monero)
3ebd05d4 miner: restore stream flags after changing them (moneromooo-monero)
a093092e levin_protocol_handler_async: do not propagate exception through dtor (moneromooo-monero)
1eebb82b net_helper: do not propagate exceptions through dtor (moneromooo-monero)
fb6a3630 miner: do not propagate exceptions through dtor (moneromooo-monero)
2e2139ff epee: do not propagate exception through dtor (moneromooo-monero)
0749a8bd db_lmdb: do not propagate exceptions in dtor (moneromooo-monero)
1b0afeeb wallet_rpc_server: exit cleanly on unhandled exceptions (moneromooo-monero)
418a9936 unit_tests: catch unhandled exceptions (moneromooo-monero)
ea7f9543 threadpool: do not propagate exceptions through the dtor (moneromooo-monero)
6e855422 gen_multisig: nice exit on unhandled exception (moneromooo-monero)
53df2deb db_lmdb: catch error in mdb_stat calls during migration (moneromooo-monero)
e67016dd blockchain_blackball: catch failure to commit db transaction (moneromooo-monero)
661439f4 mlog: don't remove old logs if we failed to rename the current file (moneromooo-monero)
5fdcda50 easylogging++: test for NULL before dereference (moneromooo-monero)
7ece1550 performance_test: fix bad last argument calling add_arg (moneromooo-monero)
a085da32 unit_tests: add check for page size > 0 before dividing (moneromooo-monero)
d8b1ec8b unit_tests: use std::shared_ptr to shut coverity up about leaks (moneromooo-monero)
02563bf4 simplewallet: top level exception catcher to print nicer messages (moneromooo-monero)
c57a65b2 blockchain_blackball: fix shift range for 32 bit archs (moneromooo-monero)
|
|
|
|
When this throws in a loop, stack trace generation can take
a significant amount of CPU
|
|
e7c0fcd epee: set jsonrpc to '2.0' in parse error return data (moneromooo-monero)
|
|
979105b abstract_tcp_server2: fix race on shutdown (moneromooo-monero)
|
|
42f3b7c http_protocol_handler: catch invalid numbers when parsing (moneromooo-monero)
0a4a7da http_protocol_handler: fix HTTP/x.y parsing (moneromooo-monero)
|
|
|
|
|
|
It was accepting any character for the dot (yeah, massive big I know)
|
|
|
|
dead780f abstract_tcp_server2: fix use after free (moneromooo-monero)
|
|
1a526ed5 abstract_tcp_server2: restart async accept on error (moneromooo-monero)
|
|
|
|
55c7fb8 epee: adaptive connection timeout system (moneromooo-monero)
|
|
f8dd433 epee: fix detection of 172.16.0.0/172.31.255.255 local IP range (moneromooo-monero)
5db9e3c unit_tests: add tests for local IP range detection (moneromooo-monero)
|
|
|
|
|
|
a connection's timeout is halved for every extra connection
from the same host.
Also keep track of when we don't need to use a connection
anymore, so we can close it and free the resource for another
connection.
Also use the longer timeout for non routable local addresses.
|
|
This would make monerod use 100% CPU when running with torsocks
without Tor running
|
|
|
|
|