diff -Nru pius-2.2.3/Changelog pius-2.2.4/Changelog --- pius-2.2.3/Changelog 2017-01-17 01:17:34.000000000 +0000 +++ pius-2.2.4/Changelog 2017-03-01 01:05:54.000000000 +0000 @@ -1,3 +1,12 @@ +2.2.4 +Released: 2/28/17 +phil@ipom.com +- [pius] Handle agent version mismatch error from gpg +- [pius-keyring-mgr] Use long keyids (security) +- [pius-party-worksheet] Handle new gpg format +pstarrev@gmail.com +- [pius] - Do not remove signing key from trustdb (closes #47) + 2.2.3 Released: 1/16/17 phil@ipom.com diff -Nru pius-2.2.3/debian/changelog pius-2.2.4/debian/changelog --- pius-2.2.3/debian/changelog 2017-01-17 06:33:30.000000000 +0000 +++ pius-2.2.4/debian/changelog 2017-03-01 01:21:40.000000000 +0000 @@ -1,3 +1,10 @@ +pius (2.2.4-1) unstable; urgency=medium + + * New upstream release + * New maintainer email address + + -- Felix Lechner Tue, 28 Feb 2017 17:21:40 -0800 + pius (2.2.3-1) unstable; urgency=medium * New upstream release diff -Nru pius-2.2.3/debian/control pius-2.2.4/debian/control --- pius-2.2.3/debian/control 2016-12-01 19:35:59.000000000 +0000 +++ pius-2.2.4/debian/control 2017-03-01 01:21:21.000000000 +0000 @@ -1,8 +1,11 @@ Source: pius Section: utils Priority: extra -Maintainer: Felix Lechner -Build-Depends: debhelper (>= 10), python | python-all | python-dev | python-all-dev, dh-python +Maintainer: Felix Lechner +Build-Depends: + debhelper (>= 10), + python | python-all | python-dev | python-all-dev, + dh-python Standards-Version: 3.9.8 X-Python-Version: >= 2.6 Homepage: http://www.phildev.net/pius/ diff -Nru pius-2.2.3/libpius/constants.py pius-2.2.4/libpius/constants.py --- pius-2.2.3/libpius/constants.py 2017-01-17 01:17:34.000000000 +0000 +++ pius-2.2.4/libpius/constants.py 2017-03-01 01:05:54.000000000 +0000 @@ -2,7 +2,7 @@ import os -VERSION = '2.2.3' +VERSION = '2.2.4' MODE_INTERACTIVE = 0 MODE_CACHE_PASSPHRASE = 1 MODE_AGENT = 2 diff -Nru pius-2.2.3/libpius/signer.py pius-2.2.4/libpius/signer.py --- pius-2.2.3/libpius/signer.py 2017-01-17 01:17:34.000000000 +0000 +++ pius-2.2.4/libpius/signer.py 2017-03-01 01:05:54.000000000 +0000 @@ -35,6 +35,7 @@ GPG_PROGRESS = '[GNUPG:] PROGRESS' GPG_PINENTRY_LAUNCHED = '[GNUPG:] PINENTRY_LAUNCHED' GPG_KEY_CONSIDERED = '[GNUPG:] KEY_CONSIDERED' + GPG_WARN_VERSION = '[GNUPG:] WARNING server_version_mismatch' def __init__(self, signer, force_signer, mode, keyring, gpg_path, tmpdir, outdir, encrypt_outfiles, mail, mailer, verbose, sort_keyring, @@ -479,28 +480,35 @@ def export_clean_key(self, key): '''Export clean key from the users' KeyID.''' - debug('exporting %s' % key) - # We have to export our own public key as well - keys_to_export = [key, self.signer] - path = self._tmpfile_path('%s.asc' % key) - self._export_key(self.keyring, keys_to_export, path) + # Export our public key and the given public key + for x in [self.signer, key]: + debug('exporting %s' % x) + path = self._tmpfile_path('%s.asc' % x) + self._export_key(self.keyring, [x], path) def clean_clean_key(self, key): '''Delete the "clean" unsigned key which we exported temporarily.''' - path = self._tmpfile_path('%s.asc' % key) - clean_files([path]) + # Remove the temporary exports of the public keys + paths = [self._tmpfile_path('%s.asc' % x) for x in [self.signer, key]] + clean_files(paths) def import_clean_key(self, key): - '''Import the clean key we expoerted in export_clean_key() to our temp + '''Import the clean key we exported in export_clean_key() to our temp keyring.''' - path = self._tmpfile_path('%s.asc' % key) - cmd = [self.gpg] + self.gpg_base_opts + self.gpg_quiet_opts + [ - '--no-default-keyring', - '--keyring', self.tmp_keyring, - '--import-options', 'import-minimal', - '--import', path, - ] - self._run_and_check_status(cmd) + # Import the export of our public key and the given public key + for x in [self.signer, key]: + debug('importing %s' % x) + import_opts = ['import-minimal'] + if x == self.signer: + import_opts.append('keep-ownertrust') + path = self._tmpfile_path('%s.asc' % x) + cmd = [self.gpg] + self.gpg_base_opts + self.gpg_quiet_opts + [ + '--no-default-keyring', + '--keyring', self.tmp_keyring, + '--import-options', ','.join(import_opts), + '--import', path, + ] + self._run_and_check_status(cmd) def policy_opts(self): if self.policy_url: @@ -896,7 +904,8 @@ PiusSigner.GPG_SIG_BEG in line or PiusSigner.GPG_SIG_CREATED in line or PiusSigner.GPG_PROGRESS in line or - PiusSigner.GPG_PINENTRY_LAUNCHED in line): + PiusSigner.GPG_PINENTRY_LAUNCHED in line or + PiusSigner.GPG_WARN_VERSION): debug('Got skippable stuff') continue else: diff -Nru pius-2.2.3/pius-keyring-mgr pius-2.2.4/pius-keyring-mgr --- pius-2.2.3/pius-keyring-mgr 2017-01-17 01:17:34.000000000 +0000 +++ pius-2.2.4/pius-keyring-mgr 2017-03-01 01:05:54.000000000 +0000 @@ -77,7 +77,7 @@ def keyid_from_fp(fp): '''Given a fingerprint without whitespace, returns keyid.''' - return fp[32:40] + return fp[24:40] def parse_csv(filename, sep, name_field, email_field, fp_field, ignore_emails, ignore_fps): diff -Nru pius-2.2.3/pius-party-worksheet pius-2.2.4/pius-party-worksheet --- pius-2.2.3/pius-party-worksheet 2017-01-17 01:17:34.000000000 +0000 +++ pius-2.2.4/pius-party-worksheet 2017-03-01 01:05:54.000000000 +0000 @@ -20,7 +20,7 @@ # You can find the original at http://www.cryptnet.net/people/vab/ # -use constant VERSION => '2.2.3'; +use constant VERSION => '2.2.4'; sub print_html_header { @@ -42,7 +42,7 @@ my $keyring = shift; my $cmd = 'gpg --fingerprint --no-default-keyring --no-options' . " --with-colons --keyring $keyring | egrep " - . '\'^(pub|fpr):\''; + . '\'^(pub|fpr|uid):\''; my @fps = `$cmd`; return \@fps; } @@ -51,13 +51,38 @@ { my $fps = shift; my $key_metadata = {}; + # This goes like this: + # pub <-- public key info + # fpr <-- fingerprint for previous line + # uid <-- uid + # ... possibly many of these + # sub <-- subkey + # fpr <-- fingerprint for previous line + # ... possibly many sub/fpr pairs while (my $line = shift(@{$fps})) { if ($line =~ /^pub/) { - my ($pub, $comptrust, $size, $type, $longid, $date, undef, - undef, $settrust, $owner, undef, undef, $flags, undef) - = split(/:/, $line); - my ($fpr, undef, undef, undef, undef, undef, undef, undef, undef, - $fingerprint) = split(/:/, shift(@{$fps})); + my $have_uid = 0; + my $have_fpr = 0; + my ($fingerprint, $owner, $size, $type, $longid, $date, $settrust, $flags); + # pubkey line + # pub:-:4096:1:A8B51F5E8032CCE4:1305730074:1590597119::-:::scESC::::::: + (undef, undef, $size, $type, $longid, $date, undef, + undef, $settrust, undef, undef, undef, $flags, undef) = split(/:/, $line); + while (my $next = shift(@{$fps})) { + if (!$have_fpr && $next =~ /^fpr/) { + # fpr:::::::::FB298ABBE1D00A1C8FA4DC1FA8B51F5E8032CCE4: + (undef, undef, undef, undef, undef, undef, undef, undef, undef, + $fingerprint) = split(/:/, $next); + $have_fpr = 1; + next; + } + if (!$have_uid && $next =~ /^uid/) { + (undef, undef, undef, undef, undef, undef, undef, undef, undef, + $owner) = split(/:/, $next); + $have_uid = 1; + last; + } + } if ($type eq '17') { $type = 'DSA'; diff -Nru pius-2.2.3/pius.spec pius-2.2.4/pius.spec --- pius-2.2.3/pius.spec 2017-01-17 01:17:34.000000000 +0000 +++ pius-2.2.4/pius.spec 2017-03-01 01:05:54.000000000 +0000 @@ -1,5 +1,5 @@ %define name pius -%define version 2.2.3 +%define version 2.2.4 %define release 1 Name: %{name}