On Fri, Oct 07, 2005 at 02:06:55PM -0400, Ken Manheimer wrote:
> On 10/7/05, Sascha Wilde <[EMAIL PROTECTED]> 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 
> > > carriage
> > >    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...
> 
> 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 <CR><LF> to the type of linebreak matching the local system.

> > Please try if the appended patch (only against pgg-gpg.el) fixes this
> > issue.
> 
> that didn't work, but lead me in the right direction to what looks
> like the fix.
> 
> it does work if you also remove the invocation of the pgg-as-lbt macro
> which encloses the pgg-gpg-process-region call. 

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
-- 
Sascha Wilde : "Lies, was ich meine, nicht, was ich schreibe."
             : (Urs Traenkner in de.alt.admin)
--- /usr/share/emacs/22.0.50/lisp/gnus/pgg-gpg.el       2005-10-07 
11:47:44.000000000 +0200
+++ /home/wilde/src/std-src/emacs/lisp/gnus/pgg-gpg.el  2005-10-07 
23:29:57.000000000 +0200
@@ -205,10 +205,11 @@
 
 (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)))))
 
 (defun pgg-gpg-select-matching-key (message-keys secret-keys)
   "Choose a key from MESSAGE-KEYS that matches one of the keys in SECRET-KEYS."

Attachment: pgpjpTGHdUFsz.pgp
Description: PGP signature

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

Reply via email to