LeoIannacone/goopg

Debian unstable

Closed this issue · 3 comments

I am unable to get the extension to work in Debian Sid, using either Chrome or Chromium. The log says that 'gpg-agent is not available in this session', but it is running, and is available from other contexts.

Note that Sid is undergoing a transition from gpg1 to gpg2. '/usr/bin/gpg' doesn't currently exist. It appears that goopg explicitly calls gpg2, which is available.

I was able to get the extension to work on Lubuntu 16.04, using Chrome 53.0.2785.116-1 and a throwaway key.

$ dpkg --list | grep gnupg
ii gnupg-agent 2.1.11-7 amd64 GNU privacy guard - cryptographic agent
ii gnupg1 1.4.21-1 amd64 GNU privacy guard - a free PGP replacement ("classic" version)
ii gnupg1-curl 1.4.21-1 amd64 GNU privacy guard - a free PGP replacement (cURL helpers for "classic" version)
ii gnupg1-l10n 1.4.21-1 all GNU privacy guard "classic" - localization files
ii gnupg2 2.1.11-7 amd64 GNU privacy guard - a free PGP replacement (new v2.x)
ii python-gnupg 0.3.8-3 all Python wrapper for the GNU Privacy Guard (Python 2.x)

$ dpkg --list | grep chrom
ii chromium 53.0.2785.113-1 amd64 web browser
ii google-chrome-stable 53.0.2785.116-1 amd64 The web browser from Google
ii goopg-chrome 0.3.1 all GPG for Gmail - Chrome browser plugin
ii goopg-chromium 0.3.1 all GPG for Gmail - Chromium browser plugin
ii libchromaprint1:amd64 1:1.3.2-dmo1 amd64 Audio fingerprint library
ii xserver-xorg-video-openchrome 1:0.3.3+git20160310-1 amd64 X.Org X server -- VIA display driver

log:

2016-09-29 19:05:48,552:INFO:Gmail:getting message 15775dc532f299b6
2016-09-29 19:05:50,019:DEBUG:Gmail:message id 15775dc532f299b6
MIME-Version: 1.0^M
Received: by 10.31.162.1 with HTTP; Thu, 29 Sep 2016 05:12:36 -0700 (PDT)^M
To: Dave Steele dsteele@gmail.com^M
Date: Thu, 29 Sep 2016 08:12:36 -0400^M
Message-ID: CAOHcdNZUOgQyOdt0iZq0xn9P6eQqyP98BYsVtMV2-Yw=uRgGug@mail.gmail.com^M
Subject: test^M
From: David Steele steele@debian.org^M
Content-Type: text/plain; charset=UTF-8^M
^M
test^M

2016-09-29 19:05:50,020:DEBUG:gnupg:sign_file: <_io.BytesIO object at 0x7f63eab33b90>
2016-09-29 19:05:50,020:DEBUG:gnupg:['gpg1', '--status-fd', '2', '--no-tty', '--use-agent', '-sa', '--detach-sign']
2016-09-29 19:05:50,026:DEBUG:gnupg:data copier: <Thread(Thread-15, initial daemon)>, <_io.BytesIO object at 0x7f63eab33b90>, <open file '', mode 'wb' at 0x7f63ec60ded0>
2016-09-29 19:05:50,026:DEBUG:gnupg:sending chunk (115): 'Content-Type: text/plain; charset="utf-8"\r\nMIME-Version: 1.0\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\ntest\r\n'
2016-09-29 19:05:50,027:DEBUG:gnupg:stderr reader: <Thread(Thread-16, initial daemon)>
2016-09-29 19:05:50,027:DEBUG:gnupg:closed output, 115 bytes sent
2016-09-29 19:05:50,028:DEBUG:gnupg:stdout reader: <Thread(Thread-17, initial daemon)>
2016-09-29 19:05:50,035:DEBUG:gnupg:[GNUPG:] USERID_HINT 627EBB290A817A82 David Steele steele@debian.org
2016-09-29 19:05:50,036:DEBUG:gnupg:[GNUPG:] NEED_PASSPHRASE 627EBB290A817A82 8A3171EF366150CE 1 0
2016-09-29 19:05:50,037:DEBUG:gnupg:gpg: gpg-agent is not available in this session
2016-09-29 19:05:50,037:DEBUG:gnupg:gpg: Sorry, no terminal at all requested - can't get input
2016-09-29 19:05:50,037:ERROR:GPGMail:signature Content-Type: text/plain; charset="utf-8"^M
MIME-Version: 1.0^M
Content-Transfer-Encoding: quoted-printable^M
^M
test^M

2016-09-29 19:05:50,038:ERROR:CommandHandler:Invalid signature hash_algo None
Traceback (most recent call last):
File "/usr/share/goopg/commandhandler.py", line 88, in sign
new_message = self.gpgmail.sign(draft)
File "/usr/share/goopg/gpgmail.py", line 171, in sign
micalg = "pgp-{}".format(self._get_digest_algo(signature).lower())
File "/usr/share/goopg/gpgmail.py", line 135, in _get_digest_algo
raise TypeError("Invalid signature hash_algo {}".format(hash_algo))
TypeError: Invalid signature hash_algo None

$ gpg2 --list-secret-keys 8A3171EF366150CE
sec rsa4096/366150CE 2010-08-15 [SC]
uid [ unknown] David Steele steele@debian.org
uid [ unknown] David Steele daves@users.sourceforge.net
uid [ unknown] David Steele dsteele@gmail.com
ssb rsa4096/0D929394 2010-08-15 [E]
ssb rsa4096/0A817A82 2014-08-15 [S] [expires: 2019-08-14]

A new gnupg and gpg-agent loaded yesterday, and the extension now works.

Cool! can you paste here the exact version and the debian changelog entry just for the records?

gnupg 2.1.15-3
gnupg-agent 2.1.15-3

gnupg2 (2.1.15-3) unstable; urgency=medium

  • Use upstream fix to avoid touching homedir during test suite

  • backward compatibility for preset-passphrase and protect-tool

  • add Breaks: for python3-apt too (thanks, Harald Jenny!)

  • Avoid network access during tests (Closes: #836259)

  • more patches from upstream

    • gpgv --output now works
    • fingerprint display doesn't vary with --keyid-format
    • minor cleanup to scdaemon dealing with removed cards

    -- Daniel Kahn Gillmor dkg@fifthhorseman.net Wed, 14 Sep 2016 17:08:58 -0400

gnupg2 (2.1.15-2) unstable; urgency=medium

  • restore keyid output in gpgv (Closes: #836144)

  • avoid test suite failures when HOME does not exist

    -- Daniel Kahn Gillmor dkg@fifthhorseman.net Wed, 31 Aug 2016 12:37:48 -0400

gnupg2 (2.1.15-1) unstable; urgency=medium

  • new upstream release

    • blocks signals during keyring updates (Closes: #293556)
  • avoid libusb on hurd. Thanks, Pino Toscano! (Closes: #834533)

  • permissions on test suite are already fixed

  • drop patches applied upstream and refresh remaining patches

  • make gnupg2 reproducible by not regenerating documentation date

  • make autopkgtest work with modern wine (Closes: #835976)

  • wrap-and-sort -ast for cleaner diffs

  • add versioned Breaks: for affected packages (Closes: #835349)

    • gpgv Breaks: python-debian << 0.1.29 (addresses: #782904)
    • gnupg Breaks: php-crypt-gpg <= 1.4.1-1 (addresses #835592)
    • gnupg Breaks: python-apt <= 1.1.0~beta4 (addresses: #835465)
    • gnupg Breaks: python-gnupg << 0.3.8-3 (addresses: #834514, #834600)
    • gnupg Breaks: libgnupg-interface-perl << 0.52-3 (addresses: #834281)
    • gnupg Breaks: libmail-gnupg-perl <= 0.22-1 (addresses: #835075)
    • gnupg Breaks: libgnupg-perl << 0.19-1 (addresses: #834522)

    -- Daniel Kahn Gillmor dkg@fifthhorseman.net Tue, 30 Aug 2016 13:19:23 -0400

See also https://debian-administration.org/users/dkg/weblog/116