This pull adds an additional config option, “rpcauth” to allow multiple different users to use different credentials for login.
Motivation: In business settings there are often multiple users accessing a particular core instance, using wallet functionality. Instead of all users sharing the same login name and password, it is desired to have each user generate their own secret password, and have a hashed and salted version added to bitcoin.conf by the admin. Currently there is only one name and password, and it is stored in plaintext. This pull attempts to do just this and will be followed by an additional audit logging pull to enable admins to assign blame to spends and other irreversible actions.
The config option comes in the format:
rpcauth=USERNAME:SALT$HASH
Where:
- USERNAME is the desired username. Name does not have to be unique.
- SALT is the salt for the HMAC_SHA256 function
- HASH is a hex string that is the result of the HMAC_SHA256 function on the user’s secret password plus the SALT as the key.
A “canonical” password generating python script has been supplied in share/rpcuser. From the client-side, one connects using the standard -rpcuser/-rpcpassword options.