Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split-GPG is incompatible with Tor Birdy #1024

Closed
andrewdavidwong opened this issue Jun 4, 2015 · 46 comments
Closed

Split-GPG is incompatible with Tor Birdy #1024

andrewdavidwong opened this issue Jun 4, 2015 · 46 comments

Comments

@andrewdavidwong
Copy link
Member

@andrewdavidwong andrewdavidwong commented Jun 4, 2015

Attempting to use Split-GPG and Tor Birdy at the same time results in no GPG notifications in Thunderbird at all when viewing signed or encrypted messages.

@marmarek marmarek added this to the Far in the future milestone Oct 9, 2015
@mfc
Copy link
Member

@mfc mfc commented Feb 19, 2016

@marmarek
Copy link
Member

@marmarek marmarek commented Feb 29, 2016

Since there is no much interest from Tor developers, maybe we can simply ignore --keyserver-options in qubes-gpg-client-wrapper? This might have some negative impact if GPG VM is not really offline, but that would be misuse of gpg-split anyway.

cc @adrelanos

marmarek added a commit to marmarek/qubes-app-linux-split-gpg that referenced this issue Feb 29, 2016
This option is forcefully set by Torbirdy extension and it is cumbersome
to get rid of it. So to make gpg-split compatible with Torbirdy, simply
ignore the option. See linked ticket for more details.

Fixes QubesOS/qubes-issues#1024
@adrelanos
Copy link
Member

@adrelanos adrelanos commented Feb 29, 2016

Marek Marczykowski-Górecki:

Since there is no much interest from Tor developers, maybe we can simply ignore --keyserver-options in qubes-gpg-client-wrapper?

That would be good enough as workaround given current resources, I suppose.

[ The clean solution would be to run the keyserver fetches in the mail
VM since that is supposed to be online. And the
encrypt/decrypt/sign/verify inside the gpg VM. All automagically. So it
does not matter how other applications handle it. ]

@marmarek
Copy link
Member

@marmarek marmarek commented Feb 29, 2016

Can you look at linked patch, with your bash-expert hat on?

@adrelanos
Copy link
Member

@adrelanos adrelanos commented Feb 29, 2016

@adrelanos
Copy link
Member

@adrelanos adrelanos commented Feb 29, 2016

The problem with args= is, that it can mess up quotes, double quotes and what not. The following has a problem but would be more canonical.

#!/bin/bash

while true; do
    case $1 in
        --keyserver-options)       # Takes an option argument, ensuring it has been specified.
            if [ -n "$2" ]; then
                shift
            else
                shift 2
            fi
            ;;
        *)               # Default case: If no more options then break out of the loop.
            break
    esac

    shift
done

# Rest of the program here.
# If there are input files (for example) that follow the options, they
# will remain in the "$@" positional parameters.

exec qubes-gpg-client "$@"

The problem is, that is only filters out --keyserver-options if it is the first command line parameter. Not if it is somewhere in the middle of the parameters.

@adrelanos
Copy link
Member

@adrelanos adrelanos commented Feb 29, 2016

From http://wiki.bash-hackers.org/scripting/posparams please see chapter Filter unwanted options with a wrapper script seems better.

@adrelanos
Copy link
Member

@adrelanos adrelanos commented Feb 29, 2016

Based on above, the following is similar to what you came up originally. Pseudo code.

#!/bin/bash

options=()  # the buffer array for the parameters
eoo=0       # end of options reached

while [[ $1 ]]
do
    if ! ((eoo)); then
    case "$1" in
          --keyserver-options)
            shift 2
            ;;
      -[^-]*a*|-a?*)
          options+=("${1//a}")
          shift
          ;;
      --)
          eoo=1
          options+=("$1")
          shift
          ;;
      *)
          options+=("$1")
          shift
          ;;
    esac
    else
    options+=("$1")

    # Another (worse) way of doing the same thing:
    # options=("${options[@]}" "$1")
    shift
    fi
done

exec qubes-gpg-client "${options[@]}"

Can you make head or tail of it? Otherwise I could also a pull request. Obviously useful to run the test suite over it to see if this does not break something but I guess it should work.

@marmarek
Copy link
Member

@marmarek marmarek commented Feb 29, 2016

Can you make head or tail of it?

Yes, thanks. Will improve the current patch.

Obviously useful to run the test suite over it

That's one reason why I've finally implemented #1368 - in the current shape it pass also on whonix-ws based AppVM. It's doing simple send + receive email.

marmarek added a commit to marmarek/qubes-app-linux-split-gpg that referenced this issue Feb 29, 2016
This option is forcefully set by Torbirdy extension and it is cumbersome
to get rid of it. So to make gpg-split compatible with Torbirdy, simply
ignore the option. See linked ticket for more details.

Fixes QubesOS/qubes-issues#1024
@marmarek
Copy link
Member

@marmarek marmarek commented Feb 29, 2016

Pushed updated version

@adrelanos
Copy link
Member

@adrelanos adrelanos commented Feb 29, 2016

Looks good.

@marmarek marmarek closed this in #1 Feb 29, 2016
@marmarek
Copy link
Member

@marmarek marmarek commented Feb 29, 2016

Automated announcement from builder-github

The package qubes-gpg-split_2.0.18-1+deb8u1 has been pushed to the r3.0 testing repository for the Debian jessie template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing jessie-testing, then use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@marmarek
Copy link
Member

@marmarek marmarek commented Feb 29, 2016

Automated announcement from builder-github

The package qubes-gpg-split_2.0.18-1+deb7u1 has been pushed to the r3.0 testing repository for the Debian wheezy template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing wheezy-testing, then use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@marmarek
Copy link
Member

@marmarek marmarek commented Feb 29, 2016

Automated announcement from builder-github

The package qubes-gpg-split-2.0.18-1.fc20 has been pushed to the r3.0 testing repository for the Fedora fc20 template.
To test this update, please install it with the following command:

sudo yum update --enablerepo=qubes-vm-r3.0-current-testing

Changes included in this update

@marmarek
Copy link
Member

@marmarek marmarek commented Feb 29, 2016

Automated announcement from builder-github

The package qubes-gpg-split-2.0.18-1.fc21 has been pushed to the r3.0 testing repository for the Fedora fc21 template.
To test this update, please install it with the following command:

sudo yum update --enablerepo=qubes-vm-r3.0-current-testing

Changes included in this update

@marmarek
Copy link
Member

@marmarek marmarek commented Feb 29, 2016

Automated announcement from builder-github

The package qubes-gpg-split-2.0.18-1.fc22 has been pushed to the r3.0 testing repository for the Fedora fc22 template.
To test this update, please install it with the following command:

sudo yum update --enablerepo=qubes-vm-r3.0-current-testing

Changes included in this update

@marmarek
Copy link
Member

@marmarek marmarek commented Mar 13, 2016

Automated announcement from builder-github

The package qubes-gpg-split_2.0.18-1+deb7u1 has been pushed to the r3.1 stable repository for the Debian wheezy template.
To install this update, please use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@andrewdavidwong
Copy link
Member Author

@andrewdavidwong andrewdavidwong commented Mar 13, 2016

Maybe it's just a problem with my key, but it keeps popping up a pinentry box (in the backend domain) to enter a passphrase for the key, even though the key has no passphrase. If I just hit enter, it fails to decrypt messages, claiming that no secret key is available.

@andrewdavidwong
Copy link
Member Author

@andrewdavidwong andrewdavidwong commented Mar 13, 2016

I did some further testing, making sure to use a full key with no passphrase in the backend. The pinentry popup still occurs on encryption/decryption attempts, so I'm pretty certain it's not just a problem with my key. (Verifying signed emails works fine now, though.) I also don't think it's a general GPG bug, since the same thing still does not happen with non-TorBirdy Thunderbird.

@marmarek
Copy link
Member

@marmarek marmarek commented Mar 13, 2016

Automated announcement from builder-github

The package qubes-gpg-split-2.0.18-1.fc20 has been pushed to the r3.0 stable repository for the Fedora fc20 template.
To install this update, please use the standard update command:

sudo yum update

Changes included in this update

@marmarek
Copy link
Member

@marmarek marmarek commented Mar 13, 2016

Automated announcement from builder-github

The package qubes-gpg-split-2.0.18-1.fc21 has been pushed to the r3.0 stable repository for the Fedora fc21 template.
To install this update, please use the standard update command:

sudo yum update

Changes included in this update

@marmarek
Copy link
Member

@marmarek marmarek commented Mar 13, 2016

Automated announcement from builder-github

The package qubes-gpg-split-2.0.18-1.fc22 has been pushed to the r3.0 stable repository for the Fedora fc22 template.
To install this update, please use the standard update command:

sudo yum update

Changes included in this update

@marmarek
Copy link
Member

@marmarek marmarek commented Mar 13, 2016

Automated announcement from builder-github

The package qubes-gpg-split-2.0.18-1.fc23 has been pushed to the r3.0 stable repository for the Fedora fc23 template.
To install this update, please use the standard update command:

sudo yum update

Changes included in this update

@marmarek
Copy link
Member

@marmarek marmarek commented Mar 13, 2016

Automated announcement from builder-github

The package qubes-gpg-split-dom0-2.0.18-1.fc20 has been pushed to the r3.0 stable repository for dom0.
To install this update, please use the standard update command:

sudo qubes-dom0-update

Or update dom0 via Qubes Manager.

Changes included in this update

@marmarek
Copy link
Member

@marmarek marmarek commented Mar 13, 2016

Automated announcement from builder-github

The package qubes-gpg-split_2.0.18-1+deb8u1 has been pushed to the r3.0 stable repository for the Debian jessie template.
To install this update, please use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@marmarek
Copy link
Member

@marmarek marmarek commented Mar 13, 2016

Automated announcement from builder-github

The package qubes-gpg-split_2.0.18-1+deb7u1 has been pushed to the r3.0 stable repository for the Debian wheezy template.
To install this update, please use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@marmarek
Copy link
Member

@marmarek marmarek commented Mar 14, 2016

If the pinentry pops up in the backend domain, this is some different problem. This ticket is the one where the command doesn't even reach backend domain. Please open new one, and check enigmail logs for exact gpg command line.

@marmarek marmarek closed this Mar 14, 2016
@andrewdavidwong
Copy link
Member Author

@andrewdavidwong andrewdavidwong commented Mar 14, 2016

Ah, I figured out the problem. gpg2 keeps secret keys on a separate keyring from gpg. I had removed the passphrase using gpg, but since Split-GPG uses gpg2, I had to do it again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment