~sircmpwn/sr.ht-discuss

1

Public PGP keys contain carriage return characters

Details
Message ID
<8734tz9g6w.fsf@posteo.net>
DKIM signature
pass
Download raw message
Hello.

I noticed that my public PGP key on SourceHut contains many carriage
return characters:

https://meta.sr.ht/~fturco.pgp

Other people's PGP keys have the same issue.  For example:

https://meta.sr.ht/~sircmpwn.pgp
https://meta.sr.ht/~emersion.pgp

Prior to uploading it to SourceHut, I exported my public PGP key with
the following command:

gpg --export --armor --output fturco.asc fturco@posteo.net

The original file "fturco.asc" does not contain any carriage return
character whatsoever.  So it seems they have been introduced by the
SourceHut software itself.

I'm not sure if carriage return characters can be problematic, but they
certainly look ugly when viewed with my editor of choice (GNU Emacs).  I
would prefer not having them if possible.

What do you think?
Details
Message ID
<cab96eb5-7e28-48e3-ba37-fb89590b51a1@thristian.org>
In-Reply-To
<8734tz9g6w.fsf@posteo.net> (view parent)
DKIM signature
missing
Download raw message
On 12/2/24 02:24, Francesco Turco wrote:
> I'm not sure if carriage return characters can be problematic, but they
> certainly look ugly when viewed with my editor of choice (GNU Emacs).  I
> would prefer not having them if possible.

The carriage-return characters shouldn't pose a problem since the key is 
"ASCII armoured", and "different line-ending conventions" is one of the 
situations the ASCII armour is intended to defend against.

The key is served up with the MIME type "text/plain" so it will display 
as text in a browser, and RFC2046 says[1]:

 > The canonical form of any MIME "text" subtype MUST always represent a 
line break as a CRLF sequence.

This is probably one of those things where support for Unix-style 
"LF-only" text files is widespread, and maybe even Mac-style "CR-only" 
text files, but sr.ht is being safe by following the specification.

[1]: https://www.rfc-editor.org/rfc/rfc2046.html#section-4.1.1
Reply to thread Export thread (mbox)