x/crypto/openpgp/clearsign: CRLF line endings not preserved in plaintext #43437
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Hi, I'm a new Go user and this is my first issue, apologies in advance if I missed anything.
I'm trying to preserve CRLF line endings in a clearsigned message.
openpgp/clearsign.Encode strips out trailing whitespace and the line ending and replaces it with CRLF when passing it to the hasher (which matches RFC-4880). But for the plaintext, it replaces it with LF (which I didn't see specified in the RFC). I would like the CRLF to persist in the plaintext.
(Note: keeping CRLF in the clearsigned message matches the behavior of gpg 2.2.24)
Here's an example of the behavior:
https://play.golang.org/p/EC_S61QqbSJ
Also, I have a change that preserves trailing whitespace and line endings in the plaintext, and am happy to submit a PR to fix this behavior.
What did you expect to see?
I expected to see CRLF line endings in the clearsigned message.
What did you see instead?
The clearsigned message used LF as line endings.
The text was updated successfully, but these errors were encountered: