]> err.no Git - dak/commitdiff
Make GPGKeyring a list of keyrings; drop PGPKeyring.
authorAnthony Towns <aj@azure.humbug.org.au>
Sat, 10 Mar 2007 15:24:49 +0000 (01:24 +1000)
committerAnthony Towns <aj@azure.humbug.org.au>
Sat, 10 Mar 2007 15:24:49 +0000 (01:24 +1000)
This allows for more than two keyrings to be used.

config/debian-non-US/dak.conf
config/debian-security/dak.conf
config/debian/dak.conf
dak/import_archive.py
dak/import_ldap_fingerprints.py
daklib/utils.py
docs/README.config

index 2c14c7dbaaf85b9c65aad51aeabc02a0dec3ef95..be2527e56bc535101d62b0fe3e35724f1715dec2 100644 (file)
@@ -1,7 +1,9 @@
 Dinstall
 {
-   PGPKeyring "/org/keyring.debian.org/keyrings/debian-keyring.pgp";
-   GPGKeyring "/org/keyring.debian.org/keyrings/debian-keyring.gpg";
+   GPGKeyring {
+      "/org/keyring.debian.org/keyrings/debian-keyring.gpg";
+      "/org/keyring.debian.org/keyrings/debian-keyring.pgp";
+   };
    SigningKeyring "/org/non-us.debian.org/s3kr1t/dot-gnupg/secring.gpg";
    SigningPubKeyring "/org/non-us.debian.org/s3kr1t/dot-gnupg/pubring.gpg";
    SigningKeyIds "1DB114E0";
index b146c637badedc8fdb914e608d353b8eae2796f1..0af66820a997927b856dac7637840ae81767c08e 100644 (file)
@@ -1,7 +1,9 @@
 Dinstall
 {
-   PGPKeyring "/org/keyring.debian.org/keyrings/debian-keyring.pgp";
-   GPGKeyring "/org/keyring.debian.org/keyrings/debian-keyring.gpg";
+   GPGKeyring {
+      "/org/keyring.debian.org/keyrings/debian-keyring.gpg";
+      "/org/keyring.debian.org/keyrings/debian-keyring.pgp";
+   };
    SigningKeyring "/org/non-us.debian.org/s3kr1t/dot-gnupg/secring.gpg";
    SigningPubKeyring "/org/non-us.debian.org/s3kr1t/dot-gnupg/pubring.gpg";
    SigningKeyIds "2D230C5F";
index 047cf2691eef78647566b4f877b61efcbc6e6a85..50390f5b4b261371ab49c90e12712e8bfaebb223 100644 (file)
@@ -1,7 +1,9 @@
 Dinstall
 {
-   PGPKeyring "/srv/keyring.debian.org/keyrings/debian-keyring.pgp";
-   GPGKeyring "/srv/keyring.debian.org/keyrings/debian-keyring.gpg";
+   GPGKeyrings {
+      "/srv/keyring.debian.org/keyrings/debian-keyring.gpg"; 
+      "/srv/keyring.debian.org/keyrings/debian-keyring.pgp";
+   };
    SigningKeyring "/srv/ftp.debian.org/s3kr1t/dot-gnupg/secring.gpg";
    SigningPubKeyring "/srv/ftp.debian.org/s3kr1t/dot-gnupg/pubring.gpg";
    SigningKeyIds "6070D3A1";
index f064b4aef75160b09f2f330425460ae0b278056b..34dc61bc66664cb817ee73c9b6be0920e8438e11 100755 (executable)
@@ -98,8 +98,8 @@ def check_signature (filename):
         return None
 
     status_read, status_write = os.pipe()
-    cmd = "gpgv --status-fd %s --keyring %s --keyring %s %s" \
-          % (status_write, Cnf["Dinstall::PGPKeyring"], Cnf["Dinstall::GPGKeyring"], filename)
+    cmd = "gpgv --status-fd %s %s %s" \
+          % (status_write, daklib.utils.gpg_keyring_args(), filename)
     (output, status, exit_status) = daklib.utils.gpgv_get_status_output(cmd, status_read, status_write)
 
     # Process the status-fd output
index 4541c33157785195061072cd5e2c38be41b9d45e..90e4108fdcaef49853de288dcb517161855bac37 100755 (executable)
@@ -136,9 +136,8 @@ SELECT f.fingerprint, f.id, u.uid FROM fingerprint f, uid u WHERE f.uid = u.id
     q = projectB.query("SELECT fingerprint, id FROM fingerprint WHERE uid is null")
     for i in q.getresult():
         (fingerprint, fingerprint_id) = i
-        cmd = "gpg --no-default-keyring --keyring=%s --keyring=%s --fingerprint %s" \
-              % (Cnf["Dinstall::PGPKeyring"], Cnf["Dinstall::GPGKeyring"],
-                 fingerprint)
+        cmd = "gpg --no-default-keyring %s --fingerprint %s" \
+              % (gpg_keyring_args(), fingerprint)
         (result, output) = commands.getstatusoutput(cmd)
         if result == 0:
             m = re_gpg_fingerprint.search(output)
@@ -156,9 +155,8 @@ SELECT f.fingerprint, f.id, u.uid FROM fingerprint f, uid u WHERE f.uid = u.id
             extra_keyrings = ""
             for keyring in Cnf.ValueList("Import-LDAP-Fingerprints::ExtraKeyrings"):
                 extra_keyrings += " --keyring=%s" % (keyring)
-            cmd = "gpg --keyring=%s --keyring=%s %s --list-key %s" \
-                  % (Cnf["Dinstall::PGPKeyring"], Cnf["Dinstall::GPGKeyring"],
-                     extra_keyrings, fingerprint)
+            cmd = "gpg %s %s --list-key %s" \
+                  % (gpg_keyring_args(), extra_keyrings, fingerprint)
             (result, output) = commands.getstatusoutput(cmd)
             if result != 0:
                 cmd = "gpg --keyserver=%s --allow-non-selfsigned-uid --recv-key %s" % (Cnf["Import-LDAP-Fingerprints::KeyServer"], fingerprint)
index 4e048d3ccccff4f90f827b47995d0d080684f5f1..9758fc97400d0ee45c7b549caa5d736e44f56a73 100644 (file)
@@ -904,7 +904,7 @@ on error."""
     if not keyserver:
         keyserver = Cnf["Dinstall::KeyServer"]
     if not keyring:
-        keyring = Cnf["Dinstall::GPGKeyring"]
+        keyring = Cnf.ValueList("Dinstall::GPGKeyring")[0]
 
     # Ensure the filename contains no shell meta-characters or other badness
     if not re_taint_free.match(filename):
@@ -939,6 +939,14 @@ on error."""
 
 ################################################################################
 
+def gpg_keyring_args(keyrings=None)
+    if not keyrings:
+        keyrings = Cnf.ValueList("Dinstall::GPGKeyring")
+
+    return " ".join(["--keyring %s" % x for x in keyrings])
+
+################################################################################
+
 def check_signature (sig_filename, reject, data_filename="", keyrings=None, autofetch=None):
     """Check the signature of a file and return the fingerprint if the
 signature is valid or 'None' if it's not.  The first argument is the
@@ -963,7 +971,7 @@ used."""
         return None
 
     if not keyrings:
-        keyrings = (Cnf["Dinstall::PGPKeyring"], Cnf["Dinstall::GPGKeyring"])
+        keyrings = Cnf.ValueList("Dinstall::GPGKeyring")
 
     # Autofetch the signing key if that's enabled
     if autofetch == None:
@@ -976,10 +984,9 @@ used."""
 
     # Build the command line
     status_read, status_write = os.pipe(); 
-    cmd = "gpgv --status-fd %s" % (status_write)
-    for keyring in keyrings:
-        cmd += " --keyring %s" % (keyring)
-    cmd += " %s %s" % (sig_filename, data_filename)
+    cmd = "gpgv --status-fd %s %s %s %s" % (
+        status_write, gpg_keyring_args(keyrings), sig_filename, data_filename)
+
     # Invoke gpgv on the file
     (output, status, exit_status) = gpgv_get_status_output(cmd, status_read, status_write)
 
index 29749f65e15d4c0536081d7d75c635cd1a9775e1..c0e831f3df23a4f5fc09135c39c3998e27b58a7c 100644 (file)
@@ -200,8 +200,10 @@ Mandatory.  List of dinstall options, e.g.:
 
 | Dinstall
 | {
-|    PGPKeyring "/org/keyring.debian.org/keyrings/debian-keyring.pgp";
-|    GPGKeyring "/org/keyring.debian.org/keyrings/debian-keyring.gpg";
+|    GPGKeyring {
+|       "/org/keyring.debian.org/keyrings/debian-keyring.gpg";
+|       "/org/keyring.debian.org/keyrings/debian-keyring.pgp";
+|    };
 |    SigningKeyring "/org/ftp.debian.org/s3kr1t/dot-gnupg/secring.gpg";
 |    SendmailCommand "/usr/sbin/sendmail -odq -oi -t";
 |    MyEmailAddress "Debian Installer <installer@ftp-master.debian.org>";
@@ -222,8 +224,8 @@ Mandatory.  List of dinstall options, e.g.:
 |    };
 | };
 
-PGPKeyring and GPGKeyring (required): filenames of the PGP and GnuPG
-keyrings to be used by dak respectively.
+GPGKeyring (required): filenames of the PGP and GnuPG
+keyrings to be used by dak.
 
 SigningKeyring (optional): this is the private keyring used by 'dak
 generate-releases'.