Subject: [PATCH] g10 : passphrase.c : read_passphrase_from_fd : Strip trailing carriage return from passphrase read from file generated on windows

Werner Koch wk at gnupg.org
Mon Jun 16 09:08:48 CEST 2025


On Sun, 15 Jun 2025 23:14, VAIBHAV SHARMA said:
> I have requested this patch after personally facing the issue with a
> passphrase file generated on windows as it was silently including \r in the

Please fix this outside of GnuPG.  We won't change things in GnuPG
because it was never specified what the character set is and whether the
linen ending is CR, or CR+LF.  Some software used fopen("foo","r") and
other software uses fopen("foo", "rb") or "w" and "wb" at the other
site.  Your change fixes this for you but introduces a regression for
others.


Salam-Shalom,

   Werner

-- 
The pioneers of a warless world are the youth that
refuse military service.             - A. Einstein
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openpgp-digital-signature.asc
Type: application/pgp-signature
Size: 247 bytes
Desc: not available
URL: <https://lists.gnupg.org/pipermail/gnupg-devel/attachments/20250616/5101d6f8/attachment.sig>


More information about the Gnupg-devel mailing list