Skip to content

Commit 7cfbb85

Browse files
committed
test: wallet: cover wallet passphrase with a null char
1 parent f999c37 commit 7cfbb85

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/functional/wallet_encryption.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ def run_test(self):
9595
self.nodes[0].walletpassphrasechange(passphrase2, passphrase_with_nulls)
9696
# walletpassphrasechange should not stop at null characters
9797
assert_raises_rpc_error(-14, "wallet passphrase entered was incorrect", self.nodes[0].walletpassphrase, passphrase_with_nulls.partition("\0")[0], 10)
98+
assert_raises_rpc_error(-14, "The wallet passphrase entered was incorrect", self.nodes[0].walletpassphrasechange, passphrase_with_nulls.partition("\0")[0], "abc")
99+
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)
100+
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")
98101
with WalletUnlock(self.nodes[0], passphrase_with_nulls):
99102
sig = self.nodes[0].signmessage(address, msg)
100103
assert self.nodes[0].verifymessage(address, sig, msg)

0 commit comments

Comments
 (0)