aboutsummaryrefslogtreecommitdiff
path: root/contrib/epee/src
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge pull request #6184Alexander Blair2020-02-061-0/+42
|\ \ | | | | | | | | | 2d1afceb net_ssl: load default certificates in CA mode on Windows (moneromooo-monero)
| * | net_ssl: load default certificates in CA mode on Windowsmoneromooo-monero2019-11-261-0/+42
| |/ | | | | | | Because it always does things wonkily doens't it
* / epee: reorder a couple init list fields to match declarationmoneromooo-monero2019-11-251-1/+1
|/ | | | This is a bug waiting to happen
* daemon, wallet: new pay for RPC use systemmoneromooo-monero2019-10-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Merge pull request #5996luigi11112019-10-221-2/+10
|\ | | | | | | 23ba69e epee: fix SSL server handshake, run_one() can block, use poll_one() (xiphon)
| * epee: fix SSL server handshake, run_one() can block, use poll_one()xiphon2019-10-181-2/+10
| |
* | Merge pull request #5966luigi11112019-10-222-1/+50
|\ \ | |/ |/| | | be82c40 Support median block size > 4 GB (moneromooo-monero)
| * Support median block size > 4 GBmoneromooo-monero2019-10-212-1/+50
| | | | | | | | | | add a 128/64 division routine so we can use a > 32 bit median block size in calculations
* | Merge pull request #5936luigi11112019-10-081-2/+2
|\ \ | | | | | | | | | 24473d7 build: fix MinGW GUI dependencies build (xiphon)
| * | build: fix MinGW GUI dependencies buildxiphon2019-09-261-2/+2
| | |
* | | Merge pull request #5918luigi11112019-10-081-3/+24
|\ \ \ | |_|/ |/| | | | | 4371791 epee: implement handshake timeout for SSL connections (xiphon)
| * | epee: implement handshake timeout for SSL connectionsxiphon2019-09-171-3/+24
| | |
* | | Merge pull request #5893luigi11112019-09-301-0/+2
|\ \ \ | |_|/ |/| | | | | Coverity fixes [3a81639, 1bd962d, 2825f07, d099658, d46f701, cd57a10] (anonimal)
| * | epee: connection_basic: resolve CID 203916 (UNINIT_CTOR)anonimal2019-09-061-0/+1
| | |
| * | epee: connection_basic: resolve CID 203920 (UNINIT_CTOR)anonimal2019-09-061-0/+1
| |/
* | epee: misc_log_ex.h can now be used in C codemoneromooo-monero2019-09-241-11/+25
| | | | | | | | use mfatal/merror/mwarning/minfo/mdebug/mtrace
* | Merge pull request #5892luigi11112019-09-241-2/+2
|\ \ | | | | | | | | | ab2819a depends: attempt to fix readline (iDunk5400)
| * | depends: attempt to fix readlineiDunk54002019-09-071-2/+2
| |/ | | | | | | Make readline actually compile, and make ncurses use existing terminfo data (if available).
* / Properly format multiline logsmoneromooo-monero2019-09-161-1/+37
|/ | | | | As a side effect, colouring on Windows should now work regardless of version
* Merge pull request #5536luigi11112019-09-041-0/+10
|\ | | | | | | 1a367d6 simplewallet: lock console on inactivity (moneromooo-monero)
| * simplewallet: lock console on inactivitymoneromooo-monero2019-08-281-0/+10
| |
* | Added support for "noise" over I1P/Tor to mask Tx transmission.Lee Clagett2019-07-173-3/+131
| |
* | Add ref-counted buffer byte_slice. Currently used for sending TCP data.Lee Clagett2019-07-162-2/+211
|/
* Add IPv6 supportThomas Winget2019-07-312-3/+45
| | | | | | | | | | | | | | | | | | | 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.
* Merge pull request #5530luigi11112019-07-241-3/+0
|\ | | | | | | 6abaaaa remove obsolete save_graph skeleton code (moneromooo-monero)
| * remove obsolete save_graph skeleton codemoneromooo-monero2019-05-101-3/+0
| |
* | allow blocking whole subnetsmoneromooo-monero2019-07-161-0/+18
| |
* | ensure no NULL is passed to memcpymoneromooo-monero2019-06-142-6/+14
| | | | | | | | | | NULL is valid when size is 0, but memcpy uses nonnull attributes, so let's not poke the bear
* | Merge pull request #5527luigi11112019-05-141-2/+2
|\ \ | | | | | | | | | 9a7a453 net_ssl: free certs after setting them up (moneromooo-monero)
| * | net_ssl: free certs after setting them upmoneromooo-monero2019-05-101-2/+2
| |/
* | Merge pull request #5519luigi11112019-05-141-1/+1
|\ \ | |/ |/| | | | | b8b957d cmake: fix incorrect hint for OPENSSL_ROOT_DIR (moneromooo-monero) 367bb80 mlog: default to not showing SSL errors (moneromooo-monero)
| * mlog: default to not showing SSL errorsmoneromooo-monero2019-05-061-1/+1
| |
* | net_ssl: SSL config tweaks for compatibility and securitymoneromooo-monero2019-05-071-4/+125
|/ | | | | | | | | | 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.
* change SSL certificate fingerprint whitelisting from SHA1 to SHA-256moneromooo-monero2019-04-261-1/+1
| | | | SHA1 is too close to bruteforceable
* serialization: set default log categorymoneromooo-monero2019-04-211-1/+1
|
* Enabling daemon-rpc SSL now requires non-system CA verificationLee Clagett2019-04-071-0/+19
| | | | | If `--daemon-ssl enabled` is set in the wallet, then a user certificate, fingerprint, or onion/i2p address must be provided.
* Require manual override for user chain certificates.Lee Clagett2019-04-071-0/+3
| | | | | | | 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.
* Only check top-level certificate against fingerprint list.Lee Clagett2019-04-071-2/+4
| | | | | | | 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.
* Call `use_certificate_chain_file` instead of `use_certificate_file`Lee Clagett2019-04-071-1/+1
| | | | | | 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.
* Perform RFC 2818 hostname verification in client SSL handshakesLee Clagett2019-04-071-3/+12
| | | | | | | | | | | | 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.
* Require server verification when SSL is enabled.Lee Clagett2019-04-071-11/+10
| | | | | | | | | | | | | 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.
* Add `verify_fail_if_no_cert` option for proper client authenticationLee Clagett2019-04-071-1/+1
| | | | | | | | | 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.
* Pass SSL arguments via one class and use shared_ptr instead of referenceLee Clagett2019-04-072-56/+77
|
* Do not require client certificate unless server has some whitelisted.Lee Clagett2019-04-061-12/+27
| | | | | | | | | | | 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.
* Change SSL certificate file list to OpenSSL builtin load_verify_locationLee Clagett2019-04-061-53/+45
| | | | | | | | | | | | | 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.
* Merge pull request #5358Riccardo Spagni2019-04-061-7/+40
|\ | | | | | | dffdccdc No longer use deprecated RSA_generate_key in favor of RSA_generate_key_ex (Martijn Otto)
| * No longer use deprecated RSA_generate_key in favor ofMartijn Otto2019-03-271-7/+40
| | | | | | | | RSA_generate_key_ex
* | Merge pull request #5327Riccardo Spagni2019-04-011-0/+10
|\ \ | | | | | | | | | c23ea796 New interactive daemon command 'print_net_stats': Global traffic stats (rbrunner7)
| * | New interactive daemon command 'print_net_stats': Global traffic statsrbrunner72019-03-241-0/+10
| | |
* | | Added socks proxy (tor/i2pd/kovri) support to walletLee Clagett2019-03-252-1/+56
| |/ |/|