mirror of
https://github.com/bitcoin-core/gui-qml.git
synced 2026-12-02 07:54:42 +00:00
Sign and Verify replace non-breaking spaces in the message #1091
Labels
No labels
Android
Bug
Build system
Design suggestion
Doc
Needs design review
Needs rebase
Stage
UX
Up for grabs
Upstream
Wallet
duplicate
enhancement
good first issue
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin-core/gui-qml#1091
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Pasting a message containing a non-breaking space changes the text supplied to signing and verification. A valid signature for the original message fails verification, and signing the pasted message creates a signature for different bytes.
To reproduce:
Audit statement, with U+00A0 NON-BREAKING SPACE between the words. In escaped notation, the message isAudit\u00a0statement; use the actual character rather than the literal escape.signmessageRPC. Confirm thatverifymessageaccepts it.Audit statementwith an ordinary space.The GUI reports “Message verification failed” in step 3. In step 4, its signature verifies against the ordinary-space version and fails against the original. The text supplied to signing and verification contains U+0020 where the pasted message contained U+00A0.
For this example, the UTF-8 bytes change from
4175646974c2a073746174656d656e74to41756469742073746174656d656e74. Ordinary-space messages and controls containing other Unicode characters, tabs, newlines and trailing spaces work correctly.Sign/Verify should preserve the exact message being signed or verified. The current submission code reads the editor’s
.textproperty. Qt’s plain-text conversion documents this space substitution, and the Widgets dialog also usestoPlainText(). The failure concerns the application’s handling of exact message content; the underlying signing operation processes the bytes it receives correctly.Reproduced on merged
6e54a48ab571, macOS / Qt 6.9, using the full offscreen application, the editor’s publicpaste()method and independent Core RPC checks. Native Command-V/Cocoa clipboard integration was not tested.