* Patch: Show signature state in encrypted messages using pgg @ 2006-11-10 22:30 Sascha Wilde 2006-11-10 22:31 ` Sascha Wilde 0 siblings, 1 reply; 13+ messages in thread From: Sascha Wilde @ 2006-11-10 22:30 UTC (permalink / raw) Cc: emacs-devel When using pgg to decrypt encrypted messages (via mml2015-pgg-decrypt), gnus shows only [[PGP Encrypted Part:OK]] Regardless if the message was signed or not. This is bad, as one could expect the sender to be authenticated when he reads "OK". The attached patch extends the message a bit, so that it shows the signature verification result in addition. With it a encrypted but unsigned mail shows: [[[PGP Encrypted Part:OK, Signer: From unknown user]] cheers sascha -- Sascha Wilde : "There are 10 types of people in the world. : Those who understand binary and those who don't." ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Patch: Show signature state in encrypted messages using pgg 2006-11-10 22:30 Patch: Show signature state in encrypted messages using pgg Sascha Wilde @ 2006-11-10 22:31 ` Sascha Wilde 2006-11-11 2:19 ` Daiki Ueno 0 siblings, 1 reply; 13+ messages in thread From: Sascha Wilde @ 2006-11-10 22:31 UTC (permalink / raw) Cc: emacs-devel [-- Attachment #1: Type: text/plain, Size: 304 bytes --] Sascha Wilde <wilde@sha-bang.de> wrote: > The attached patch extends the message a bit, so that it shows the > signature verification result in addition. With it a encrypted but > unsigned mail shows: > [[[PGP Encrypted Part:OK, Signer: From unknown user]] Oops, forgot the actual patch, here it is: [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: Type: text/x-patch, Size: 1731 bytes --] diff -r 69703d5e058e -r 9970d5c0861b lisp/gnus/ChangeLog --- a/lisp/gnus/ChangeLog Wed Nov 08 10:14:19 2006 +0100 +++ b/lisp/gnus/ChangeLog Fri Nov 10 23:14:13 2006 +0100 @@ -1,3 +1,8 @@ 2006-11-03 Juanma Barranquero <lekktu@ +2006-11-10 Sascha Wilde <wilde@sha-bang.de> + + * mml2015.el (mml2015-pgg-decrypt, mml2015-pgg-clear-decrypt): + Show info on signature for decrypted parts. + 2006-11-03 Juanma Barranquero <lekktu@gmail.com> * gnus-diary.el (gnus-diary-delay-format-function): diff -r 69703d5e058e -r 9970d5c0861b lisp/gnus/mml2015.el --- a/lisp/gnus/mml2015.el Wed Nov 08 10:14:19 2006 +0100 +++ b/lisp/gnus/mml2015.el Fri Nov 10 23:14:13 2006 +0100 @@ -682,8 +682,10 @@ (replace-match "\n" t t)) (setq handles (mm-dissect-buffer t)) (mm-destroy-parts handle) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info "OK") + (let ((sig (with-current-buffer pgg-errors-buffer + (mml2015-gpg-extract-signature-details)))) + (mm-set-handle-multipart-parameter + mm-security-handle 'gnus-info (concat "OK, Signer: " sig))) (mm-set-handle-multipart-parameter mm-security-handle 'gnus-details (concat decrypt-status @@ -713,8 +715,10 @@ (goto-char (point-min)) (while (search-forward "\r\n" nil t) (replace-match "\n" t t)) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info "OK")) + (let ((sig (with-current-buffer pgg-errors-buffer + (mml2015-gpg-extract-signature-details)))) + (mm-set-handle-multipart-parameter + mm-security-handle 'gnus-info (concat "OK, Signer: " sig)))) (mm-set-handle-multipart-parameter mm-security-handle 'gnus-info "Failed")))) [-- Attachment #3: Type: text/plain, Size: 68 bytes --] -- Sascha Wilde "Gimme about 10 seconds to think for a minute..." [-- Attachment #4: Type: text/plain, Size: 142 bytes --] _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Patch: Show signature state in encrypted messages using pgg 2006-11-10 22:31 ` Sascha Wilde @ 2006-11-11 2:19 ` Daiki Ueno 2006-11-11 21:48 ` Sascha Wilde 0 siblings, 1 reply; 13+ messages in thread From: Daiki Ueno @ 2006-11-11 2:19 UTC (permalink / raw) Cc: ding, emacs-devel >>>>> In <m2mz6zlyr4.fsf@kenny.sha-bang.de> >>>>> Sascha Wilde <wilde@sha-bang.de> wrote: > [1 <text/plain (7bit)>] > Sascha Wilde <wilde@sha-bang.de> wrote: > > The attached patch extends the message a bit, so that it shows the > > signature verification result in addition. With it a encrypted but > > unsigned mail shows: > > [[[PGP Encrypted Part:OK, Signer: From unknown user]] Is there still any chance for such a feature enhancement to get into the release? Anyway, > +2006-11-10 Sascha Wilde <wilde@sha-bang.de> > + > + * mml2015.el (mml2015-pgg-decrypt, mml2015-pgg-clear-decrypt): > + Show info on signature for decrypted parts. > + > + (mm-set-handle-multipart-parameter > + mm-security-handle 'gnus-info (concat "OK, Signer: " sig)))) Did you really test it? mm-uu-pgp-encrypted-extract-1 checks the verification result stored in gnus-info (progn (mml2015-clean-buffer) (funcall (mml2015-clear-decrypt-function)) (equal (mm-handle-multipart-ctl-parameter mm-security-handle 'gnus-info) "OK")) -- Daiki Ueno ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Patch: Show signature state in encrypted messages using pgg 2006-11-11 2:19 ` Daiki Ueno @ 2006-11-11 21:48 ` Sascha Wilde 2006-11-12 0:28 ` Daiki Ueno 0 siblings, 1 reply; 13+ messages in thread From: Sascha Wilde @ 2006-11-11 21:48 UTC (permalink / raw) Cc: ding, emacs-devel Daiki Ueno <ueno@unixuser.org> wrote: >>>>>> In <m2mz6zlyr4.fsf@kenny.sha-bang.de> >>>>>> Sascha Wilde <wilde@sha-bang.de> wrote: >> [1 <text/plain (7bit)>] >> Sascha Wilde <wilde@sha-bang.de> wrote: > >> > The attached patch extends the message a bit, so that it shows the >> > signature verification result in addition. With it a encrypted but >> > unsigned mail shows: >> > [[[PGP Encrypted Part:OK, Signer: From unknown user]] > > Is there still any chance for such a feature enhancement to get into the > release? Anyway, No, I don't think so, but I think that: 1. There is a chance to get it into gnus CVS 2. It is a good idea to make it public available, not at least as a reminder for after the release... ;-) >> +2006-11-10 Sascha Wilde <wilde@sha-bang.de> >> + >> + * mml2015.el (mml2015-pgg-decrypt, mml2015-pgg-clear-decrypt): >> + Show info on signature for decrypted parts. >> + >> + (mm-set-handle-multipart-parameter >> + mm-security-handle 'gnus-info (concat "OK, Signer: " sig)))) > > Did you really test it? Yes, and I'm using a patched version for some days without problems, but: beware I've only tested this code, not proven it right. ;-) > mm-uu-pgp-encrypted-extract-1 checks the > verification result stored in gnus-info > > (progn > (mml2015-clean-buffer) > (funcall (mml2015-clear-decrypt-function)) > (equal (mm-handle-multipart-ctl-parameter mm-security-handle > 'gnus-info) > "OK")) Yes, this might be a problem indeed -- but as far as I can see from a quick glance over the source mm-uu-pgp-encrypted-extract-1 is only used for "application/x-gnus-pgp-encrypted" which seems quite non standard and which I haven't knowingly encountered in real live -- which would explains why I haven't noticed the glitch in my patch... Anyway how about something along the lines of ;;; untested: (progn (mml2015-clean-buffer) (funcall (mml2015-clear-decrypt-function)) (eq t (compare-strings "OK" nil nil (mm-handle-multipart-ctl-parameter mm-security-handle 'gnus-info) nil 2))) this should fix it. cheers sascha -- Sascha Wilde Die Existenz von Spam heißt, daß ein Medium noch lebt. Die Existenz von Pr0n heißt, daß es Zukunft hat. -- Leitners Law (<40f7d168@fefe.de>, 16. Juli 2004) ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Patch: Show signature state in encrypted messages using pgg 2006-11-11 21:48 ` Sascha Wilde @ 2006-11-12 0:28 ` Daiki Ueno 2006-11-12 11:05 ` Sascha Wilde 0 siblings, 1 reply; 13+ messages in thread From: Daiki Ueno @ 2006-11-12 0:28 UTC (permalink / raw) Cc: ding, emacs-devel >>>>> In <m2d57tmz7w.fsf@kenny.sha-bang.de> >>>>> Sascha Wilde <wilde@sha-bang.de> wrote: > Daiki Ueno <ueno@unixuser.org> wrote: > >> > The attached patch extends the message a bit, so that it shows the > >> > signature verification result in addition. With it a encrypted but > >> > unsigned mail shows: > >> > [[[PGP Encrypted Part:OK, Signer: From unknown user]] > > > > Is there still any chance for such a feature enhancement to get into the > > release? Anyway, > No, I don't think so, but I think that: > 1. There is a chance to get it into gnus CVS If so, you should make a patch to the Gnus trunk, I think. > Yes, this might be a problem indeed -- but as far as I can see from a > quick glance over the source mm-uu-pgp-encrypted-extract-1 is only > used for "application/x-gnus-pgp-encrypted" which seems quite non > standard and which I haven't knowingly encountered in real live -- > which would explains why I haven't noticed the glitch in my patch... You are appearantly missing that Gnus set application/x-gnus-pgp-encrypted for traditional inline PGP messages. I agree these messages are "quite non standard". > Anyway how about something along the lines of > ;;; untested: > (progn > (mml2015-clean-buffer) > (funcall (mml2015-clear-decrypt-function)) > (eq t > (compare-strings "OK" nil nil > (mm-handle-multipart-ctl-parameter mm-security-handle > 'gnus-info) > nil 2))) > this should fix it. At least XEmacs 21.4 does not have compare-strings. BTW, why do you tend to spread your kludge here and there? Why not use some other parameters such as 'gnus-details instead? -- Daiki Ueno ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Patch: Show signature state in encrypted messages using pgg 2006-11-12 0:28 ` Daiki Ueno @ 2006-11-12 11:05 ` Sascha Wilde 2006-11-12 11:09 ` David Kastrup 2006-11-12 13:26 ` Reiner Steib 0 siblings, 2 replies; 13+ messages in thread From: Sascha Wilde @ 2006-11-12 11:05 UTC (permalink / raw) Cc: ding, emacs-devel Daiki Ueno <ueno@unixuser.org> wrote: >>>>>> In <m2d57tmz7w.fsf@kenny.sha-bang.de> >>>>>> Sascha Wilde <wilde@sha-bang.de> wrote: >> Daiki Ueno <ueno@unixuser.org> wrote: >> > Is there still any chance for such a feature enhancement to get into the >> > release? Anyway, > >> No, I don't think so, but I think that: >> 1. There is a chance to get it into gnus CVS > > If so, you should make a patch to the Gnus trunk, I think. This might me right. I tend to make my changes in the sources of CVS Emacs as that's what I'm using as my productive working environment. I'll port my changes to CVS gnus if that helps. > You are appearantly missing that Gnus set > application/x-gnus-pgp-encrypted for traditional inline PGP messages. I > agree these messages are "quite non standard". Yes, I missed that indeed. Thanks for pointing it out to me, now I know how to test it and indeed with my proposed change to mm-uu-pgp-encrypted-extract-1 it works well. >> Anyway how about something along the lines of > >> ;;; untested: >> (progn >> (mml2015-clean-buffer) >> (funcall (mml2015-clear-decrypt-function)) >> (eq t >> (compare-strings "OK" nil nil >> (mm-handle-multipart-ctl-parameter mm-security-handle >> 'gnus-info) >> nil 2))) > >> this should fix it. > > At least XEmacs 21.4 does not have compare-strings. Sure? (version) "GNU Emacs 21.4.1 (i386-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2005-03-17 on trouble, modified by Debian" (compare-strings "OK" nil nil "OK, Signer" nil 2) t On the other hand: is backwards compatibility still an issue for gnus development anyway, with Emacs 22 being released soon? > BTW, why do you tend to spread your kludge here and there? Why not > use some other parameters such as 'gnus-details instead? 'gnus-details contains the important information already, but 1. The information on the signature (if any) is buried between many lines of verbose information. 2. The information in 'gnus-details is not visible by default, the user has to show it by pressing the [[PGP Encrypted Part:OK]] button. The reason for my patch is, that I think, that the Information if and by whom an encrypted message is signed is _very_ important, and should be always visible. Btw: mml2015-mailcrypt-decrypt does return the same as mml2015-pgg-decrypt does with my patch (and I used it as an example for the exact format of the returned string). cheers sascha -- Sascha Wilde "Gimme about 10 seconds to think for a minute..." ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Patch: Show signature state in encrypted messages using pgg 2006-11-12 11:05 ` Sascha Wilde @ 2006-11-12 11:09 ` David Kastrup 2006-11-12 11:47 ` Sascha Wilde 2006-11-12 13:26 ` Reiner Steib 1 sibling, 1 reply; 13+ messages in thread From: David Kastrup @ 2006-11-12 11:09 UTC (permalink / raw) Cc: Daiki Ueno, ding, emacs-devel Sascha Wilde <wilde@sha-bang.de> writes: > Daiki Ueno <ueno@unixuser.org> wrote: >> >> At least XEmacs 21.4 does not have compare-strings. > > Sure? > > (version) > "GNU Emacs 21.4.1 (i386-pc-linux-gnu, X toolkit, Xaw3d scroll bars) > of 2005-03-17 on trouble, modified by Debian" > (compare-strings "OK" nil nil "OK, Signer" nil 2) > t XEmacs 21.4, not Emacs 21.4. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Patch: Show signature state in encrypted messages using pgg 2006-11-12 11:09 ` David Kastrup @ 2006-11-12 11:47 ` Sascha Wilde 2006-11-12 12:31 ` Daiki Ueno 0 siblings, 1 reply; 13+ messages in thread From: Sascha Wilde @ 2006-11-12 11:47 UTC (permalink / raw) Cc: Daiki Ueno, ding, emacs-devel David Kastrup <dak@gnu.org> wrote: > Sascha Wilde <wilde@sha-bang.de> writes: > >> Daiki Ueno <ueno@unixuser.org> wrote: >>> >>> At least XEmacs 21.4 does not have compare-strings. >> >> Sure? >> >> (version) >> "GNU Emacs 21.4.1 (i386-pc-linux-gnu, X toolkit, Xaw3d scroll bars) >> of 2005-03-17 on trouble, modified by Debian" >> (compare-strings "OK" nil nil "OK, Signer" nil 2) >> t > > XEmacs 21.4, not Emacs 21.4. Ah, someday I should learn to actually _read_ mails... ;-) sorry. I don't use XEmacs, but I guess it shouldn't be to hard to write something equivalent. Would (string= "OK" (subseq ( ... ) 0 2)) work for XEmacs? cheers sascha -- Sascha Wilde : "The PROPER way to handle HTML postings is to cancel the article, then hire a hitman to kill the poster, his wife and kids, and fuck his dog and smash his computer into little bits. Anything more is just extremism." -- Paul Tomblin ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Patch: Show signature state in encrypted messages using pgg 2006-11-12 11:47 ` Sascha Wilde @ 2006-11-12 12:31 ` Daiki Ueno 2006-11-12 14:22 ` Sascha Wilde 0 siblings, 1 reply; 13+ messages in thread From: Daiki Ueno @ 2006-11-12 12:31 UTC (permalink / raw) Cc: ding, emacs-devel >>>>> In <m2k620evjt.fsf@kenny.sha-bang.de> >>>>> Sascha Wilde <wilde@sha-bang.de> wrote: > (string= "OK" (subseq ( ... ) 0 2)) > work for XEmacs? Now, `subseq' is a cl function. ;; I would like `equal' in this situation rather than `string='. Regards, -- Daiki Ueno ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Patch: Show signature state in encrypted messages using pgg 2006-11-12 12:31 ` Daiki Ueno @ 2006-11-12 14:22 ` Sascha Wilde 2006-11-12 14:42 ` Daiki Ueno 0 siblings, 1 reply; 13+ messages in thread From: Sascha Wilde @ 2006-11-12 14:22 UTC (permalink / raw) Cc: ding, emacs-devel Daiki Ueno <ueno@unixuser.org> wrote: >>>>>> In <m2k620evjt.fsf@kenny.sha-bang.de> >>>>>> Sascha Wilde <wilde@sha-bang.de> wrote: >> (string= "OK" (subseq ( ... ) 0 2)) > >> work for XEmacs? > > Now, `subseq' is a cl function. mm-uu.el requires cl anyway, so why not use it? > ;; I would like `equal' in this situation rather than `string='. Just out of curiosity, why? cheers sascha -- Sascha Wilde : "Der Nicht-Denkende glaubt, dass niemand denkt, : der Denkende weiss es!" : (Gabriel Laub) ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Patch: Show signature state in encrypted messages using pgg 2006-11-12 14:22 ` Sascha Wilde @ 2006-11-12 14:42 ` Daiki Ueno 2006-11-12 15:01 ` Sascha Wilde 0 siblings, 1 reply; 13+ messages in thread From: Daiki Ueno @ 2006-11-12 14:42 UTC (permalink / raw) Cc: ding, emacs-devel >>>>> In <m2ac2wzqwf.fsf@kenny.sha-bang.de> >>>>> Sascha Wilde <wilde@sha-bang.de> wrote: > Daiki Ueno <ueno@unixuser.org> wrote: > >>>>>> In <m2k620evjt.fsf@kenny.sha-bang.de> > >>>>>> Sascha Wilde <wilde@sha-bang.de> wrote: > >> (string= "OK" (subseq ( ... ) 0 2)) > > > >> work for XEmacs? > > > > Now, `subseq' is a cl function. > mm-uu.el requires cl anyway, so why not use it? s/anyway/when compiling/ $ cat > test.el <<End (eval-when-compile (require 'cl)) (defun foo (s) (subseq s 0 1)) End $ emacs -Q -batch -f batch-byte-compile test.el $ emacs -l test.elc (foo "test")^J Debugger entered--Lisp error: (void-function subseq) subseq("test" 0 1) > > ;; I would like `equal' in this situation rather than `string='. > Just out of curiosity, why? Because these are identical and `equal' has shorter name than `string='. -- Daiki Ueno ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Patch: Show signature state in encrypted messages using pgg 2006-11-12 14:42 ` Daiki Ueno @ 2006-11-12 15:01 ` Sascha Wilde 0 siblings, 0 replies; 13+ messages in thread From: Sascha Wilde @ 2006-11-12 15:01 UTC (permalink / raw) Cc: ding, emacs-devel Daiki Ueno <ueno@unixuser.org> wrote: >>>>>> In <m2ac2wzqwf.fsf@kenny.sha-bang.de> >>>>>> Sascha Wilde <wilde@sha-bang.de> wrote: >> Daiki Ueno <ueno@unixuser.org> wrote: > >> >>>>>> In <m2k620evjt.fsf@kenny.sha-bang.de> >> >>>>>> Sascha Wilde <wilde@sha-bang.de> wrote: >> >> (string= "OK" (subseq ( ... ) 0 2)) >> > >> >> work for XEmacs? >> > >> > Now, `subseq' is a cl function. > >> mm-uu.el requires cl anyway, so why not use it? > > s/anyway/when compiling/ Ok, my fault -- does XEmacs have substring then (Emacs 21.4 does)? >> > ;; I would like `equal' in this situation rather than `string='. > >> Just out of curiosity, why? > > Because these are identical and `equal' has shorter name than `string='. I see, I prefer `string=' for readability because it says unambiguously what type of data is compared, but with a literal string in the code like in this case this is isn't much on an issue... cheers -- Sascha Wilde : VI is to EMACS as masturbation is to making love: : effective and always available but probably not your : first choice... ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Patch: Show signature state in encrypted messages using pgg 2006-11-12 11:05 ` Sascha Wilde 2006-11-12 11:09 ` David Kastrup @ 2006-11-12 13:26 ` Reiner Steib 1 sibling, 0 replies; 13+ messages in thread From: Reiner Steib @ 2006-11-12 13:26 UTC (permalink / raw) Cc: Daiki Ueno, ding, emacs-devel On Sun, Nov 12 2006, Sascha Wilde wrote: >> At least XEmacs 21.4 does not have compare-strings. > > Sure? As David already pointed out: XEmacs 21.4 not Emacs 21. [...] > On the other hand: is backwards compatibility still an issue for gnus > development anyway, with Emacs 22 being released soon? ,----[ (info "(gnus)Emacsen") ] | Gnus should work on: | | * Emacs 21.1 and up. | | * XEmacs 21.4 and up. | | This Gnus version will absolutely not work on any Emacsen older than | that. Not reliably, at least. Older versions of Gnus may work on older | Emacs versions. Particularly, Gnus 5.10.8 should also work on Emacs | 20.7 and XEmacs 21.1. `---- As we want to keep the Gnus version in Emacs 22 in sync with the v5-10 branch (Gnus 5.10.x), we still want compatibility with Emacs 21 and XEmacs 21.4. But we have dropped support for Emacs 20.7 and XEmacs 21.1 after the release of Gnus 5.10.8: ,---- | 2006-04-17 Reiner Steib <Reiner.Steib@gmx.de> | | * gnus.texi (Emacsen): Don't support Emacs 20.7 and XEmacs 21.1. `---- Bye, Reiner. -- ,,, (o o) ---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/ ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2006-11-12 15:01 UTC | newest] Thread overview: 13+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2006-11-10 22:30 Patch: Show signature state in encrypted messages using pgg Sascha Wilde 2006-11-10 22:31 ` Sascha Wilde 2006-11-11 2:19 ` Daiki Ueno 2006-11-11 21:48 ` Sascha Wilde 2006-11-12 0:28 ` Daiki Ueno 2006-11-12 11:05 ` Sascha Wilde 2006-11-12 11:09 ` David Kastrup 2006-11-12 11:47 ` Sascha Wilde 2006-11-12 12:31 ` Daiki Ueno 2006-11-12 14:22 ` Sascha Wilde 2006-11-12 14:42 ` Daiki Ueno 2006-11-12 15:01 ` Sascha Wilde 2006-11-12 13:26 ` Reiner Steib
Code repositories for project(s) associated with this external index https://git.savannah.gnu.org/cgit/emacs.git https://git.savannah.gnu.org/cgit/emacs/org-mode.git This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.