From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.org!.POSTED!not-for-mail
From: Eli Zaretskii <eliz@gnu.org>
Newsgroups: gmane.emacs.bugs
Subject: bug#28114: 25.2;
	plstore decrypt erroneous on Windows due to carriage return characters
Date: Fri, 18 Aug 2017 12:20:49 +0300
Message-ID: <83mv6xdyfi.fsf@gnu.org>
References: <em627a0335-f8b0-45af-9b70-c9b5450358cd@potestas>
Reply-To: Eli Zaretskii <eliz@gnu.org>
NNTP-Posting-Host: blaine.gmane.org
X-Trace: blaine.gmane.org 1503048130 3286 195.159.176.226 (18 Aug 2017 09:22:10 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Fri, 18 Aug 2017 09:22:10 +0000 (UTC)
Cc: 28114@debbugs.gnu.org
To: Rainer Gemulla <rgemulla@uni-mannheim.de>, Daiki Ueno <ueno@gnu.org>
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 18 11:22:05 2017
Return-path: <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org>
Envelope-to: geb-bug-gnu-emacs@m.gmane.org
Original-Received: from lists.gnu.org ([208.118.235.17])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org>)
	id 1didTg-0000Zy-IK
	for geb-bug-gnu-emacs@m.gmane.org; Fri, 18 Aug 2017 11:22:04 +0200
Original-Received: from localhost ([::1]:38286 helo=lists.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org>)
	id 1didTm-00005v-Uo
	for geb-bug-gnu-emacs@m.gmane.org; Fri, 18 Aug 2017 05:22:10 -0400
Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52394)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1didTh-00005K-8P
	for bug-gnu-emacs@gnu.org; Fri, 18 Aug 2017 05:22:06 -0400
Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1didTe-0006O3-4d
	for bug-gnu-emacs@gnu.org; Fri, 18 Aug 2017 05:22:05 -0400
Original-Received: from debbugs.gnu.org ([208.118.235.43]:34844)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
	id 1didTe-0006Nx-0z
	for bug-gnu-emacs@gnu.org; Fri, 18 Aug 2017 05:22:02 -0400
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
	(envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1didTd-0004c1-Ok
	for bug-gnu-emacs@gnu.org; Fri, 18 Aug 2017 05:22:01 -0400
X-Loop: help-debbugs@gnu.org
Resent-From: Eli Zaretskii <eliz@gnu.org>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Fri, 18 Aug 2017 09:22:01 +0000
Resent-Message-ID: <handler.28114.B28114.150304808017676@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 28114
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
Original-Received: via spool by 28114-submit@debbugs.gnu.org id=B28114.150304808017676
	(code B ref 28114); Fri, 18 Aug 2017 09:22:01 +0000
Original-Received: (at 28114) by debbugs.gnu.org; 18 Aug 2017 09:21:20 +0000
Original-Received: from localhost ([127.0.0.1]:43525 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
	id 1didSx-0004b1-HF
	for submit@debbugs.gnu.org; Fri, 18 Aug 2017 05:21:19 -0400
Original-Received: from eggs.gnu.org ([208.118.235.92]:33038)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <eliz@gnu.org>) id 1didSv-0004ap-72
	for 28114@debbugs.gnu.org; Fri, 18 Aug 2017 05:21:17 -0400
Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eliz@gnu.org>) id 1didSo-0005JU-Ur
	for 28114@debbugs.gnu.org; Fri, 18 Aug 2017 05:21:11 -0400
Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57875)
	by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@gnu.org>)
	id 1didSi-00058y-KB; Fri, 18 Aug 2017 05:21:04 -0400
Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4378
	helo=home-c4e4a596f7)
	by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
	(Exim 4.82) (envelope-from <eliz@gnu.org>)
	id 1didSf-0006eX-4Q; Fri, 18 Aug 2017 05:21:02 -0400
In-reply-to: <em627a0335-f8b0-45af-9b70-c9b5450358cd@potestas>
	(rgemulla@uni-mannheim.de)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 208.118.235.43
X-BeenThere: bug-gnu-emacs@gnu.org
List-Id: "Bug reports for GNU Emacs,
	the Swiss army knife of text editors" <bug-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-gnu-emacs>,
	<mailto:bug-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-gnu-emacs/>
List-Post: <mailto:bug-gnu-emacs@gnu.org>
List-Help: <mailto:bug-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-gnu-emacs>,
	<mailto:bug-gnu-emacs-request@gnu.org?subject=subscribe>
Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org
Original-Sender: "bug-gnu-emacs"
	<bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org>
Xref: news.gmane.org gmane.emacs.bugs:135896
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/135896>

> From: "Rainer Gemulla" <rgemulla@uni-mannheim.de>
> Date: Wed, 16 Aug 2017 20:09:46 +0000
> 
> When I use plstore with gnupg (from either Cygwin or directly the Windows version), plstore does not
> correctly decrypt. 
> 
> The reason seems to be that spurious carriage return characters are added when encrypting the plstore file.
> When later decrypting it, these carriage returns make gnupg fail.
> 
> This issue can be reproduced by opening a plstore file in plstore-mode and encrypting and decrypting it
> repeatedly via C-c C-c. The added carriage returns are directly visible.
> 
> The error also affects other packages that use the plstore.
> 
> A quick workaround for me was to add an advice that removes the carriage returns (here ^M needs to be
> replaced by the carriage return character):

Daiki, could you please look into this?  AFAICT, the problem is that
plstore.el uses insert-file-contents-literally to read the files,
which leaves the CR characters intact.  Why does plstore.el needs to
use that function?  Can it instead bind coding-system-for-read to
raw-text, and then use insert-file-contents?  Or even just use
insert-file-contents?

Thanks.