Allowing for message signature the line feed (LF) character handled by NBGL (documentation update)
What changed, and why it matters
This commit only updates documentation. It fixes a typo in an error-code table and clarifies that the Ledger device can display the full text of a Bitcoin message being signed if it is short enough and contains only printable ASCII characters plus line feeds; otherwise it shows a hash. There is no code change and no security fix.
No security action required; this is a documentation-only update. Review the corresponding implementation if you want to confirm the documented behavior matches the code.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff is limited to doc/bitcoin.md. It corrects the spelling of ‘Abrted’ to ‘Aborted’ in the SW_BAD_STATE description and revises the SIGN_MESSAGE section to document that messages up to 640 bytes containing printable ASCII (0x20-0x7E) and LF (0x0A) are shown in full on the NBGL screen, while longer or non-conforming messages fall back to displaying the SHA256 hash. No implementation, parsing, or cryptographic logic is modified.
Changed components
doc/bitcoin.mdInspect captured patch +4 / −2
diff --git a/doc/bitcoin.md b/doc/bitcoin.md
index 099ef31..8ba529c 100644
--- a/doc/bitcoin.md
+++ b/doc/bitcoin.md
@@ -60,7 +60,7 @@ Once the user approves, the `REGISTER_WALLET` returns to the client a 32-byte HM
| 0x6D00 | `SW_INS_NOT_SUPPORTED` | No command exists with `INS` |
| 0x6E00 | `SW_CLA_NOT_SUPPORTED` | Bad `CLA` used for this application |
| 0xB000 | `SW_WRONG_RESPONSE_LENGTH` | Wrong response length (buffer size problem) |
-| 0xB007 | `SW_BAD_STATE` | Abrted because unexpected state reached |
+| 0xB007 | `SW_BAD_STATE` | Aborted because unexpected state reached |
| 0xB008 | `SW_SIGNATURE_FAIL` | Invalid signature or HMAC |
| 0xE000 | `SW_INTERRUPTED_EXECUTION` | The command is interrupted, and requires the client's response |
| 0x9000 | `SW_OK` | Success |
@@ -300,7 +300,9 @@ User interaction is not required for this command.
Signs a message, according to the standard Bitcoin Message Signing.
-The device shows on its secure screen the BIP-32 path used for signing, and the SHA256 hash of the message; the hash should be verified by the user using an external tool if the client is untrusted.
+The device shows on its secure screen the BIP-32 path used for signing and the message information:
+- either the content of the message (if its length does not exceed 640 bytes in current version and contains only ASCII printable characters (`0x20-0x7E` range) plus Line Feed (`0x0A`));
+- or the SHA256 hash of the message (the hash should be verified by the user using an external tool if the client is untrusted).
#### Encoding
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.