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

failed to import key #268

Closed
junerin opened this issue Feb 10, 2014 · 31 comments
Closed

failed to import key #268

junerin opened this issue Feb 10, 2014 · 31 comments
Labels

Comments

@junerin
Copy link

junerin commented Feb 10, 2014

failed to import keys Error: "Nothing to import". My file was pubring.asc which was created from desktop using gpg4usb
-----BEGIN PGP PUBLIC KEY BLOCK-----

Version: GnuPG v1.4.12 (MingW32)

mQINBFLhDTYBEADYffXSxyWDz9KXULlw7lThVw2Cx6E7HjauCFRS97EeOlgoQXo1

ZtiR2ktl312k/zGK7iaQTwFwCKyy4rJhgiinC3Z727x5BwMdQWv2k72O/59H3X4J

s5F9JfDN0KkMGzPZFp1F36llzq1CzMbzYl9hyCAkfrxtWeSBsp41YXyVUQogEcDj

R9axM2UCsy30G0EBxbt5whv7dtBxJI9I9SjfOOK9WFh/4CbNu6Y4sDH/o7fdP4r/

loQHeuVNB+d1zTyu0H+Jt13Fpni1uhIFj11FiATfdXB19s2QceZmh9jwMm4sEN9X

yMD/IEtpgLh9/f3cSmKVqfoOlLkpQGP8SzoLPEEUkx8s5J4ikVhCgwyuPNDyvAkm

55rfAeiDaL9Urbg2cov7EvnRUTlVW/bbJ6pVP6iEU/9+M572TFPVhkh4XeVgLuZ+

SoQm+bWrsg4+CppGCjmDpGvXrcT9X5R9mxPq8dao5NBiH7dMp2hINaxqZlETeZB8

fWFeTPscYaolR8c190TFuua9EXX6v128/kbt/D7l+eWmGFKiRNNNpm6i88UZdK0+

DWmuC7nJvyCDo+S1h9KQZuSISF41QBHoklHgSSPOp61r3vg/FRt9M5lvhenA7Yx3

82btRYayJEr2PzL5qFYevrGEMd6IEY7HHIGG3N9dkSxlE7s5MiBf3fPM3QARAQAB

tFFWaWN0b3JpYW5vIEEuIEdvbnphbGVzIEpyLiAoU21pbGU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S8+2ncm91u9y9oF

24ClRZbkEcDdNelNQyA3cFwwyl2U+JBQ9R/TwqS/8fM95WV0qHA5DZBhccEEnYE/

rr4jB1MWK3j8HvOm5ClfpmQrZBifm77L/zlb9IiJpkV50PyP382RxZ1OlfZ6xZqj

=Nf66

-----END PGP PUBLIC KEY BLOCK-----

@ashh87
Copy link
Contributor

ashh87 commented Feb 11, 2014

This key has doubled up newline characters - remove the blank lines and the key imports fine.

Could/should we support keys like this? Is this a gpg4usb problem?

Interestingly, Seahorse (GNOME default key manager) doesn't like this key because of the brackets in the user id comment. OpenPGP Keychain decodes the email address and comment correctly :)

@ashh87
Copy link
Contributor

ashh87 commented Feb 11, 2014

actually, seahorse and gpg refuse to import this key without removing the newlines, so we probably should too.

@junerin
Copy link
Author

junerin commented Feb 11, 2014

Hello

It only had dbl spaces upon pasting. Looks perfectly fine when I open the file in notepad

On Tuesday, February 11, 2014 1:16 PM, ashh87 notifications@github.com wrote:

actually, seahorse and gpg refuse to import this key without removing the newlines, so we probably should too.

Reply to this email directly or view it on GitHub.

@ashh87
Copy link
Contributor

ashh87 commented Feb 11, 2014

OK, would you be able to post the original file somewhere so we can download it and take a look please? Are you running the latest version from the Play Store?

Which version of Android are you running and which file manager are you using?

@ashh87
Copy link
Contributor

ashh87 commented Feb 11, 2014

Could you also check the permissions of the file on your device please? It should probably be fine if it has All, Read and Write...

@junerin
Copy link
Author

junerin commented Feb 11, 2014

I am attaching my key here as I could not find a server where I can attach a file. I have the latest version of the app and my OS is Android 4.2.2

Thanks

On Tuesday, February 11, 2014 8:26 PM, ashh87 notifications@github.com wrote:

Could you also check the permissions of the file on your device please? It should probably be fine if it has All, Read and Write...

Reply to this email directly or view it on GitHub.

@dschuermann
Copy link
Member

please send it to my mail address dominik@dominikschuermann.de
Github does not support attachments from mails.
I can then upload it.

@junerin
Copy link
Author

junerin commented Feb 11, 2014

Thanks for the quick reply. I manage to upload my keys here http://pgp.mit.edu/pks/lookup?op=get&search=0xE7B9ED5A95852D96

And I managed to import them using the option from key server. It doesn't work when I try to import from a file. My problem now is how to import my secret key. I have to import this using a file and it doesn't work. I always get "Nothing to import"

Thanks

On Wednesday, February 12, 2014 3:03 AM, Dominik Schürmann notifications@github.com wrote:

please send it to my mail address dominik@dominikschuermann.de
Github does not support attachments from mails.
I can then upload it.

Reply to this email directly or view it on GitHub.

@dschuermann
Copy link
Member

Ah I can guess what was going wrong. Eventually your are not using OI file Manger and instead Android 4.4's file picker.

Have you tried using OI File Manager?

Two take away for us developers:

@dschuermann
Copy link
Member

Hmmm, I made a mistake. Android's 4.4 file picker should also work starting with OpenPGP Keychain 2.3. I myself implemented that for the import functionality.
So I am still not sure what is not working here.

@junerin
Copy link
Author

junerin commented Feb 11, 2014

Hello I sent you an email with attachments. I hope it helps. thanks

On Wednesday, February 12, 2014 3:27 AM, Dominik Schürmann notifications@github.com wrote:

Ah I can guess what was going wrong. Eventually your are not using OI file Manger and instead Android 4.4's file picker.
Have you tried using OI File Manager?
Two take away for us developers:
* Show a error message instead of just silent failing (#237)
* Implement new file backend (https://github.com/openpgp-keychain/openpgp-keychain/wiki/Google-Summer-of-Code#wiki-improvements-to-file-encryptiondecryption)

Reply to this email directly or view it on GitHub.

@junerin
Copy link
Author

junerin commented Feb 11, 2014

Well I salute you anyway for such prompt service. Maybe I just got you at the right time.

On Wednesday, February 12, 2014 3:43 AM, Dominik Schürmann notifications@github.com wrote:

Hmmm, I made a mistake. Android's 4.4 file picker should also work starting with OpenPGP Keychain 2.3. I myself implemented that for the import functionality.
So I am still not sure what is not working here.

Reply to this email directly or view it on GitHub.

@bmos
Copy link

bmos commented Mar 6, 2014

I'm having the same issue with a key exported from gpa (windows version)
I think it's caused by windows having a cartridge return + newline for each line.
http://www.gossamer-threads.com/lists/gnupg/users/55352

@danielhass
Copy link
Contributor

@dschuermann could this be related to the problems I have in #316 ?

@dschuermann
Copy link
Member

@danielhass could be, I am not sure.
@bmos Could you upload this key (the public part) somewhere, that we can test it?

@bmos
Copy link

bmos commented Mar 6, 2014

@dschuermann
Copy link
Member

@bmos Thanks very much.
We will investigate.
Actually, I am currently under heavy workload, so if anyone wants to step in... *looking at @danielhass and @ashh87 * ;)

@danielhass
Copy link
Contributor

I just tested. I can't report any problem while importing your key @bmos. Maybe this issue is fixed in the git-version?

@bmos
Copy link

bmos commented Mar 6, 2014

Must be, that's the exact file I imported.
On Mar 6, 2014 9:02 AM, "Daniel Haß" notifications@github.com wrote:

I just tested. I can't report any problem while importing your key @bmoshttps://github.com/bmos.
Maybe this issue is fixed in the git-version?


Reply to this email directly or view it on GitHubhttps://github.com//issues/268#issuecomment-36890040
.

@danielhass
Copy link
Contributor

@bmos which version of OpenKeychain do you use? 2.3.1 from play store?

@bmos
Copy link

bmos commented Mar 6, 2014

Yes.
On Mar 6, 2014 9:10 AM, "Daniel Haß" notifications@github.com wrote:

@bmos https://github.com/bmos which version of OpenKeychain do you use?
2.3.1 from play store?


Reply to this email directly or view it on GitHubhttps://github.com//issues/268#issuecomment-36890668
.

@dschuermann
Copy link
Member

@bmos If you have some time, could you test the newest beta version?

  1. Join beta tester group on Google+
  2. Visit this special Google Play link
  3. Install the beta version of OpenKeychain (please check the version code in "Help". It must be "2.3.1 beta3")

@danielhass
Copy link
Contributor

Just some update, I was able to reproduce the issue with v2.3.1 - seems to be fixed in git-version

@dschuermann
Copy link
Member

@danielhass nice thanks!

@danielhass
Copy link
Contributor

@dschuermann Sorry!! I was a bit too fast. I had some error with the copying of the key to my phone. Please forget what I said. I tested the import with the uploaded key on the emulator with v2.3.1 and on my real phone (also v2.3.1) on both the key was imported without any problem!
So I'm NOT able to reproduce the mentioned error. (I think we need to reopen this issue)

@dschuermann dschuermann reopened this Mar 6, 2014
@dschuermann
Copy link
Member

np. Maybe it is an issue with how the file has been opened. What are you using to open the file from OpenKeychain @bmos ? OI File Manager?

@bmos
Copy link

bmos commented Mar 6, 2014

@dschuermann I was using Solid Explorer. I was able to import it successfully using Solid Explorer, however, after fixing the line spacing in Notepad++.
It looks like when I save just the public key it doesn't have the double-spaced lines, which is why importing that key works.
I'll generate a test private/public key pair and upload that as an example.

EDIT: Here it is: http://www.mediafire.com/view/7h3b321ba0ckfpq

Using the "backup" function creates extra line breaks.
I supposed that means it's a bug with gpg for windows (or the GPA GUI, although if gpg4usb has the bug, too, it might be a gpg/windows thing)

@junerin
Copy link
Author

junerin commented Mar 9, 2014

You asked about my  file manager and device permissions. my file manager is es file explorer but I don't use that to import the key. I use the app.

About the device permissions, I don't have problems putting files on my device or reading from it.

Thanks again

On , V & E Gonz vag118@yahoo.com wrote:

I am attaching my key here as I could not find a server where I can attach a file. I have the latest version of the app and my OS is Android 4.2.2

Thanks

On Tuesday, February 11, 2014 8:26 PM, ashh87 notifications@github.com wrote:

Could you also check the permissions of the file on your device please? It should probably be fine if it has All, Read and Write...

Reply to this email directly or view it on GitHub.

@ashh87
Copy link
Contributor

ashh87 commented Mar 9, 2014

Hi Junerin,

Thanks for the reply. When I ask about file permissions, I ask because each android app runs as a different Linux user. So whilst you may be able to write a file to disk, the file needs to be readable by all users for any app to access it (or it should be owned by the app user, which varies per device). You should be able to check this using Es file Explorer by selecting the Properties menu item for the file. It would be good if the code let users know about permission errors.

About the method used to pick the key, from within the app, when you press to open a file, it uses an external app to pick the file. This could be the Android default file picker, or Es file Explorer, or something else. If you've got several available, it will ask you to choose which one to use and optionally pick a default.

If you use ES as the file picker, it's probably not the issue, that's what I use and I have no problems with it.

@danielhass
Copy link
Contributor

I can confirm the ES file Explorer case. I am using it too without any problems.

@dschuermann
Copy link
Member

Closing for now. Please use Android 4.4 if possible and OpenKeychain 2.8 beta (http://www.openkeychain.org/contribute/). Then you don't need a file manager, everything is done using file opening methods from Android 4.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants