keybase / keybase/keybase-issues
Telegram messes with dash line formatting
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 899
- Forks
- 40
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
I know this is not technically an error on Keybase's side all, but it may prove to be a frustration to the less tech-savvy users out there.
An example signed message I was showing my friends in a Telegram chat:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Captain Crunch is delicious.
I'm David and I approve of this message!
-----BEGIN PGP SIGNATURE-----
Version: Keybase OpenPGP v2.0.56
Comment: https://keybase.io/crypto
wsBcBAABCgAGBQJX3X80AAoJECgJko4B16hwoMoH/iiY2At85LKH6lFJV9nh/a+/
+It+t12srZYStVOxP33FAf0WDNPZ9vwSoJscMlVO00Q3YkUCx5L01UTp/ozBanRW
0yBbWcCYGP96H2Jc2t4imDGJ1cvD/2MsjShfHSawXIUXLo58QdPHcQhzG9KSLU4B
A5LKCfEzW+n4lJYzfyLvIJTTU9VU+WE7bZGMl0Wld9VT6C0+CRR7sVEfqDZmIBGy
QXNYf0KhugaZWFgQvsVSXEQwM0KiE96AfovincgCjzPeFtAur1BS7aBK/4dcULfq
VybA3c7/qQJdJKwSKbMyn99/H6W32J9e7kvkyugxdPxold4ZP7dj58FCHUCFhXw=
=iE6p
-----END PGP SIGNATURE-----
What Telegram actually displays (and copies/pastes back):
-----BEGIN PGP SIGNED MESSAGE---—
Hash: SHA512
Captain Crunch is delicious.
I'm David and I approve of this message!
—---BEGIN PGP SIGNATURE---—
Version: Keybase OpenPGP v2.0.56
Comment: https://keybase.io/crypto
wsBcBAABCgAGBQJX3X80AAoJECgJko4B16hwoMoH/iiY2At85LKH6lFJV9nh/a+/
+It+t12srZYStVOxP33FAf0WDNPZ9vwSoJscMlVO00Q3YkUCx5L01UTp/ozBanRW
0yBbWcCYGP96H2Jc2t4imDGJ1cvD/2MsjShfHSawXIUXLo58QdPHcQhzG9KSLU4B
A5LKCfEzW+n4lJYzfyLvIJTTU9VU+WE7bZGMl0Wld9VT6C0+CRR7sVEfqDZmIBGy
QXNYf0KhugaZWFgQvsVSXEQwM0KiE96AfovincgCjzPeFtAur1BS7aBK/4dcULfq
VybA3c7/qQJdJKwSKbMyn99/H6W32J9e7kvkyugxdPxold4ZP7dj58FCHUCFhXw=
=iE6p
—---END PGP SIGNATURE---—
If you pay close attention to the dashes, you'll see that Telegram has replaced the standard dash (or "minus") with the long em-dash character ( — ). What's more, it seems to replace two -'s with single —'s
Plugging this into the web too, or command line tool, lets you know there's no headers. The "easy" fix is to make sure there are five regular dashes on each header line; but that only works if you know what to look. I see this becoming a problem with other chat clients and e-mail clients like Outlook, which loves to do funky things with em-dashes.
For the sake of the less technical users out there, we may want to look at an option that tries to fix that for the sake of the user's sanity? Perhaps code that will check for the header errors, then attempt to regex dashes and emdashes around the common PGP headers (like "BEGIN PGP SIGNATURE"), replace it with the standard five dashes.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No repository file, test, or entry point is named in the issue. First locate the OpenPGP parsing path and its existing tests, then clarify the intended handling of dash and em-dash variants before defining regression coverage for malformed PGP headers.
Written by the indexing model from the issue text.
Assessment
- Domain
- cryptography, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100