Initial import from FreeBSD RELENG_4:
[dragonfly.git] / usr.sbin / pkg_install / sign / README
1 To sign packages in a transparent way:
2 gzip files can handle an extra field at the beginning that
3 stores anything we wish.
4
5 So it's just a question to choose a format for the signature, and to
6 embed it there.
7
8 We use the extra field to store signatures.  Each signature consists
9 of a 6 bytes type marker, a 2 bytes length, followed by the signature
10 itself.  We can potentially stack signatures: resign a signed archive
11 by just prepending the new signature to the extra field.
12
13 To check the first signature, the checker just needs to extract it, pass it
14 off to the checking protocol (e.g. PGP), followed by the unsigned archive
15 (e.g., regenerate the gzip header  without the first signature, then put
16 the gzip data).
17
18 * Signed archives just look like normal .tar.gz files, except for programs
19 that use the extra field for their own purpose,
20 * Possibility to grab the files off the net and extract stuff/verify
21 signatures on the fly (just need to wedge the checker as an intermediate
22 pipe)
23 * Pretty simple, small portable code to be able to check signatures
24 everywhere (the signer itself needs getpass and corresponding functionality)
25
26 The scheme should be extensible to any compressed format which allows for
27 extended headers.
28
29
30 Thanks to Angelos D. Keromytis for pointing out I did not need to
31 uncompress the archive to sign it, and to other members of the OpenBSD
32 project for various reasons.
33
34 --
35         Marc Espie, 1999
36         $OpenBSD: README,v 1.2 1999/10/04 21:46:27 espie Exp $
37
38 --
39
40 X.509 notes:
41
42 I added the ability to sign a package with an X.509 key, and to check
43 against a stack of X.509 certificates.  This allows a "vendor" to
44 distribute a system with one or more certificates pre-installed, and
45 to add certificates in a signed package by appending them to the
46 default certficiate stack.
47
48 The X.509 signatures are stored in the gzip header in the same manner
49 as other signatures.  This is known to compile against OpenSSL
50 libraries on OpenBSD 2.7 and FreeBSD 5.0, your mileage may vary.
51
52 --
53
54         Wes Peters, Dec 2000
55         $FreeBSD: src/usr.sbin/pkg_install/sign/README,v 1.1.2.1 2001/03/05 03:43:53 wes Exp $