mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-28 16:36:04 +01:00
Merge bitcoin/bitcoin#32675: test: wallet: cover wallet passphrase with a null char
7cfbb8575etest: wallet: cover wallet passphrase with a null char (brunoerg) Pull request description: This PR adds test coverage for the `walletpassphrase`/`walletpassphrasechange` RPC when the passphrase is incorrect due to a null character. For reference: https://github.com/bitcoin/bitcoin/pull/27068 introduced the usage of `SecureString` to allow null characters. ACKs for top commit: maflcko: lgtm ACK7cfbb8575eachow101: ACK7cfbb8575ew0xlt: Code review ACK7cfbb8575eBrandonOdiwuor: Code Review ACK7cfbb8575etheStack: ACK7cfbb8575epablomartin4btc: cr ACK7cfbb8575eTree-SHA512: ecdb48662ceb6c55c4b301ca7f537c3159ece7b66ee40ea977583ffb74bd3d06e334ab3a5639a9cde3aa6443129f412f9aea0ee5a8b73b31dba0728d0890b7f1
This commit is contained in:
@@ -95,6 +95,9 @@ class WalletEncryptionTest(BitcoinTestFramework):
|
||||
self.nodes[0].walletpassphrasechange(passphrase2, passphrase_with_nulls)
|
||||
# walletpassphrasechange should not stop at null characters
|
||||
assert_raises_rpc_error(-14, "wallet passphrase entered was incorrect", self.nodes[0].walletpassphrase, passphrase_with_nulls.partition("\0")[0], 10)
|
||||
assert_raises_rpc_error(-14, "The wallet passphrase entered was incorrect", self.nodes[0].walletpassphrasechange, passphrase_with_nulls.partition("\0")[0], "abc")
|
||||
assert_raises_rpc_error(-14, "wallet passphrase entered is incorrect. It contains a null character (ie - a zero byte)", self.nodes[0].walletpassphrase, passphrase_with_nulls + "\0", 10)
|
||||
assert_raises_rpc_error(-14, "The old wallet passphrase entered is incorrect. It contains a null character (ie - a zero byte)", self.nodes[0].walletpassphrasechange, passphrase_with_nulls + "\0", "abc")
|
||||
with WalletUnlock(self.nodes[0], passphrase_with_nulls):
|
||||
sig = self.nodes[0].signmessage(address, msg)
|
||||
assert self.nodes[0].verifymessage(address, sig, msg)
|
||||
|
||||
Reference in New Issue
Block a user