From dd2f9d60f8723d2ced34be32d354d3c8b796f24d Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Thu, 11 Apr 2019 13:30:23 +0200 Subject: [PATCH] publish: fix stupid error in repro-signing and add integration test stoopid mistake in ea84014f9b10114a0022961d86c8e43512b3ba48 reported by @CiaranG --- fdroidserver/publish.py | 2 +- tests/run-tests | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/fdroidserver/publish.py b/fdroidserver/publish.py index ac9a3f44..1369d177 100644 --- a/fdroidserver/publish.py +++ b/fdroidserver/publish.py @@ -280,7 +280,7 @@ def main(): signaturefile, signedfile, manifest = signingfiles with open(signaturefile, 'rb') as f: - devfp = common.signer_fingerprint_short(common.get_signature(f.read())) + devfp = common.signer_fingerprint_short(common.get_certificate(f.read())) devsigned = '{}_{}_{}.apk'.format(appid, vercode, devfp) devsignedtmp = os.path.join(tmp_dir, devsigned) shutil.copy(apkfile, devsignedtmp) diff --git a/tests/run-tests b/tests/run-tests index 63e3b71b..63cefb94 100755 --- a/tests/run-tests +++ b/tests/run-tests @@ -1104,6 +1104,35 @@ if have_git_2_3; then fi +#------------------------------------------------------------------------------# +echo_header 'test extracting and publishing with developer signature' + +REPOROOT=`create_test_dir` +cd $REPOROOT +fdroid_init_with_prebuilt_keystore +echo "accepted_formats = ['txt']" >> config.py +echo 'keydname = "CN=Birdman, OU=Cell, O=Alcatraz, L=Alcatraz, S=California, C=US"' >> config.py +test -d metadata || mkdir metadata +cp $WORKSPACE/tests/metadata/com.politedroid.txt metadata/ +test -d repo || mkdir repo +test -d unsigned || mkdir unsigned +cp $WORKSPACE/tests/repo/com.politedroid_6.apk unsigned/ +$fdroid signatures unsigned/com.politedroid_6.apk +test -d metadata/com.politedroid/signatures/6 +test -f metadata/com.politedroid/signatures/6/MANIFEST.MF +test -f metadata/com.politedroid/signatures/6/RELEASE.RSA +test -f metadata/com.politedroid/signatures/6/RELEASE.SF +! test -f repo/com.politedroid_6.apk +$fdroid publish +test -f repo/com.politedroid_6.apk +if which jarsigner; then + jarsigner -verify repo/com.politedroid_6.apk +fi +if which apksigner; then + apksigner verify repo/com.politedroid_6.apk +fi + + #------------------------------------------------------------------------------# # remove this to prevent git conflicts and complaining