This commit introduces a new flag, --noclienttls, which can be used to disable
TLS for the RPC client. However, the flag can only be used when the RPC
client is connecting to localhost interfaces. This is intended to prevent
accidentally leaking sensitive data when switching between local and
remote servers.
This commit introduces a new flag, --noservertls, which can be used to disable
TLS for the RPC server. However, the flag can only be used when the RPC
server is bound to localhost interfaces. This is intended to prevent the
situation where someone decides they want to expose the RPC server to the
web for remote management/access, but forgot they have TLS disabled.
This will allow the worker goroutine to return even if one of the
other workers has already errored, preventing these goroutines from
lingering forever blocking on a channel send.
When detaching the tail end of a slice of blocks or transactions and
appending the newly inserted middle block, and the previous tail, the
capacity of the slice head must be limited to prevent overwriting the
newly inserted block/tx in the same memory as the tail slice.
Bug discovered by @mably while working on the peercoin port of
btcwallet and reported on IRC.
This matches the recent change made to bitcoin core wallet, and
follows roughly a year after the minimum mempool relay fee/kB was
dropped to the same value.
This prevents a downgrade attack to the vulnerable SSLv3. While here,
go ahead and require at least TLS 1.2 since TLS 1.0 and 1.1 have their
own set of issues and it's only a matter of time before those would
need to be completely avoided as well.
Our policy is to only ensure the code compiles for the latest Go release
minus one version. Since Go 1.4 has now been released, this commit
updates TravisCI to remove Go 1.2 from the build matrix. While here, add
release to the matrix which should have been there before anyways.
This contains the APIs to create and retrieve Voting Pools and Series (with
public/private keys) from a walletdb namespace, plus the generation of deposit
addresses (using m-of-n multi-sig P2SH scripts according to the series
configuration).
This commit converts the waddrmgr package to use the new walletdb package
semantics.
Since waddrmgr no longer controls the database, it is unable to make a
copy of the database and return it as the old ExportWatchingOnly function
required. As a result, it has been renamed to ConvertToWatchingOnly and
it now modifies the namespace provided to it. The idea is that the caller
which does control the database can now make a copy of the database, get
the waddrmgr namespace in the database copy and invoke the new function
to modify it. This also works well with other packages that might also
need to make modifications for watching-only mode.
In addition, the following changes are made:
- All places that worked with database paths now work with the
walletdb.Namespace interface
- The managerTx code is replaced to use the walletdb.Tx interface
- The code which checks if the manager already exists is updated to work
with the walletdb.Namespace interface
- The LatestDbVersion constant is now LatestMgrVersion since it no longer
controls the database
This commit cleans up the recent test addition for testing the positive
and negative error paths of the Encrypt and Decrypt functions.
In particular:
- Add comments to all new functions
- Close the manager before trying to delete the file which is otherwise in
use
- Rename the temp prefix since these are not pool tests
- Rename setUp to setupManager to make it a bit more explicit what it's
doing
This commit implements a new namespaced db package which is intended to
be used be wallet and any sub-packages as its data storage mechanism.
- Key/value store
- Namespace support
- Allows multiple packages to have their own area in the database without
worrying about conflicts
- Read-only and read-write transactions with both manual and managed modes
- Nested buckets
- Supports registration of backend databases
- Comprehensive test coverage
This commit adds comments about the specific crypto key types, moves the
selectCryptoKey function before the Encrypt/Decrypt functions that call it
to be more consistent with the rest of the code base, and slightly
modifies the verbiage of the comment.
This function was misleading because it was actually *not* atomic
(meaning it should have never been used at all where atomicity was
required). This will break builds on Plan 9 but I consider this fine
to do since the soon-to-be-integrated waddrmgr package relies on bolt
as a database and also does not compile for Plan 9.
The crypto key type unsed in the manager is not needed outside of the
package. Also, rather than having the newCryptoKey func return the
specific cryptoKey type, make it return the EncryptorDecryptor interface.
This will allow it to be overridden with another type that implements the
interface from the tests.