From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sascha Wilde Newsgroups: gmane.emacs.devel Subject: Re: pgg symmetric encryption patch Date: Fri, 7 Oct 2005 23:49:52 +0200 Message-ID: <20051007214952.GA30235@kenny.sha-bang.local> References: <20051003192503.GA15503@kenny.sha-bang.local> <2cd46e7f0510031250u66ea1349yb437d539ce4027ef@mail.gmail.com> <20051004105330.GA5288@kenny.sha-bang.local> <20051005161905.GA6208@kenny.sha-bang.local> <20051006090152.GB4494@kenny.sha-bang.local> <2cd46e7f0510061541w73bb6a92wb6d22829b6e804ae@mail.gmail.com> <20051007100014.GB4850@kenny.sha-bang.local> <2cd46e7f0510071106k3d4d3e6agc36f16a37d8b6bc6@mail.gmail.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1116174028==" X-Trace: sea.gmane.org 1128721991 16283 80.91.229.2 (7 Oct 2005 21:53:11 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 7 Oct 2005 21:53:11 +0000 (UTC) Cc: "sascha schwab \(symmetric encryption patches\)" , "Daiki Ueno \(pgg author\)" , emacs-devel@gnu.org, "Richard M. Stallman" , "Simon Josefsson \(gnus maintainer of pgg\)" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 07 23:53:07 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EO07q-0003HR-IL for ged-emacs-devel@m.gmane.org; Fri, 07 Oct 2005 23:51:34 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EO07p-0001W1-Kb for ged-emacs-devel@m.gmane.org; Fri, 07 Oct 2005 17:51:33 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EO06U-0000Zx-8o for emacs-devel@gnu.org; Fri, 07 Oct 2005 17:50:10 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EO06S-0000ZH-8F for emacs-devel@gnu.org; Fri, 07 Oct 2005 17:50:09 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EO06R-0000Z9-RH for emacs-devel@gnu.org; Fri, 07 Oct 2005 17:50:07 -0400 Original-Received: from [62.141.58.119] (helo=km1136.keymachine.de) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1EO06Q-0004NG-Ut; Fri, 07 Oct 2005 17:50:07 -0400 Original-Received: from kenny.sha-bang.de (xdslo177.osnanet.de [82.149.191.177]) (authenticated bits=0) by km1136.keymachine.de (8.12.11/8.12.10) with ESMTP id j97Lnmgm027449; Fri, 7 Oct 2005 23:49:48 +0200 Original-Received: from wilde by kenny.sha-bang.de with local (Kenny MUA v.0409034.42) ID 1EO06C-0007x7-NR; Fri, 07 Oct 2005 23:49:52 +0200 Original-To: Ken Manheimer Mail-Followup-To: Ken Manheimer , "Daiki Ueno (pgg author)" , "sascha schwab (symmetric encryption patches)" , "Simon Josefsson (gnus maintainer of pgg)" , "Richard M. Stallman" , emacs-devel@gnu.org In-Reply-To: <2cd46e7f0510071106k3d4d3e6agc36f16a37d8b6bc6@mail.gmail.com> User-Agent: Mutt/1.5.10i X-wieners-gbr-MailScanner-Information: MailScanner presented by www.wieners-gbr.de X-wieners-gbr-MailScanner: Nachricht wurde nicht auf Viren und Spam untersucht, sprechen Sie uns an: www.wieners-gbr.de. X-MailScanner-From: wilde@sha-bang.de X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:43661 Archived-At: --===============1116174028== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pvezYHf7grwyp3Bc" Content-Disposition: inline --pvezYHf7grwyp3Bc Content-Type: multipart/mixed; boundary="UugvWAfsgieZRqgk" Content-Disposition: inline --UugvWAfsgieZRqgk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 07, 2005 at 02:06:55PM -0400, Ken Manheimer wrote: > On 10/7/05, Sascha Wilde wrote: > > On Thu, Oct 06, 2005 at 06:41:14PM -0400, Ken Manheimer wrote: > > > 1. my most serious concern is with the unpatched pgg code. the text = that > > > it encrypts is altered from the original, in order to append \r ca= rriage > > > returns to the text (using pgg-as-lbt / pgg-convert-lbt). > > > > > > the problem with this is that decryption on unix-ish platforms with > > > anything other than pgg will result in text that is different than= the > > > original. > > > > This is supposed to be a feature, not a bug. > > But read on, there actually _is_ a bug in PGG... [...] > > THE BUG: pgg does the newline conversion by it self (I'm not quite > > sure why) but fails to tell the backend (gpg) that it should operate > > in textmode, so the Data Packet is tagged as binary, not text data... >=20 > pgg is definitely doing the wrong thing in converting the text to DOS > format, itself. that requires that pgg be the decryption program used > if the platform where the message is being decrypted does not use DOS > file-encoding. While I agree, that it is unnecessary (at least with gpg as backend) I wouldn't say, that it is wrong. When the content of the data packet is tag as text, _any_ decrypting application is required to convert the to the type of linebreak matching the local system. > > Please try if the appended patch (only against pgg-gpg.el) fixes this > > issue. >=20 > that didn't work, but lead me in the right direction to what looks > like the fix. >=20 > it does work if you also remove the invocation of the pgg-as-lbt macro > which encloses the pgg-gpg-process-region call.=20 As explained it shouldn't make any difference if the conversion is done by pgg or gpg, as long as the data is tagged as text. I tried it here with my latest patches and gpg and I was able to encrypt a text using pgg and decrypt it with gpg on the command line as well as with pgg within emacs and getting the right result (unix like linebreakes, that is) in both cases. What happens when you try it? > i'm including a patch which does that for all of the pgg-gpg.el > routines which use pgg-as-lbt. hmm, I don't think you did... ;-) And, as explained, I think this shouldn't be needed. Anyway I found another (unrelated) bug in my code, please see the attached patch. > the problem was that the 'result' value in dolist was being setq'd, > but not made local, so the previous result is used in the case that no > new result is found. i added a '(let (result) ...)' around the > dolist, and it's now behaving properly. that's in my version of your > patch. Yes, this was a bug. (Funny enough, I just found it m self) Everybody: please attache the provided patch... [...] > we're making some good progress here. yes, seems so! :-) Thanks for your work. cheers sascha --=20 Sascha Wilde : "Lies, was ich meine, nicht, was ich schreibe." : (Urs Traenkner in de.alt.admin) --UugvWAfsgieZRqgk Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="pgg-gpg_symmetric-key-p.patch" Content-Transfer-Encoding: quoted-printable --- /usr/share/emacs/22.0.50/lisp/gnus/pgg-gpg.el 2005-10-07 11:47:44.00000= 0000 +0200 +++ /home/wilde/src/std-src/emacs/lisp/gnus/pgg-gpg.el 2005-10-07 23:29:57.= 000000000 +0200 @@ -205,10 +205,11 @@ =20 (defun pgg-gpg-symmetric-key-p (message-keys) "Check if MESSAGE-KEYS contains a symmetric encryption indicator." - (dolist (key message-keys result) - (when (and (eq (car key) 3) - (member '(symmetric-key-algorithm) key)) - (setq result key)))) + (let ((result)) + (dolist (key message-keys result) + (when (and (eq (car key) 3) + (member '(symmetric-key-algorithm) key)) + (setq result key))))) =20 (defun pgg-gpg-select-matching-key (message-keys secret-keys) "Choose a key from MESSAGE-KEYS that matches one of the keys in SECRET-K= EYS." --UugvWAfsgieZRqgk-- --pvezYHf7grwyp3Bc Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQFDRu2AchutvmkRUCQRAig/AJ4sT3obYK3vZ2+wX6aSY7rS0bY5NACgyNxE 96+B4VJwwtmlHibX0y0AokY= =VD7j -----END PGP SIGNATURE----- --pvezYHf7grwyp3Bc-- --===============1116174028== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --===============1116174028==--