🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #141856

Re: [slrn][Xnews] Custom SigDash Regex in slrn?

#141856
From: Paul Boekholt
Date: Thu, 22 Jan 2004 08:07
104 lines
4734 bytes
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 21 Jan 2004 21:40:02 GMT, DC <dcmoose@myrealbox.com> said:
> 
> True, but what with the "artifacts" this sometimes leaves behind?
> 
> Like this
> 
> i.e. - --
>      Visit my web page at http://blahblah.bla

These artifacts are not just left in the signature, but before any dash at
the beginning of a line.

- - like this one

>From the gpg FAQ:

4.7) How do I sign a patch file?

    Use "gpg --clearsign --not-dash-escaped ...".  The problem with
    --clearsign is that all lines starting with a dash are quoted with
    "- ";

As you can see, I haven't added the --not-dash-escaped option to my gpg.sl
yet.


6.8) When I use --clearsign, the plain text has sometimes extra dashes 
in it - why?

    This is called dash-escaped text and required by OpenPGP.
    It always happens when a line starts with a dash ("-") and is needed
    to make the lines that structure signature and text
    (i.e., "-----BEGIN PGP SIGNATURE-----") to be the only lines that
    start with two dashes.

    If you use GnuPG to process those messages, the extra dashes are removed.
    Good mail clients remove those extra dashes when displaying such a 
    message.      

By "processing with GnuPG", they probably mean that you should decrypt
it, even though it was only signed and not encrypted.  Anyone know a good
mail client?  Gnus will remove the dashes but in the "like this one line"
above it will remove BOTH dashes.

This is from Gnus 5.7, but Gnus 5.9 has the same problem.

#v+
(defun article-hide-pgp (&optional arg)
  "Toggle hiding of any PGP headers and signatures in the current article.
If given a negative prefix, always show; if given a positive prefix,
always hide."
  (interactive (gnus-article-hidden-arg))
  (unless (gnus-article-check-hidden-text 'pgp arg)
    (save-excursion
      (let ((inhibit-point-motion-hooks t)
	    buffer-read-only beg end)
	(widen)
	(goto-char (point-min))
	;; Hide the "header".
	(when (search-forward "\n-----BEGIN PGP SIGNED MESSAGE-----\n" nil t)
	  (delete-region (1+ (match-beginning 0)) (match-end 0))
	  (setq beg (point))
	  ;; Hide the actual signature.
	  (and (search-forward "\n-----BEGIN PGP SIGNATURE-----\n" nil t)
	       (setq end (1+ (match-beginning 0)))
	       (delete-region
		end
		(if (search-forward "\n-----END PGP SIGNATURE-----\n" nil t)
		    (match-end 0)
		  ;; Perhaps we shouldn't hide to the end of the buffer
		  ;; if there is no end to the signature?
		  (point-max))))
	  ;; Hide "- " PGP quotation markers.
	  (when (and beg end)
	    (narrow-to-region beg end)
	    (goto-char (point-min))
	    (while (re-search-forward "^- " nil t)
	      (delete-region
	       (match-beginning 0) (match-end 0)))
	    (widen))
	  (gnus-run-hooks 'gnus-article-hide-pgp-hook))))))
#v-

The problem is that after the re-search-forward and delete-region, they
forgot to go to the end of the line so the second dash matches again. It
should be

#v+
  (while (re-search-forward "^- " nil t)
    (delete-region
     (match-beginning 0) (match-end 0))
    (end-of-line)))
#v-
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: processed by gpg.sl <http://jedmodes.sf.net>

iEYEARECAAYFAkAPg64ACgkQ1RTqFUe7bzNgoQCgxLN49HHrRQ9sh54A0GFX3X6/
ujQAoMhguj/LxRurYZmkzgSDTg40Ogja
=pZ+5
-----END PGP SIGNATURE-----
Technical Details
Message-ID: <buo0ct$9pn$1@reader11.wxs.nl>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!intern1.nntp.aus1.giganews.com!internal1.nntp.sjc.giganews.com!border2.nntp.sjc.giganews.com!border1.nntp.sjc.giganews.com!nntp.giganews.com!newshub.sdsu.edu!logbridge.uoregon.edu!news2.telebyte.nl!news.cambrium.nl!news.cambrium.nl!news.cambrium.nl!news2.euro.net!zonnet-feed!newsfeed.wxs.nl!textnews.wxs.nl!not-for-mail
References: <slrnc0tdol.k09.dcmoose@moosemeat.ca.INVALID> <slrnc0to1m.2lk.rudy@142.39.20.3> <slrnc0tr9o.m2u.dcmoose@moosemeat.ca.INVALID> <Xns94779E212F73ALouiscypherhellorg@140.99.99.130> <slrnc0tsdi.m2u.dcmoose@moosemeat.ca.INVALID>

Show Full Headers
Complete Article Headers
Message-ID: <buo0ct$9pn$1@reader11.wxs.nl>
Subject: Re: [slrn][Xnews] Custom SigDash Regex in slrn?
Date: Thu, 22 Jan 2004 08:07:57 +0000
From: Paul Boekholt <p.boekholt@hetnet.nl>
References: <slrnc0tdol.k09.dcmoose@moosemeat.ca.INVALID> <slrnc0to1m.2lk.rudy@142.39.20.3> <slrnc0tr9o.m2u.dcmoose@moosemeat.ca.INVALID> <Xns94779E212F73ALouiscypherhellorg@140.99.99.130> <slrnc0tsdi.m2u.dcmoose@moosemeat.ca.INVALID>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!intern1.nntp.aus1.giganews.com!internal1.nntp.sjc.giganews.com!border2.nntp.sjc.giganews.com!border1.nntp.sjc.giganews.com!nntp.giganews.com!newshub.sdsu.edu!logbridge.uoregon.edu!news2.telebyte.nl!news.cambrium.nl!news.cambrium.nl!news.cambrium.nl!news2.euro.net!zonnet-feed!newsfeed.wxs.nl!textnews.wxs.nl!not-for-mail
Newsgroups: news.software.readers
Organization: Planet Internet
Lines: 104
NNTP-Posting-Host: ipc379d12a.dial.hetnet.nl
X-Trace: reader11.wxs.nl 1074758877 10039 195.121.209.42 (22 Jan 2004 08:07:57
 GMT)
X-Complaints-To: abuse@planet.nl
NNTP-Posting-Date: 22 Jan 2004 08:07:57 GMT
User-Agent: JED 0.99.16