summaryrefslogtreecommitdiff
path: root/lib/thandy/SignerCLI.py
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-12-15 21:18:19 +0000
committerNick Mathewson <nickm@torproject.org>2008-12-15 21:18:19 +0000
commit5a6c54aeb95fcfdc70bef20e4a24a0bceed9ba45 (patch)
treec711d682c8349a5b2b1f2553b3825f058224a97b /lib/thandy/SignerCLI.py
parenteed069baf58952623ea035637eef154e10fa2038 (diff)
Implement lengths in thandy objects, mostly:
Accept them, and when they're present, don't fetch more bytes than specified, since that would be dangerous. Include lengths in every generated object type except for the timestamp, since that would break exising code. git-svn-id: file:///home/or/svnrepo/updater/trunk@17629 55e972cd-5a19-0410-ae62-a4d7a52db4cd
Diffstat (limited to 'lib/thandy/SignerCLI.py')
-rw-r--r--lib/thandy/SignerCLI.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/thandy/SignerCLI.py b/lib/thandy/SignerCLI.py
index 7427474..b3e4a8b 100644
--- a/lib/thandy/SignerCLI.py
+++ b/lib/thandy/SignerCLI.py
@@ -92,17 +92,20 @@ def makebundle(args):
configFile = args[0]
packages = {}
+ packageLen = {}
for pkgFile in args[1:]:
print "Loading", pkgFile
f = open(pkgFile, 'r')
p = json.load(f)
f.close()
+ packageLen = os.stat(pkgFile).st_size
_, r, _ = thandy.formats.checkSignedObj(p)
if r != 'package':
print pkgFile, "was not a package"
packages[p['signed']['name']] = p['signed']
- bundleObj = thandy.formats.makeBundleObj(configFile, packages.__getitem__)
+ bundleObj = thandy.formats.makeBundleObj(configFile, packages.__getitem__,
+ packageLen.__getitem__)
signable = thandy.formats.makeSignable(bundleObj)
ks = getKeyStore()