🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #41614

Re: the signature separator (-- ) (was Re: NetDirect?.)

#41614
From: Russ Allbery
Date: Sat, 20 Jun 1998 00:00
50 lines
3555 bytes
Jon Ribbens <jon@oaktree.co.uk> writes:
> Russ Allbery <rra@stanford.edu> wrote:

>> PGP removes all whitespace from the ends of lines for the purposes of
>> generating or checking attached signatures on a file.  The whitespace
>> is restored in the generated signed document, but you have to munge the
>> whitespace back out again to check it. This means that your signature
>> line still has its space preserved at the end of the line, but if you
>> generate a detached signature for your post, and then later form a
>> combined PGP message from that detached signature and your post, it
>> won't verify.

> Sorry, I don't understand what you're getting at. I can't find any way
> to make PGP not work right. I don't see how you can 'munge' a detached
> signature into an attached one either, nor why you would want to do so.

This whole thing came up originally with signcontrol/pgpverify, the
programs used to generate and check PGP signatures on control messages.
The way signcontrol works is that it feeds the control message after some
munging into PGP and generates a document with an attached signature.  It
then rips the delimiter lines off, pulls out the signature, and puts it
with some additional information in the headers.

If you take the exact same munged data and generate a *detached* signature
for it, you get a signature which verifies exactly the same as the method
that signcontrol works *unless there is a signature delimiter in the
control message* or some other line with trailing whitespace.

The reason for this is not documented, so far as I can tell, *anywhere*,
but it turns out that PGP strips trailing whitespace when generating
documents with attached signatures, while doing the signature generation,
and then silently replaces it.  It does *not* do this when generating
detached signatures.  As a result, in order to work between applications
that generate attached signatures and applications that generate detached
signatures, you have to know when to munge the input data.

It's trivial to turn a detached signature into an attached signature; just
add the delimiter lines and, in the message body, quote any lines with
leading dashes.

The best solution to this problem would be for every application that does
PGP signing and then puts the signature in the headers to generate
detached signatures; the problem is that PGP 2.6.2's interface for
generating detached signatures is abominable.  To say the least.

-- 
Russ Allbery (rra@stanford.edu)         <URL:http://www.eyrie.org/~eagle/>

Technical Details
Message-ID: <m3yaur4m5l.fsf@windlord.Stanford.EDU>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail
References: <358c4ab8.375055130@news.demon.co.uk> <35896c6e.1841771@news.btinternet.com> <358c7962.452537804@news.demon.co.uk> <898207695.579416@sparc.tibus.net> <19980619.141954.4i2.rnr.w164w_-_@locutus.ofB.ORG> <slrn6ombtu.n7d.jon@chalk.oaktree.net.uk> <m3ogvowok4.fsf@windlord.Stanford.EDU> <slrn6on5dn.e8o.jon@chalk.oaktree.net.uk> <m3d8c45m5p.fsf@windlord.Stanford.EDU> <slrn6onc4j.2ip.jon@chalk.oaktree.net.uk>

Show Full Headers
Complete Article Headers
Message-ID: <m3yaur4m5l.fsf@windlord.Stanford.EDU>
Subject: Re: the signature separator (-- ) (was Re: NetDirect?.)
Date: Sat, 20 Jun 1998 00:00:00 +0000
From: Russ Allbery <rra@stanford.edu>
References: <358c4ab8.375055130@news.demon.co.uk> <35896c6e.1841771@news.btinternet.com> <358c7962.452537804@news.demon.co.uk> <898207695.579416@sparc.tibus.net> <19980619.141954.4i2.rnr.w164w_-_@locutus.ofB.ORG> <slrn6ombtu.n7d.jon@chalk.oaktree.net.uk> <m3ogvowok4.fsf@windlord.Stanford.EDU> <slrn6on5dn.e8o.jon@chalk.oaktree.net.uk> <m3d8c45m5p.fsf@windlord.Stanford.EDU> <slrn6onc4j.2ip.jon@chalk.oaktree.net.uk>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail
X-Deja-AN: 364598877
Sender: eagle@windlord.Stanford.EDU
Organization: The Eyrie
Newsgroups: news.software.readers