Changes between Initial Version and Version 1 of Ticket #14744, comment 6


Ignore:
Timestamp:
Mar 31, 2015, 4:26:53 AM (6 years ago)
Author:
isis
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #14744, comment 6

    initial v1  
    3333
    3434/me stops preaching about how awesome Twisted is
     35
     36You could also quite easily check the `*.asc` files on the downloaded bundles to ensure that the whole thing downloaded properly. If you were to use [https://pypi.python.org/pypi/gnupg python-gnupg] to do it, it would look something like:
     37
     38{{{
     39import gnupg
     40import glob
     41# The GNUPG_HOME_DIR should have the correct signing keys in its pubring.gpg
     42# file (so geko's and mikeperry's keys, and the Tor Browser signing key, at
     43# the minimum).
     44gpg = gnupg.GPG(homedir=GNUPG_HOME_DIR)
     45signatures = glob.glob("%s/*.asc" % latest_version)
     46verified = []
     47unverified = []
     48for sig in signatures:
     49    bundle = sig.rstrip(".asc")
     50    with open(bundle, 'rb') as fh:
     51        data = fh.read()
     52        result = gpg.verify(data, sig)
     53        if result.valid:
     54            verified.append(bundle)
     55}}}