Commit Graph

844 Commits

Author SHA1 Message Date
luigi1111 9f6dcbd568
Merge pull request #7308
df2f00f boosted_tcp_server: fix connection lifetime (anon)
3833624 boosted_tcp_server: add segfault demo (anon)
2021-02-15 21:53:43 -05:00
Lee Clagett 9867a913dc Store RPC SSL key/cert for consistent authentication between runs 2021-02-13 20:26:26 +00:00
mj-xmr dc48de74e8 Reduce compilation time of epee/portable_storage.h 2021-02-06 08:18:42 +01:00
Lee Clagett 08e4497c6e Improve cryptonote (block and tx) binary read performance 2021-01-23 06:23:39 +00:00
anon df2f00f44d boosted_tcp_server: fix connection lifetime 2021-01-19 18:15:30 +01: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
luigi1111 218981eba1
Merge pull request #7137
f2ad539 readline_buffer: Avoid consecutive duplicates in the history (codesoap)
2021-01-15 23:46:14 -05:00
moneromooo-monero 372754a66e
storages: overridable limits for loading portable_storage from binary 2021-01-07 20:24:29 +00:00
luigi1111 e144dd5b15
Merge pull request #7281
b9092dd epee: also limit number of strings in portable_storage (moneromooo-monero)
2021-01-06 21:11:09 -05:00
moneromooo-monero b9092ddb5c
epee: also limit number of strings in portable_storage
They require at least 24 bytes
2021-01-05 17:54:25 +00:00
Alexander Blair 7264d64856
Merge pull request #7263
b652d598d add a max levin packet size by command type (moneromooo-monero)
2021-01-03 18:23:57 -08:00
moneromooo-monero daf023de6e
epee: don't log raw packet data 2021-01-03 14:41:01 +00:00
moneromooo-monero b652d598d1
add a max levin packet size by command type 2021-01-03 14:07:45 +00:00
moneromooo-monero 5cd6fda1ee
portable_storage: better sanity checking 2021-01-02 12:34:28 +00:00
Alexander Blair 16c780d568
Merge pull request #7250
61b6e4cc6 Add aggressive restrictions to pre-handshake p2p buffer limit (Lee Clagett)
2021-01-01 22:35:59 -08:00
Alexander Blair 175aa2497a
Merge pull request #7243
8e2caf3fb portable_storage: check object limit where appropriate (moneromooo)
2021-01-01 22:32:53 -08:00
Alexander Blair 5917aec4a1
Merge pull request #7220
20bdbd7aa portable_storage: forbid unnamed sections (xiphon)
2021-01-01 22:28:21 -08:00
moneromooo 8e2caf3fb4
portable_storage: check object limit where appropriate
also fix pedantic off by one in check
2020-12-31 22:35:17 +00:00
Alexander Blair 88b7bc394e
Merge pull request #7218
353f93ee1 portable_storage: remove array element limit (moneromooo-monero)
2020-12-29 10:44:05 -08:00
Alexander Blair d4636a9258
Merge pull request #7207
f7ab8bc6d ssl: buffered handshake detection (anon)
2020-12-29 10:43:50 -08:00
xiphon 20bdbd7aab portable_storage: forbid unnamed sections 2020-12-28 23:51:25 +00:00
moneromooo-monero 353f93ee1a
portable_storage: remove array element limit
some people don't want it
2020-12-28 21:04:58 +00:00
anon f7ab8bc6d4 ssl: buffered handshake detection 2020-12-28 14:25:37 +01:00
moneromooo-monero bc97eb8a33
portable_storage: remove overly aggressive cutoff 2020-12-27 12:44:38 +00:00
Alexander Blair 7438617bbf
Merge pull request #7192
95575cda6 epee: fix some issues using connections after shutdown (moneromooo-monero)
2020-12-26 13:44:10 -08:00
Alexander Blair bc9fce0d32
Merge pull request #7190
7f407c027 portable_storage: add some sanity checks on data size (moneromooo-monero)
2020-12-26 13:43:48 -08:00
Alexander Blair b9e444da5e
Merge pull request #7098
c0c75ac19 Fixed issues found by static analysis (SChernykh)
2020-12-26 13:36:01 -08:00
moneromooo-monero 95575cda6e
epee: fix some issues using connections after shutdown 2020-12-26 14:14:55 +00:00
moneromooo-monero 7f407c0274
portable_storage: add some sanity checks on data size
especially when allocated size is >> serialized data size
2020-12-26 03:22:59 +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
codesoap f2ad539f5f readline_buffer: Avoid consecutive duplicates in the history 2020-12-13 14:47:07 +01:00
Alexander Blair 1e9483a2d5
Merge pull request #7009
7414e2bac Change epee binary output from std::stringstream to byte_stream (Lee Clagett)
2020-12-10 17:34:50 -08:00
Alexander Blair 6bddd54f9d
Merge pull request #7003
08eb0949f Change to more efficient allocation strategy in byte_stream (Lee Clagett)
2020-12-10 17:33:50 -08:00
SChernykh c0c75ac19d Fixed issues found by static analysis
- rolling_median: tried to free uninitialized pointer in a constructor
- net_node.inl: erase-remove idiom was used incorrectly. remove_if doesn't actually remove elements, see http://cpp.sh/6fcjv
- bulletproofs.cc: call to sizeof() instead of vector.size(), luckily it only impacts performance and not code logic there
2020-12-08 18:43:44 +01:00
moneromooo ff7fdf6db2
protocol: drop peers that don't reply to queries 2020-12-06 15:57:40 +00:00
moneromooo 89e984d93b
keep only the last seen node on a given host in the white list 2020-12-04 01:55:22 +00:00
luigi1111 cda966078d
Merge pull request #6999
c5f6629 epee: tighten the URL parsing regexp a little (moneromooo-monero)
2020-11-29 01:56:44 -06:00
moneromooo-monero c5f6629f4a
epee: tighten the URL parsing regexp a little
fixes massive amounts of time spent on pathological inputs

Found by OSS-Fuzz
2020-11-09 13:05:39 +00:00
xiphon 60bc676c14 epee: readline_buffer - fix thread safety, fix sync() after stop() 2020-11-07 14:15:29 +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 b641e0a2c0 Add clear method to byte_stream 2020-08-17 21:30:34 -04:00
Alexander Blair 43a4fd9e16
Merge pull request #6736
05ad4fa39 epee: further defending against exceptions in command handlers (moneromooo-monero)
2020-08-16 12:56:35 -07:00
Alexander Blair d73b1b6560
Merge pull request #6727
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)
2020-08-16 12:55:25 -07:00
Alexander Blair 7db379cc82
Merge pull request #6720
86abf558c epee: Remove unused functions in local_ip.h (Jean Pierre Dudey)
2020-08-16 12:54:17 -07:00
Alexander Blair 10ad0d7eb2
Merge pull request #6718
85efc88c1 Fix overflow issue in epee:misc_utils::rolling_median_t and median(), with unit test (koe)
2020-08-16 12:53:50 -07:00
Alexander Blair 01b512f3a9
Merge pull request #6716
76c16822d wallet2_api: implement runtime proxy configuration (xiphon)
2020-08-16 12:52:21 -07:00
moneromooo-monero 05ad4fa397
epee: further defending against exceptions in command handlers 2020-08-02 00:22:47 +00:00
moneromooo-monero 6dd95d5308
epee: guard against exceptions in RPC handlers 2020-07-30 22:52:12 +00:00
rbrunner7 fb31167b12 Wallet, daemon: From 'help_advanced' back to 'help', and new 'apropos' command 2020-07-24 07:12:11 +02:00
koe 85efc88c1e Fix overflow issue in epee:misc_utils::rolling_median_t and median(), with unit test 2020-07-23 03:36:05 -05:00
Jean Pierre Dudey 86abf558cb epee: Remove unused functions in local_ip.h
Signed-off-by: Jean Pierre Dudey <me@jeandudey.tech>
2020-07-22 19:06:01 -05:00
xiphon 76c16822d0 wallet2_api: implement runtime proxy configuration 2020-07-20 13:45:12 +00:00
Alexander Blair 9871fefbf9
Merge pull request #6565
72cdfa4a2 fix a few typos in error messages (moneromooo-monero)
2020-07-19 03:40:19 -07:00
Alexander Blair 3ba6c7fd30
Merge pull request #6516
8656a8c9f remove double includes (sumogr)
2020-07-19 03:34:28 -07:00
Alexander Blair a0d179e528
Merge pull request #6512
5ef0607da Update copyright year to 2020 (SomaticFanatic)
2020-07-19 03:32:59 -07:00
luigi1111 803f58553b
Merge pull request #6675
3721d56 epee: fix array underflow in unicode parsing (moneromooo-monero)
2020-07-08 17:27:53 -05:00
luigi1111 be170c485c
Merge pull request #6584
78d435a rpc: don't display invalid json errors on default log level (moneromooo-monero)
2020-07-08 17:12:43 -05:00
luigi1111 35e2520115
Merge pull request #6559
15538f7 ByteSlice: Fix persisting ptr to std::moved SSO buffer (Doy-lee)
2020-07-08 17:07:50 -05:00
moneromooo-monero 3721d5688f epee: fix array underflow in unicode parsing
Reported by minerscan

Also independently found by OSS-Fuzz just recently
2020-06-21 18:22:16 +00:00
luigi1111 e27604ff10
Merge pull request #6539
85164a8 epee: use memwipe rather than memset for md5 secrets (moneromooo-monero)
2020-06-08 14:09:22 -05:00
luigi1111 967285a9fa
Merge pull request #6522
29e563b Fixed bugs for take_slice and byte_stream->byte_slice (vtnerd)
2020-06-08 14:05:05 -05:00
Lee Clagett 7aeb503547 Fix boost <1.60 compilation and fix boost 1.73+ warnings 2020-05-31 21:18:11 -04:00
moneromooo-monero 78d435a5fa
rpc: don't display invalid json errors on default log level
It's not something the user needs to know, and will display
attacker controlled data
2020-05-23 12:26:49 +00:00
Doyle 15538f7e3f ByteSlice: Fix persisting ptr to std::moved SSO buffer
The Bug:
1. Construct `byte_slice.portion_` with `epee::span(buffer)` which copies a pointer to the SSO buffer to `byte_slice.portion_`
2. It constructs `byte_slice.storage_` with `std::move(buffer)` (normally this swap pointers, but SSO means a memcpy and clear on the original SSO buffer)
3. `slice.data()` returns a pointer from `slice.portion_` that points to the original SSO cleared buffer, `slice.storage_` has the actual string.
2020-05-20 10:13:58 +10:00
moneromooo-monero 72cdfa4a20
fix a few typos in error messages
Reported by adrelanos
2020-05-19 15:59:26 +00:00
moneromooo-monero 85164a8daf
epee: use memwipe rather than memset for md5 secrets
That's used by HTTP auth now
2020-05-16 18:12:55 +00:00
selsta f35ced6d7f
build: fix boost 1.73 compatibility 2020-05-14 22:57:53 +02:00
Lee Clagett 29e563bb1e Fixed bugs for take_slice and byte_stream->byte_slice 2020-05-12 01:26:37 -04:00
sumogr 8656a8c9ff remove double includes 2020-05-11 13:53:17 +00:00
SomaticFanatic 5ef0607da6 Update copyright year to 2020
Update copyright year to 2020
2020-05-06 22:36:54 -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
luigi1111 c9b800a787
Merge pull request #6446
e509ede trezor: adapt to new passphrase mechanism (ph4r05)
2020-05-01 15:32:52 -05:00
Dusan Klinec e509ede2aa
trezor: adapt to new passphrase mechanism
- 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
2020-04-27 18:17:56 +02:00
luigi1111 00ede0038d
Merge pull request #6387
0dbdba8 epee: avoid spamming 'Generating SSL certificate' in the logs (xiphon)
2020-04-04 13:16:55 -05:00
luigi1111 d86d1a4d29
Merge pull request #6370
3031deb Bump downloaded boost version to 1.72 (omartijn)
6079042 Use boost::asio::ssl::context::sslv23 for backwards compatibility (omartijn)
2020-04-04 13:06:36 -05:00
luigi1111 cfc0f4a7fa
Merge pull request #6351
81c5943 Remove temporary std::string creation in some hex->bin calls (vtnerd)
5fcc23a Move hex->bin conversion to monero copyright files and with less includes (vtnerd)
3387f0e Reduce template bloat in hex->bin for ZMQ json (vtnerd)
2020-04-04 12:55:02 -05:00
luigi1111 c4f75fe898
Merge pull request #6339
c61abf8 remove empty statements (shopglobal)
2020-04-04 12:47:31 -05:00
luigi1111 292e2d8f28
Merge pull request #6335
0078ce7 wipeable_string: split - treat CR, LF and Tabs as separators (xiphon)
2020-04-04 12:42:50 -05:00
Lee Clagett da99157462 Use byte_slice for sending zmq messages - removes data copy within zmq 2020-04-03 01:56:17 +00:00
luigi1111 06c81b6527
Merge pull request #6359
f9441c5 Fixed string_ref usage bug in epee::from_hex::vector (vtnerd)
2020-04-21 08:38:21 -05:00
woodser 87d75584e8 Allow wallet2.h to run in WebAssembly
- 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.
2020-04-15 13:22:46 -04:00
moneromooo-monero 21fe6a289b
p2p: fix frequent weak_ptr exception on connection
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.
2020-03-31 20:29:41 +00:00
luigi1111 6c7d928f19
Merge pull request #6336
760ecf2 console_handler: do not let exception past the dor (moneromooo-monero)
09c8111 threadpool: lock mutex in create (moneromooo-monero)
e377977 tx_pool: catch theoretical error in get_block_reward (moneromooo-monero)
2020-03-31 15:14:12 -05:00
luigi1111 48b244dcd4
Merge pull request #6311
5002a03 Explicitly define copy assignment operator (omartijn)
2020-03-31 15:13:35 -05:00
Lee Clagett f9441c5759 Fixed string_ref usage bug in epee::from_hex::vector 2020-03-30 16:53:34 +00:00
xiphon 0dbdba876e epee: avoid spamming 'Generating SSL certificate' in the logs 2020-03-13 22:48:04 +00:00
Alexander Blair 820ab9fdea
Merge pull request #6273
0f78b06e Various improvements to the ZMQ JSON-RPC handling: (Lee Clagett)
2020-03-12 01:13:49 -07:00
Alexander Blair 857abc368c
Merge pull request #6244
352bd132 abstract_tcp_server2: guard against negative timeouts (moneromooo-monero)
2020-03-12 00:56:29 -07:00
Alexander Blair 092a57df99
Merge pull request #6243
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)
2020-03-12 00:32:46 -07:00
Martijn Otto 6079042cce
Use boost::asio::ssl::context::sslv23 for backwards compatibility
All the insecure protocols that this enables are then disabled, so they
cannot be actually used. The end-result is the same.
2020-03-11 09:28:02 +01: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 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
Alexander Blair 944e8a4542
Merge pull request #6220
a9bdc6e4 Improved performance for epee serialization: (Lee Clagett)
2020-02-28 19:45:31 -08:00
Alexander Blair 8d5e043981
Merge pull request #6205
021cf733 ssl: server-side: allow multiple version of TLS (Bertrand Jacquin)
2020-02-28 19:35:48 -08:00
Interchained c61abf87c0 remove empty statements
Cleaning up a little around the code base.
2020-02-17 11:55:15 -05:00
xiphon 0078ce7fac wipeable_string: split - treat CR, LF and Tabs as separators 2020-02-12 21:16:07 +00:00
moneromooo-monero 760ecf2ac8
console_handler: do not let exception past the dor
Coverity 208373
2020-02-12 21:05:25 +00:00
Alexander Blair 5e384f21b5
Merge pull request #6184
2d1afceb net_ssl: load default certificates in CA mode on Windows (moneromooo-monero)
2020-02-06 00:35:46 -08:00
Alexander Blair a62f7dc573
Merge pull request #6182
e896cca8 epee: reorder a couple init list fields to match declaration (moneromooo-monero)
2020-02-06 00:34:15 -08:00
Martijn Otto 5002a0343f
Explicitly define copy assignment operator
The implicit copy assignment operator was deprecated because the class
has an explicit copy constructor. According to the standard:

The generation of the implicitly-defined copy assignment operator is
deprecated (since C++11) if T has a user-declared destructor or
user-declared copy constructor.

Recent versions of gcc (9.1+) and clang (10.0) warn about this.
2020-01-28 14:59:55 +01:00
moneromooo-monero 3004835b51
epee: remove backward compatible endian specific address serialization 2020-01-26 18:37:34 +00:00
moneromooo-monero b595583f3d
serialization: do not write optional fields with default value 2020-01-26 18:37:30 +00:00
moneromooo-monero 56a4469ef3
network: log traffic and add a simple traffic analysis script 2020-01-26 00:33:41 +00:00
Alexander Blair 8039fd4cab
Merge pull request #6143
6efeefbc epee: set application/json MIME type on json errors (moneromooo-monero)
2020-01-16 17:46:13 -08:00
Alexander Blair f1ca98a7ef
Merge pull request #6133
b2ad757f Replace memset with memwipe. (Bert Peters)
2020-01-16 17:41:35 -08:00
Alexander Blair fbc15de2cd
Merge pull request #6125
584d057f epee: fix console_handlers_binder race, wait for thread to finish (xiphon)
2020-01-16 17:32:15 -08:00
Alexander Blair fe736070d2
Merge pull request #6120
feef1c6a epee: fix peer ids being truncated on display (moneromooo-monero)
2020-01-16 17:30:17 -08:00
moneromooo-monero 352bd13254
abstract_tcp_server2: guard against negative timeouts 2019-12-16 18:24:52 +00:00
Bertrand Jacquin 021cf733c6
ssl: server-side: allow multiple version of TLS
boost::asio::ssl::context is created using specifically TLSv1.2, which
blocks the ability to use superior version of TLS like TLSv1.3.

Filtering is also made specially later in the code to remove unsafe
version for TLS such SSLv2, SSLv3 etc..

This change is removing double filtering to allow TLSv1.2 and above to
be used.

testssl.sh 3.0rc5 now reports the following (please note monerod was
built with USE_EXTRA_EC_CERT):

 $ ./testssl.sh --openssl=/usr/bin/openssl \
     --each-cipher --cipher-per-proto \
     --server-defaults --server-preference \
     --vulnerable --heartbleed --ccs --ticketbleed \
     --robot --renegotiation --compression --breach \
     --poodle --tls-fallback --sweet32 --beast --lucky13 \
     --freak --logjam --drown --pfs --rc4 --full \
     --wide --hints 127.0.0.1:38081

 Using "OpenSSL 1.1.1d  10 Sep 2019" [~80 ciphers]
 on ip-10-97-15-6:/usr/bin/openssl
 (built: "Dec  3 21:14:51 2019", platform: "linux-x86_64")

 Start 2019-12-03 21:51:25        -->> 127.0.0.1:38081 (127.0.0.1) <<--

 rDNS (127.0.0.1):       --
 Service detected:       HTTP

 Testing protocols via sockets except NPN+ALPN

 SSLv2      not offered (OK)
 SSLv3      not offered (OK)
 TLS 1      not offered
 TLS 1.1    not offered
 TLS 1.2    offered (OK)
 TLS 1.3    offered (OK): final
 NPN/SPDY   not offered
 ALPN/HTTP2 not offered

 Testing for server implementation bugs

 No bugs found.

 Testing cipher categories

 NULL ciphers (no encryption)                  not offered (OK)
 Anonymous NULL Ciphers (no authentication)    not offered (OK)
 Export ciphers (w/o ADH+NULL)                 not offered (OK)
 LOW: 64 Bit + DES, RC[2,4] (w/o export)       not offered (OK)
 Triple DES Ciphers / IDEA                     not offered (OK)
 Average: SEED + 128+256 Bit CBC ciphers       not offered
 Strong encryption (AEAD ciphers)              offered (OK)

 Testing robust (perfect) forward secrecy, (P)FS -- omitting Null Authentication/Encryption, 3DES, RC4

 PFS is offered (OK), ciphers follow (client/browser support is important here)

Hexcode  Cipher Suite Name (OpenSSL)       KeyExch.   Encryption  Bits     Cipher Suite Name (IANA/RFC)
-----------------------------------------------------------------------------------------------------------------------------
 x1302   TLS_AES_256_GCM_SHA384            ECDH 253   AESGCM      256      TLS_AES_256_GCM_SHA384
 x1303   TLS_CHACHA20_POLY1305_SHA256      ECDH 253   ChaCha20    256      TLS_CHACHA20_POLY1305_SHA256
 xc030   ECDHE-RSA-AES256-GCM-SHA384       ECDH 253   AESGCM      256      TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
 xc02c   ECDHE-ECDSA-AES256-GCM-SHA384     ECDH 253   AESGCM      256      TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
 xcca9   ECDHE-ECDSA-CHACHA20-POLY1305     ECDH 253   ChaCha20    256      TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256
 xcca8   ECDHE-RSA-CHACHA20-POLY1305       ECDH 253   ChaCha20    256      TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256
 x1301   TLS_AES_128_GCM_SHA256            ECDH 253   AESGCM      128      TLS_AES_128_GCM_SHA256
 xc02f   ECDHE-RSA-AES128-GCM-SHA256       ECDH 253   AESGCM      128      TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
 xc02b   ECDHE-ECDSA-AES128-GCM-SHA256     ECDH 253   AESGCM      128      TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256

 Elliptic curves offered:     prime256v1 secp384r1 secp521r1 X25519 X448

 Testing server preferences

 Has server cipher order?     yes (OK)
 Negotiated protocol          TLSv1.3
 Negotiated cipher            TLS_AES_256_GCM_SHA384, 253 bit ECDH (X25519)
 Cipher order
    TLSv1.2:   ECDHE-ECDSA-CHACHA20-POLY1305 ECDHE-ECDSA-AES256-GCM-SHA384 ECDHE-ECDSA-AES128-GCM-SHA256 ECDHE-RSA-CHACHA20-POLY1305 ECDHE-RSA-AES256-GCM-SHA384 ECDHE-RSA-AES128-GCM-SHA256
    TLSv1.3:   TLS_AES_256_GCM_SHA384 TLS_CHACHA20_POLY1305_SHA256 TLS_AES_128_GCM_SHA256

 Testing server defaults (Server Hello)

 TLS extensions (standard)    "renegotiation info/#65281" "EC point formats/#11" "supported versions/#43" "key share/#51" "max fragment length/#1" "extended master secret/#23"
 Session Ticket RFC 5077 hint no -- no lifetime advertised
 SSL Session ID support       yes
 Session Resumption           Tickets no, ID: no
 TLS clock skew               Random values, no fingerprinting possible

  Server Certificate #1 (in response to request w/o SNI)
   Signature Algorithm          SHA256 with RSA
   Server key size              RSA 4096 bits
   Server key usage             --
   Server extended key usage    --
   Serial / Fingerprints        01 / SHA1 132E42981812F5575FA0AE64922B18A81B38C03F
                                SHA256 EBA3CC4AA09DEF26706E64A70DB4BC8D723533BB67EAE12B503A845019FB61DC
   Common Name (CN)             (no CN field in subject)
   subjectAltName (SAN)         missing (NOT ok) -- Browsers are complaining
   Issuer
   Trust (hostname)             certificate does not match supplied URI
   Chain of trust               NOT ok (self signed)
   EV cert (experimental)       no
   "eTLS" (visibility info)     not present
   Certificate Validity (UTC)   181 >= 60 days (2019-12-03 21:51 --> 2020-06-02 21:51)
   # of certificates provided   1
   Certificate Revocation List  --
   OCSP URI                     --
                                NOT ok -- neither CRL nor OCSP URI provided
   OCSP stapling                not offered
   OCSP must staple extension   --
   DNS CAA RR (experimental)    not offered
   Certificate Transparency     --

  Server Certificate #2 (in response to request w/o SNI)
   Signature Algorithm          ECDSA with SHA256
   Server key size              EC 256 bits
   Server key usage             --
   Server extended key usage    --
   Serial / Fingerprints        01 / SHA1 E17B765DD8124525B1407E827B89A31FB167647D
                                SHA256 AFB7F44B1C33831F521357E5AEEB813044CB02532143E92D35650A3FF792A7C3
   Common Name (CN)             (no CN field in subject)
   subjectAltName (SAN)         missing (NOT ok) -- Browsers are complaining
   Issuer
   Trust (hostname)             certificate does not match supplied URI
   Chain of trust               NOT ok (self signed)
   EV cert (experimental)       no
   "eTLS" (visibility info)     not present
   Certificate Validity (UTC)   181 >= 60 days (2019-12-03 21:51 --> 2020-06-02 21:51)
   # of certificates provided   1
   Certificate Revocation List  --
   OCSP URI                     --
                                NOT ok -- neither CRL nor OCSP URI provided
   OCSP stapling                not offered
   OCSP must staple extension   --
   DNS CAA RR (experimental)    not offered
   Certificate Transparency     --

 Testing HTTP header response @ "/"

 HTTP Status Code             404 Not found (Hint: supply a path which doesn't give a "404 Not found")
 HTTP clock skew              Got no HTTP time, maybe try different URL?
 Strict Transport Security    not offered
 Public Key Pinning           --
 Server banner                Epee-based
 Application banner           --
 Cookie(s)                    (none issued at "/") -- maybe better try target URL of 30x
 Security headers             --
 Reverse Proxy banner         --

 Testing vulnerabilities

 Heartbleed (CVE-2014-0160)                not vulnerable (OK), no heartbeat extension
 CCS (CVE-2014-0224)                       not vulnerable (OK)
 Ticketbleed (CVE-2016-9244), experiment.  not vulnerable (OK), no session ticket extension
 ROBOT                                     Server does not support any cipher suites that use RSA key transport
 Secure Renegotiation (CVE-2009-3555)      not vulnerable (OK)
 Secure Client-Initiated Renegotiation     not vulnerable (OK)
 CRIME, TLS (CVE-2012-4929)                not vulnerable (OK)
 BREACH (CVE-2013-3587)                    no HTTP compression (OK)  - only supplied "/" tested
 POODLE, SSL (CVE-2014-3566)               not vulnerable (OK)
 TLS_FALLBACK_SCSV (RFC 7507)              No fallback possible, no protocol below TLS 1.2 offered (OK)
 SWEET32 (CVE-2016-2183, CVE-2016-6329)    not vulnerable (OK)
 FREAK (CVE-2015-0204)                     not vulnerable (OK)
 DROWN (CVE-2016-0800, CVE-2016-0703)      not vulnerable on this host and port (OK)
                                           make sure you don't use this certificate elsewhere with SSLv2 enabled services
                                           https://censys.io/ipv4?q=EBA3CC4AA09DEF26706E64A70DB4BC8D723533BB67EAE12B503A845019FB61DC could help you to find out
 LOGJAM (CVE-2015-4000), experimental      not vulnerable (OK): no DH EXPORT ciphers, no DH key detected with <= TLS 1.2
 BEAST (CVE-2011-3389)                     no SSL3 or TLS1 (OK)
 LUCKY13 (CVE-2013-0169), experimental     not vulnerable (OK)
 RC4 (CVE-2013-2566, CVE-2015-2808)        no RC4 ciphers detected (OK)

 Testing ciphers per protocol via OpenSSL plus sockets against the server, ordered by encryption strength

Hexcode  Cipher Suite Name (OpenSSL)       KeyExch.   Encryption  Bits     Cipher Suite Name (IANA/RFC)
-----------------------------------------------------------------------------------------------------------------------------
SSLv2
SSLv3
TLS 1
TLS 1.1
TLS 1.2
 xc030   ECDHE-RSA-AES256-GCM-SHA384       ECDH 253   AESGCM      256      TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
 xc02c   ECDHE-ECDSA-AES256-GCM-SHA384     ECDH 253   AESGCM      256      TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
 xcca9   ECDHE-ECDSA-CHACHA20-POLY1305     ECDH 253   ChaCha20    256      TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256
 xcca8   ECDHE-RSA-CHACHA20-POLY1305       ECDH 253   ChaCha20    256      TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256
 xc02f   ECDHE-RSA-AES128-GCM-SHA256       ECDH 253   AESGCM      128      TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
 xc02b   ECDHE-ECDSA-AES128-GCM-SHA256     ECDH 253   AESGCM      128      TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
TLS 1.3
 x1302   TLS_AES_256_GCM_SHA384            ECDH 253   AESGCM      256      TLS_AES_256_GCM_SHA384
 x1303   TLS_CHACHA20_POLY1305_SHA256      ECDH 253   ChaCha20    256      TLS_CHACHA20_POLY1305_SHA256
 x1301   TLS_AES_128_GCM_SHA256            ECDH 253   AESGCM      128      TLS_AES_128_GCM_SHA256

 Running client simulations (HTTP) via sockets

 Browser                      Protocol  Cipher Suite Name (OpenSSL)       Forward Secrecy
------------------------------------------------------------------------------------------------
 Android 4.2.2                No connection
 Android 4.4.2                TLSv1.2   ECDHE-RSA-AES256-GCM-SHA384       256 bit ECDH (P-256)
 Android 5.0.0                TLSv1.2   ECDHE-RSA-AES128-GCM-SHA256       256 bit ECDH (P-256)
 Android 6.0                  TLSv1.2   ECDHE-RSA-AES128-GCM-SHA256       256 bit ECDH (P-256)
 Android 7.0                  TLSv1.2   ECDHE-RSA-CHACHA20-POLY1305       253 bit ECDH (X25519)
 Android 8.1 (native)         No connection
 Android 9.0 (native)         TLSv1.3   TLS_AES_256_GCM_SHA384            253 bit ECDH (X25519)
 Chrome 65 Win 7              TLSv1.2   ECDHE-RSA-CHACHA20-POLY1305       253 bit ECDH (X25519)
 Chrome 74 (Win 10)           No connection
 Firefox 62 Win 7             TLSv1.2   ECDHE-RSA-CHACHA20-POLY1305       253 bit ECDH (X25519)
 Firefox 66 (Win 8.1/10)      TLSv1.3   TLS_AES_256_GCM_SHA384            253 bit ECDH (X25519)
 IE 6 XP                      No connection
 IE 7 Vista                   No connection
 IE 8 Win 7                   No connection
 IE 8 XP                      No connection
 IE 11 Win 7                  No connection
 IE 11 Win 8.1                No connection
 IE 11 Win Phone 8.1          No connection
 IE 11 Win 10                 TLSv1.2   ECDHE-RSA-AES256-GCM-SHA384       256 bit ECDH (P-256)
 Edge 15 Win 10               TLSv1.2   ECDHE-RSA-AES256-GCM-SHA384       253 bit ECDH (X25519)
 Edge 17 (Win 10)             TLSv1.2   ECDHE-RSA-AES256-GCM-SHA384       253 bit ECDH (X25519)
 Opera 60 (Win 10)            No connection
 Safari 9 iOS 9               TLSv1.2   ECDHE-RSA-AES256-GCM-SHA384       256 bit ECDH (P-256)
 Safari 9 OS X 10.11          TLSv1.2   ECDHE-RSA-AES256-GCM-SHA384       256 bit ECDH (P-256)
 Safari 10 OS X 10.12         TLSv1.2   ECDHE-RSA-AES256-GCM-SHA384       256 bit ECDH (P-256)
 Apple ATS 9 iOS 9            TLSv1.2   ECDHE-RSA-AES256-GCM-SHA384       256 bit ECDH (P-256)
 Tor 17.0.9 Win 7             No connection
 Java 6u45                    No connection
 Java 7u25                    No connection
 Java 8u161                   TLSv1.2   ECDHE-ECDSA-AES256-GCM-SHA384     256 bit ECDH (P-256)
 Java 9.0.4                   TLSv1.2   ECDHE-ECDSA-AES256-GCM-SHA384     256 bit ECDH (P-256)
 OpenSSL 1.0.1l               TLSv1.2   ECDHE-ECDSA-AES256-GCM-SHA384     256 bit ECDH (P-256)
 OpenSSL 1.0.2e               TLSv1.2   ECDHE-ECDSA-AES256-GCM-SHA384     256 bit ECDH (P-256)
 OpenSSL 1.1.0j (Debian)      TLSv1.2   ECDHE-RSA-CHACHA20-POLY1305       253 bit ECDH (X25519)
 OpenSSL 1.1.1b (Debian)      TLSv1.3   TLS_AES_256_GCM_SHA384            253 bit ECDH (X25519)
 Thunderbird (60.6)           TLSv1.3   TLS_AES_256_GCM_SHA384            253 bit ECDH (X25519)
2019-12-03 22:02:16 +00:00
moneromooo-monero 2d1afceb0d
net_ssl: load default certificates in CA mode on Windows
Because it always does things wonkily doens't it
2019-11-26 19:34:16 +00:00
moneromooo-monero e896cca86e
epee: reorder a couple init list fields to match declaration
This is a bug waiting to happen
2019-11-25 19:27:54 +00:00
moneromooo-monero 6efeefbca2
epee: set application/json MIME type on json errors 2019-11-15 19:39:20 +00:00
moneromooo-monero feef1c6aac
epee: fix peer ids being truncated on display 2019-11-14 18:27:12 +00:00
Bert Peters b2ad757f48 Replace memset with memwipe. 2019-11-13 18:00:50 +01:00
xiphon 584d057f74 epee: fix console_handlers_binder race, wait for thread to finish 2019-11-12 16:07:59 +00:00
moneromooo-monero 3d649d528a
epee: close connection when the peer has done so
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.
2019-11-11 20:05:24 +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
moneromooo-monero dcff02e4c3
epee: allow a random component in once_a_time timeouts 2019-11-01 20:57:24 +00:00
luigi1111 960c215801
Merge pull request #5357
b3a9a4d add a quick early out to get_blocks.bin when up to date (moneromooo-monero)
2899379 daemon, wallet: new pay for RPC use system (moneromooo-monero)
ffa4602 simplewallet: add public_nodes command (moneromooo-monero)
2019-10-25 13:38:21 -05:00
moneromooo-monero 2899379791
daemon, wallet: new pay for RPC use system
Daemons intended for public use can be set up to require payment
in the form of hashes in exchange for RPC service. This enables
public daemons to receive payment for their work over a large
number of calls. This system behaves similarly to a pool, so
payment takes the form of valid blocks every so often, yielding
a large one off payment, rather than constant micropayments.

This system can also be used by third parties as a "paywall"
layer, where users of a service can pay for use by mining Monero
to the service provider's address. An example of this for web
site access is Primo, a Monero mining based website "paywall":
https://github.com/selene-kovri/primo

This has some advantages:
 - incentive to run a node providing RPC services, thereby promoting the availability of third party nodes for those who can't run their own
 - incentive to run your own node instead of using a third party's, thereby promoting decentralization
 - decentralized: payment is done between a client and server, with no third party needed
 - private: since the system is "pay as you go", you don't need to identify yourself to claim a long lived balance
 - no payment occurs on the blockchain, so there is no extra transactional load
 - one may mine with a beefy server, and use those credits from a phone, by reusing the client ID (at the cost of some privacy)
 - no barrier to entry: anyone may run a RPC node, and your expected revenue depends on how much work you do
 - Sybil resistant: if you run 1000 idle RPC nodes, you don't magically get more revenue
 - no large credit balance maintained on servers, so they have no incentive to exit scam
 - you can use any/many node(s), since there's little cost in switching servers
 - market based prices: competition between servers to lower costs
 - incentive for a distributed third party node system: if some public nodes are overused/slow, traffic can move to others
 - increases network security
 - helps counteract mining pools' share of the network hash rate
 - zero incentive for a payer to "double spend" since a reorg does not give any money back to the miner

And some disadvantages:
 - low power clients will have difficulty mining (but one can optionally mine in advance and/or with a faster machine)
 - payment is "random", so a server might go a long time without a block before getting one
 - a public node's overall expected payment may be small

Public nodes are expected to compete to find a suitable level for
cost of service.

The daemon can be set up this way to require payment for RPC services:

  monerod --rpc-payment-address 4xxxxxx \
    --rpc-payment-credits 250 --rpc-payment-difficulty 1000

These values are an example only.

The --rpc-payment-difficulty switch selects how hard each "share" should
be, similar to a mining pool. The higher the difficulty, the fewer
shares a client will find.
The --rpc-payment-credits switch selects how many credits are awarded
for each share a client finds.
Considering both options, clients will be awarded credits/difficulty
credits for every hash they calculate. For example, in the command line
above, 0.25 credits per hash. A client mining at 100 H/s will therefore
get an average of 25 credits per second.
For reference, in the current implementation, a credit is enough to
sync 20 blocks, so a 100 H/s client that's just starting to use Monero
and uses this daemon will be able to sync 500 blocks per second.

The wallet can be set to automatically mine if connected to a daemon
which requires payment for RPC usage. It will try to keep a balance
of 50000 credits, stopping mining when it's at this level, and starting
again as credits are spent. With the example above, a new client will
mine this much credits in about half an hour, and this target is enough
to sync 500000 blocks (currently about a third of the monero blockchain).

There are three new settings in the wallet:

 - credits-target: this is the amount of credits a wallet will try to
reach before stopping mining. The default of 0 means 50000 credits.

 - auto-mine-for-rpc-payment-threshold: this controls the minimum
credit rate which the wallet considers worth mining for. If the
daemon credits less than this ratio, the wallet will consider mining
to be not worth it. In the example above, the rate is 0.25

 - persistent-rpc-client-id: if set, this allows the wallet to reuse
a client id across runs. This means a public node can tell a wallet
that's connecting is the same as one that connected previously, but
allows a wallet to keep their credit balance from one run to the
other. Since the wallet only mines to keep a small credit balance,
this is not normally worth doing. However, someone may want to mine
on a fast server, and use that credit balance on a low power device
such as a phone. If left unset, a new client ID is generated at
each wallet start, for privacy reasons.

To mine and use a credit balance on two different devices, you can
use the --rpc-client-secret-key switch. A wallet's client secret key
can be found using the new rpc_payments command in the wallet.
Note: anyone knowing your RPC client secret key is able to use your
credit balance.

The wallet has a few new commands too:

 - start_mining_for_rpc: start mining to acquire more credits,
regardless of the auto mining settings
 - stop_mining_for_rpc: stop mining to acquire more credits
 - rpc_payments: display information about current credits with
the currently selected daemon

The node has an extra command:

 - rpc_payments: display information about clients and their
balances

The node will forget about any balance for clients which have
been inactive for 6 months. Balances carry over on node restart.
2019-10-25 09:34:38 +00:00
luigi1111 42d84ad35e
Merge pull request #6006
9f3be3b epee: use SO_REUSEADDR on non-Windows targets (xiphon)
2019-10-24 12:41:59 -05:00
xiphon 9f3be3baed epee: use SO_REUSEADDR on non-Windows targets 2019-10-22 18:40:01 +00:00
luigi1111 6b58d6248a
Merge pull request #5996
23ba69e epee: fix SSL server handshake, run_one() can block, use poll_one() (xiphon)
2019-10-22 10:26:31 -05:00
luigi1111 18f62f89d8
Merge pull request #5986
1080136 abstract_tcp_server2: move 'Trying to connect' from error to debug (moneromooo-monero)
2019-10-22 10:23:04 -05:00
luigi1111 84ce43a239
Merge pull request #5966
be82c40 Support median block size > 4 GB (moneromooo-monero)
2019-10-22 10:08:32 -05:00
moneromooo-monero be82c40703
Support median block size > 4 GB
add a 128/64 division routine so we can use a > 32 bit median block
size in calculations
2019-10-21 10:41:07 +00:00
xiphon 23ba69ec88 epee: fix SSL server handshake, run_one() can block, use poll_one() 2019-10-18 18:32:33 +00:00
luigi1111 7ec8d9640e
Merge pull request #5911
e48dcb7 levin: armour against some 'should not happen' case (moneromooo-monero)
2019-10-16 13:35:55 -05:00
moneromooo-monero e48dcb7a01
levin: armour against some "should not happen" case
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
2019-10-15 10:30:08 +00:00
luigi1111 8fcdf77d7b
Merge pull request #5947
c9cfbf7 epee: tcp server - set SO_LINGER instead of SO_REUSEADDR option (xiphon)
2019-10-14 20:04:02 -05:00
luigi1111 4118e4b1e9
Merge pull request #5937
4b654f6 abstract_tcp_server2: log pointer, not contents, where appropriate (moneromooo-monero)
2019-10-14 18:08:47 -05:00
moneromooo-monero 10801362f4
abstract_tcp_server2: move "Trying to connect" from error to debug
and fix the message grammar
2019-10-14 14:15:21 +00:00
luigi1111 da7a3dd17b
Merge pull request #5936
24473d7 build: fix MinGW GUI dependencies build (xiphon)
2019-10-08 14:46:09 -05:00
luigi1111 18da0fa240
Merge pull request #5918
4371791 epee: implement handshake timeout for SSL connections (xiphon)
2019-10-08 14:30:45 -05:00
luigi1111 ca975bcb79
Merge pull request #5917
7d81850 epee: fix network timeouts in blocked_mode_client (xiphon)
2019-10-08 14:28:50 -05:00
xiphon c9cfbf7fb3 epee: tcp server - set SO_LINGER instead of SO_REUSEADDR option 2019-10-02 19:08:02 +00:00
luigi1111 15b9b4e047
Merge pull request #5910
1b91beb abstract_tcp_server2: fix lingering connections (moneromooo-monero)
2019-09-30 18:55:58 -05:00
luigi1111 c6430f9dd0
Merge pull request #5893
Coverity fixes [3a81639, 1bd962d, 2825f07, d099658, d46f701, cd57a10] (anonimal)
2019-09-30 18:43:48 -05:00
moneromooo-monero 4b654f65a3
abstract_tcp_server2: log pointer, not contents, where appropriate 2019-09-27 15:15:32 +00:00
xiphon 24473d7584 build: fix MinGW GUI dependencies build 2019-09-26 01:43:00 +00:00
moneromooo-monero 89339551a2
epee: misc_log_ex.h can now be used in C code
use mfatal/merror/mwarning/minfo/mdebug/mtrace
2019-09-24 15:47:31 +00:00