Menu

Public key file import fails even on freshly exported key

alexander
2016-06-23
2016-11-07
1 2 > >> (Page 1 of 2)
  • alexander

    alexander - 2016-06-23

    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

     
  • Patrick Brunschwig

    You can view the file with a text editor, such as Notepad. What is the content of the first few lines?

     
  • alexander

    alexander - 2016-06-25

    It looks like this:

    -----BEGIN PGP PUBLIC KEY BLOCK-----
    Version: GnuPG v2

    mQINBFUazqQBEACu/0Km6ixL2D+z27hhFfsP63wfq2w0EzZWEdqI5d01fc/hmq1Q
    VCa1yTEVpkaazlQl0h3TeV9Doi+l0+84cEPz0Km7yircKMAlFiiV0MneGoe4y3/5
    9/D3YzdIKYpLNV6caEbS3g54GnMp0c1MA1U6wuE85mnMLR4y1a7zo8J1cRi6mNCj

     
  • Patrick Brunschwig

    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.

     
  • Ludwig Hügelschäfer

    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!

     
    • alexander

      alexander - 2016-06-25

      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.

       
  • Patrick Brunschwig

    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.

     
  • alexander

    alexander - 2016-06-26

    I use GnuPG 2.0.27 (and I have GPA 0.9.7).

     

    Last edit: alexander 2016-06-26
  • Patrick Brunschwig

    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.

     
  • alexander

    alexander - 2016-06-28

    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. :-)

     
    • Ludwig Hügelschäfer

      Hi Alexander, were you able to test again?

       
  • alexander

    alexander - 2016-07-31

    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.

     
  • alexander

    alexander - 2016-07-31

    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.

     
    • Ludwig Hügelschäfer

      Thanks for the log. It can be seen that the keyfile to be imported is examined. Which error message do you get exactly?

       
  • Patrick Brunschwig

    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.

     
  • Patrick Brunschwig

    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?

     
  • alexander

    alexander - 2016-08-03

    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.

     
    • Patrick Brunschwig

      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.

       
  • alexander

    alexander - 2016-08-04

    Where is that file? It's neither in GPG's nor in Thunderbirds installation folder.

     
    • Ludwig Hügelschäfer

      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
  • Patrick Brunschwig

    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.

     
  • alexander

    alexander - 2016-08-10

    God, does time fly by. Here is the file.

     
  • Patrick Brunschwig

    Please delete all lines with "verbose" from the file. They are certainly disturbing.

     
  • alexander

    alexander - 2016-08-13

    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?

     
1 2 > >> (Page 1 of 2)

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.