mailvelope / mailvelope

Browser extension for OpenPGP encryption with Webmail
GNU Affero General Public License v3.0
1.7k stars 212 forks source link

Decryption failed: Inappropriate ioctl for device #676

Open NoSubstitute opened 5 years ago

NoSubstitute commented 5 years ago

MacOS 10.14.4 Chrome 73.0.3683.103 Mailvelope 3.1.0

Finally got Mailvelope to recognise the installed gnupg after following all the advice in #651 So I've run the command to include gnupg in path, and restarted the MBP and Chrome. Not running Chrome from Terminal, but as a regular app from Dock, as I am supposed to.

sudo launchctl config system path /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

Key management of the gnupg keys work fine.

Then immediately got a new error when I tried to decrypt.

Error!
Decryption failed: Inappropriate ioctl for device

No other clues.

$ which gpg
/usr/local/bin/gpg
$ which gpgme-json
/usr/local/bin/gpgme-json
$ gpg --version
gpg (GnuPG) 2.2.15
libgcrypt 1.8.4
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Home: /Users/Kim/.gnupg
Algoritmer som stöds:
Publik nyckel: RSA, ELG, DSA, ECDH, ECDSA, EDDSA
Chiffer: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
         CAMELLIA128, CAMELLIA192, CAMELLIA256
Kontrollsumma: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Komprimering: Okomprimerad, ZIP, ZLIB, BZIP2
$ gpgme-json --version
gpgme-json 1.13.0
Copyright (C) 2018 g10 Code GmbH
License LGPL-2.1-or-later <https://gnu.org/licenses/>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ cat ~/Library/Application\ Support/Google/Chrome/NativeMessagingHosts/gpgmejson.json 
{
    "name": "gpgmejson",
    "description": "Integration with GnuPG",
    "path": "/usr/local/bin/gpgme-json",
    "type": "stdio",
    "allowed_origins": [
        "chrome-extension://kajibbejlbohfaggdiogboambcijhkke/"
    ]
}

This is way more complex than it ought to be. :-/

ghost commented 5 years ago

Hi @NoSubstitute, this error message seems to be related to pinentry (the gnupg password dialog) not being able to come up. Did it appear at all?

I don't know much about macOS issues, but that might be just the pointer you need: https://github.com/Homebrew/homebrew-core/issues/14737#issuecomment-309547412

mariusrugan commented 4 years ago

apparently goes away with when using zsh

export GPG_TTY=$(tty)

ogajduse commented 4 years ago

I hit the same issue on Fedora 32. I have Firefox set up and working with opengpg backend, but I can not make it work with chrome on the same system. I configured the opengpg backend properly, but I am not able to encrypt the file while running the chrome from gnome-shell. When I run it from a terminal with GPG_TTY set, pinentry prompts me for the pin in the respective tty and then I am able to encrypt the file. If you have an idea for further investigation, please let me know, I will provide as much feedback as I can.

felixd commented 3 years ago

Hello @ogajduse

FYI, check what @MK-intevation has written in his response. That fixes problem.

easz commented 3 years ago

I still have the problem when I use Mailvelope in Firefox (87.0) and try to encrypt emails (in an email provider web page) My setup follow the instruction here https://github.com/mailvelope/mailvelope/issues/699#issuecomment-572550390 also on macos 10.14.

At the moment the only workaround is to use 'pinentry-mac' as described here https://github.com/Homebrew/homebrew-core/issues/14737#issuecomment-309547412

Any update for this "issue"? if the workaround is recommended, you may put it in the document or FAQ.