chiark / gitweb /
make-secnet-sites: In v1 output, ignore keys for non-0 groups
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 1 Dec 2019 17:55:32 +0000 (17:55 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 15 Feb 2020 21:56:52 +0000 (21:56 +0000)
This helps makes us conform to the spec in NOTES.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
make-secnet-sites

index 4899dcf..cd04868 100755 (executable)
@@ -459,6 +459,7 @@ class rsakey (pubkey):
                # compatible with old secnet executables
        def forsites(self,version,xcopy,fs):
                if version < 2:
+                       if fs.pkg != '00000000': return []
                        return ['pubkey', str(self.l), self.e, self.n]
                return pubkey.forsites(self,version,xcopy,fs)
 
@@ -696,6 +697,8 @@ class sitelevel(level):
                                                break
                                        if use is None:
                                                use = k
+                               elif isinstance(k,pubkey_group):
+                                       indefault = k.i == '00000000'
                                else:
                                        raise RuntimeError('bad '+repr(k))
                        if use is None: