[Pkg-privacy-commits] [torbrowser-launcher] 37/476: wrote a verify.sh script to verify signatures, moved files around some, and implemented verify function
Ximin Luo
infinity0 at moszumanska.debian.org
Sat Aug 22 13:21:20 UTC 2015
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch debian
in repository torbrowser-launcher.
commit 64fecf56ad84c74c285f00bdd3bf07a41de1ee6b
Author: Micah Lee <micahflee at riseup.net>
Date: Fri Feb 15 14:24:12 2013 -0800
wrote a verify.sh script to verify signatures, moved files around some, and implemented verify function
---
README | 13 +++++++++++++
build_and_install.sh | 6 +++---
misc/erinn.asc => erinn.asc | 0
setup.py | 5 +++--
torbrowser-launcher | 13 ++++++++++---
misc/torbrowser.desktop => torbrowser.desktop | 0
misc/torbrowser32.xpm => torbrowser32.xpm | 0
misc/torbrowser80.xpm => torbrowser80.xpm | 0
verify.sh | 16 ++++++++++++++++
9 files changed, 45 insertions(+), 8 deletions(-)
diff --git a/README b/README
index f966b40..0e13685 100644
--- a/README
+++ b/README
@@ -10,6 +10,9 @@ Tor Browser Launcher will get updated each time a new version of TBB is released
Building a Debian package
=========================
+Dependencies
+------------
+
You need to have stdeb installed. If you're using Debian or Ubuntu you can install it like this:
sudo apt-get install python-stdeb
@@ -18,6 +21,9 @@ Here are other things you might need:
sudo apt-get install build-essential dpkg-dev debhelper devscripts fakeroot cdbs
+Building
+--------
+
First build a source distribution:
python setup.py sdist
@@ -32,6 +38,13 @@ Turn it into a Debian binary package:
cd deb_dist/torbrowser-launcher-0.1
dpkg-buildpackage -rfakeroot -uc -us
+Or, to combine all those in one line:
+
+ python setup.py sdist; cd dist; py2dsc torbrowser-launcher-0.1.tar.gz; cd deb_dist/torbrowser-launcher-0.1; dpkg-buildpackage -rfakeroot -uc -us; cd ..
+
+Installing
+----------
+
Once you've made a .deb, you can install it like this:
sudo dpkg -i python-torbrowser-launcher_0.1_all.deb
diff --git a/build_and_install.sh b/build_and_install.sh
index c400dc0..1552320 100755
--- a/build_and_install.sh
+++ b/build_and_install.sh
@@ -8,14 +8,14 @@ python setup.py sdist
# turn it into a debian source package
cd dist
-py2dsc torbrowser-launcher-2.3.25-2-1.tar.gz
+py2dsc torbrowser-launcher-0.1.tar.gz
# turn it into a debian binary package
-cd deb_dist/torbrowser-launcher-2.3.25-2-1
+cd deb_dist/torbrowser-launcher-0.1
dpkg-buildpackage -rfakeroot -uc -us
# install it
cd ..
-sudo dpkg -i python-torbrowser-launcher_2.3.25-2-1-1_all.deb
+sudo dpkg -i python-torbrowser-launcher_0.1-1_all.deb
cd ../..
diff --git a/misc/erinn.asc b/erinn.asc
similarity index 100%
rename from misc/erinn.asc
rename to erinn.asc
diff --git a/setup.py b/setup.py
index 0f03c7c..1e020f7 100644
--- a/setup.py
+++ b/setup.py
@@ -18,6 +18,7 @@ Tor Browser Launcher will get updated each time a new version of TBB is released
""",
scripts=['torbrowser-launcher'],
- data_files=[('/usr/share/applications', ['misc/torbrowser.desktop']),
- ('/usr/share/pixmaps', ['misc/torbrowser32.xpm', 'misc/torbrowser80.xpm'])]
+ data_files=[('/usr/share/applications', ['torbrowser.desktop']),
+ ('/usr/share/pixmaps', ['torbrowser32.xpm', 'torbrowser80.xpm']),
+ ('/usr/share/torbrowser-launcher', ['erinn.asc', 'verify.sh'])]
)
diff --git a/torbrowser-launcher b/torbrowser-launcher
index 09c56f9..32a05ed 100755
--- a/torbrowser-launcher
+++ b/torbrowser-launcher
@@ -82,13 +82,15 @@ class TorBrowserLauncher:
'dir': {
'data': tbb_data,
'download': tbb_data+'/download',
- 'tbb': tbb_data+'/tbb/'+self.architecture
+ 'tbb': tbb_data+'/tbb/'+self.architecture,
+ 'gpg': tbb_data+'/gpgtmp'
},
'file': {
'version': tbb_data+'/version',
'start': tbb_data+'/tbb/'+self.architecture+'/tor-browser_'+self.language+'/start-tor-browser',
'tarball': tbb_data+'/download/'+tarball_filename,
- 'tarball_sig': tbb_data+'/download/'+tarball_filename+'.asc'
+ 'tarball_sig': tbb_data+'/download/'+tarball_filename+'.asc',
+ 'verify': '/usr/share/torbrowser-launcher/verify.sh'
},
'url': {
#'tarball': 'https://www.torproject.org/dist/torbrowser/linux/'+tarball_filename,
@@ -264,7 +266,12 @@ class TorBrowserLauncher:
return True
def verify(self):
- self.run_task();
+ verify_output = subprocess.check_output([self.paths['file']['verify']])
+ if 'Good signature' in verify_output:
+ self.run_task();
+
+ else:
+ self.label = "Signature verification failed!"
def extract(self):
subprocess.call(['tar', '-xf', self.paths['file']['tarball'], '-C', self.paths['dir']['tbb']])
diff --git a/misc/torbrowser.desktop b/torbrowser.desktop
similarity index 100%
rename from misc/torbrowser.desktop
rename to torbrowser.desktop
diff --git a/misc/torbrowser32.xpm b/torbrowser32.xpm
similarity index 100%
rename from misc/torbrowser32.xpm
rename to torbrowser32.xpm
diff --git a/misc/torbrowser80.xpm b/torbrowser80.xpm
similarity index 100%
rename from misc/torbrowser80.xpm
rename to torbrowser80.xpm
diff --git a/verify.sh b/verify.sh
new file mode 100755
index 0000000..fb444d1
--- /dev/null
+++ b/verify.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+# usage: verify.sh [temporary gpg directory] [tor-browser-gnu-linux-xxx.tar.gz.asc]
+
+GPG_TMP_DIR=$1
+TBB_SIG=$2
+
+# clean the temp gpg dir
+rm -rf $GPG_TMP_DIR
+mkdir -p $GPG_TMP_DIR
+chmod 700 $GPG_TMP_DIR
+
+# import erinn's public key
+gpg --homedir $GPG_TMP_DIR --import /usr/share/torbrowser-launcher/erinn.asc
+
+#verify the signature
+gpg --homedir $GPG_TMP_DIR --verify $TBB_SIG
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/torbrowser-launcher.git
More information about the Pkg-privacy-commits
mailing list