I can't import public keys from an asc-file even if it's a file I just exported from Enigmail myself, no matter if it's my own key or someone else's. I always get an error like this (translating from German):
"Error - The first OpenPGP-Block is not a public key block"
I don't understand this, because the file contains nothing but a public key block. Importing keys from the servers works just fine though. What am I doing wrong?
I use Windows 10. Thunderbird is at version 45.1.1 and Enigmail's version is 1.9.3 (20160603-1417). Enigmail uses GnuPG v2.
Cheers
Alex
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
That's strange. Even if this looks alright from the outside, gpg tells me "invalid armor header". This means that the content is somehow broken, and gpg will not be able to import the file.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Alexander, if you won't mind, could you please send the keyfile you cannot import to patrick at enigmail dot net and ludwig at enigmail dot net? Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ok, I downloaded it and I will try it out this week-end. The week is kinda busy and I don't want to risk changing anything in my Thunderbird until I know I have more time on my hands. As a fellow programmer I already experienced that quite a lot of virtually impossible things can go wrong when giving someone a non-Release version of my code (something that happens in release-versions, too, but not quite as often). I will get back to you. :-)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello, sorry for the huge delay. I installed it and the problem is still there. I now have Enigmail 2.0a1pre, but I don't know how to find out the exact build number from back then. I then proceeded to install the latest build (build date: 2016-07-31, version: 2.0a1pre, git rev: dcfc1377964964c9ce2397c8b01d937307930060), but the problem still persists.
Uninstalling and reinstalling Enigmail didn't help, either.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Apparently the option was already active. I did another test and attached the logfile. Everything that has a timestamp from 19:24 or earlier should be irrelevant.
I think the problem lies in GnuPG. Alexander, you are using GnuPG 2.0.27 (gpg4win 2.2.7). It looks like that version of gpg sends the output of --list-packets to stderr instead of stdout. With GnuPG 2.0.30 (gpg4win 2.3.2), the output goes to stdout, which is what I would expect.
--> can you please try upgrading to gpg4win 2.3.2 (www.gpg4win.org) and retry?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Unfortunately the error is still the same. I uninstalled the old version, rebooted and installed 2.3.2.
Then I tried to import a public key and when that didn't work I tried to export and then import one, which didn't work either.
I attached another log file.
Looking at the debug log file, I'm pretty sure that your gpg.conf file
contains options (e.g. list-packets) that shouldn't be there and that
disturb Enigmail. I'm almost certain that this is the reason for the error.
If you paste your gpg.conf file, I can tell you which option(s) to remove.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello everyone,
I can't import public keys from an asc-file even if it's a file I just exported from Enigmail myself, no matter if it's my own key or someone else's. I always get an error like this (translating from German):
"Error - The first OpenPGP-Block is not a public key block"
I don't understand this, because the file contains nothing but a public key block. Importing keys from the servers works just fine though. What am I doing wrong?
I use Windows 10. Thunderbird is at version 45.1.1 and Enigmail's version is 1.9.3 (20160603-1417). Enigmail uses GnuPG v2.
Cheers
Alex
You can view the file with a text editor, such as Notepad. What is the content of the first few lines?
It looks like this:
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2
mQINBFUazqQBEACu/0Km6ixL2D+z27hhFfsP63wfq2w0EzZWEdqI5d01fc/hmq1Q
VCa1yTEVpkaazlQl0h3TeV9Doi+l0+84cEPz0Km7yircKMAlFiiV0MneGoe4y3/5
9/D3YzdIKYpLNV6caEbS3g54GnMp0c1MA1U6wuE85mnMLR4y1a7zo8J1cRi6mNCj
That's strange. Even if this looks alright from the outside, gpg tells me "invalid armor header". This means that the content is somehow broken, and gpg will not be able to import the file.
Alexander, if you won't mind, could you please send the keyfile you cannot import to patrick at enigmail dot net and ludwig at enigmail dot net? Thanks!
Sure, I'm sending you my public key file, thanks for the help! I'm kinda glad that you're able to reproduce my problem.
Which version of GnuPG do you use precisely? I think our importing algorithm does not interpret all of the output of gpg 2.1.13 correctly.
I use GnuPG 2.0.27 (and I have GPA 0.9.7).
Last edit: alexander 2016-06-26
Can you try the latest nightly build from https://www.enigmail.net/index.php/en/download/nightly-build ? Using that change, I managed to correctly import your key.
Ok, I downloaded it and I will try it out this week-end. The week is kinda busy and I don't want to risk changing anything in my Thunderbird until I know I have more time on my hands. As a fellow programmer I already experienced that quite a lot of virtually impossible things can go wrong when giving someone a non-Release version of my code (something that happens in release-versions, too, but not quite as often). I will get back to you. :-)
Hi Alexander, were you able to test again?
Hello, sorry for the huge delay. I installed it and the problem is still there. I now have Enigmail 2.0a1pre, but I don't know how to find out the exact build number from back then. I then proceeded to install the latest build (build date: 2016-07-31, version: 2.0a1pre, git rev: dcfc1377964964c9ce2397c8b01d937307930060), but the problem still persists.
Uninstalling and reinstalling Enigmail didn't help, either.
Can you please attach a debug log file?
See https://www.enigmail.net/index.php/en/faq?view=category&id=11 - section "Debugging Log File"
Apparently the option was already active. I did another test and attached the logfile. Everything that has a timestamp from 19:24 or earlier should be irrelevant.
Thanks for the log. It can be seen that the keyfile to be imported is examined. Which error message do you get exactly?
See first message - the error is "Error - The first OpenPGP-Block is not a public key block"
Which is weird, as there is clearly a public key block in the output data.
I think the problem lies in GnuPG. Alexander, you are using GnuPG 2.0.27 (gpg4win 2.2.7). It looks like that version of gpg sends the output of --list-packets to stderr instead of stdout. With GnuPG 2.0.30 (gpg4win 2.3.2), the output goes to stdout, which is what I would expect.
--> can you please try upgrading to gpg4win 2.3.2 (www.gpg4win.org) and retry?
Unfortunately the error is still the same. I uninstalled the old version, rebooted and installed 2.3.2.
Then I tried to import a public key and when that didn't work I tried to export and then import one, which didn't work either.
I attached another log file.
Looking at the debug log file, I'm pretty sure that your gpg.conf file
contains options (e.g. list-packets) that shouldn't be there and that
disturb Enigmail. I'm almost certain that this is the reason for the error.
If you paste your gpg.conf file, I can tell you which option(s) to remove.
Where is that file? It's neither in GPG's nor in Thunderbirds installation folder.
Please lookup %appdata% for your version of Windows:
https://de.wikipedia.org/wiki/Umgebungsvariable#Vordefinierte_Umgebungsvariablen_2
then append \gnupg
e.g. C:\Documents and Settings\{your_user_name}\Application Data\gnupg
for Windows XP and
C:\Users\{your_user_name}\AppData\Roaming\gnupg
for Windows Vista/Windows7. Don't know for Windows 8, 8.1 and 10.
Last edit: Patrick Brunschwig 2016-08-04
Windows 8, 8.1 and 10 use C:\Users\{your_user_name}\AppData\Roaming\gnupg
You can simply type %appdata% in the Windows Explorer, and then switch to the "gnupg" directory.
God, does time fly by. Here is the file.
Please delete all lines with "verbose" from the file. They are certainly disturbing.
Wow, it's working now! Thanks for the help! I have no idea why deleting those "verbose" lines helped or where they came from. Do you?