Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Can't use gpg build in on vscode terminal. #12

Closed
ghost opened this issue Aug 20, 2018 · 20 comments
Closed

Can't use gpg build in on vscode terminal. #12

ghost opened this issue Aug 20, 2018 · 20 comments

Comments

@ghost
Copy link

ghost commented Aug 20, 2018

Environment

Operation System Desktop Environment Flatpak
Fedora 28 Gnome 3.28.2 0.99.3

Running commit git commit -S -m result on error message

error: gpg failed to sign the data
fatal: failed to write commit object

After testing if gpg running really well with echo "test" | gpg --clearsign result on error message

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

test
gpg: signing failed: No pinentry
gpg: [stdin]: clear-sign failed: No pinentry

Remark

Before update i can use gpg and sign commit really fine. But after getting latest update yesterday there was an error.

@amtlib-dot-dll
Copy link
Collaborator

I've upgraded the base runtime from org.freedesktop.Sdk//1.6 to org.freedesktop.Sdk//18.08, and probably those maintainers removed pinentry from the latest runtime. I'll roll back the recipe.


The reason why they removed pinentry might probably be flatpak/freedesktop-sdk-images#70

@ghost
Copy link
Author

ghost commented Aug 21, 2018

Getting latest update above 30min ago still no luck

sh-4.3$ echo "test" | gpg --clearsign
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

test
gpg: signing failed: Provided object is too short
gpg: [stdin]: clearsign failed: Provided object is too short

@amtlib-dot-dll
Copy link
Collaborator

After some investigation I only discovered that I cannot clearsign due to no available key and I cannot generate my key because Provided object is too short. The gpg command and the gpg2 command inside the sandbox both have the version 2.1.14-unknown so they are the same executable. The recipe used to build the current build is similar to the one without problem ca56e42...master. I'm not familiar with GnuPG and if you have any new discoveries please tell me thanks.

@ghost
Copy link
Author

ghost commented Aug 21, 2018

No after googling everything out no luck... Don't really know what is the root cause.

@amtlib-dot-dll
Copy link
Collaborator

I made a new commit ebf87fe to exactly match the working revision ca56e42, and please give us feedback whether it runs or not @vibolvireak Thanks!

@ghost
Copy link
Author

ghost commented Aug 21, 2018

@amtlib-dot-dll still the same result..

@amtlib-dot-dll
Copy link
Collaborator

@vibolvireak Thus, may you generate a clear new ~/.gnupg directory and repeat the test? If the problem still exists, the base runtime may be to blame.

@ghost
Copy link
Author

ghost commented Aug 22, 2018

event do everything event you try generate a new one

@amtlib-dot-dll
Copy link
Collaborator

flatpak/freedesktop-sdk-images#114 This may probably help 🤷‍♂️

@ghost
Copy link
Author

ghost commented Aug 23, 2018

@amtlib-dot-dll After got today update from freedesktop flatpak. I got it working but at lease try to gen key first and everything will work normally event i use the old key. Hope this help if everything experience my issue.

@amtlib-dot-dll
Copy link
Collaborator

Still I want to upgrade the base runtime to use a newer version of toolchains (GCC 8, GDB 8, Clang 6 and Python 3.7) but pinentry is missing there. I am wondering whether I should embed it inside the recipe or wait for some news from the runtime developers. BTW, congratulations for the solved problem

@amtlib-dot-dll
Copy link
Collaborator

@vibolvireak According to your understanding, is it possible for the git client inside the sandbox to use the GPG Agent outside in the host system? Thanks

@ghost
Copy link
Author

ghost commented Aug 24, 2018

@amtlib-dot-dll I'm sorry if i maybe wrong but.. i think the problem is i resize the terminal in vscode really small so when start using gpg will alert

error: gpg failed to sign the data
fatal: failed to write commit object

if i use the default height size or increase the high size of the terminal will successfully use gpg below is the explaination via screenshot

screenshot from 2018-08-24 12-06-36
screenshot from 2018-08-24 12-07-21

Remark
I think if the terminal height is too short it can't fit the password box.

@amtlib-dot-dll
Copy link
Collaborator

@vibolvireak

  1. Do you have this problem before this issue? That is, can you correctly type in your password one week ago?
  2. Do you have a running gpg-agent outside in your host system?

@ghost
Copy link
Author

ghost commented Aug 26, 2018

@amtlib-dot-dll Before i never experience the problem
I don't really sure that the problem is cause with the size of the terminal or not but .. before just working really fine as i remember event i try to resize the terminal.
Question 2 i don't really sure if have gpg-agent outside my system or not.

@amtlib-dot-dll
Copy link
Collaborator

That's weird. Well I think that embedding it inside this package is a good option

@amtlib-dot-dll
Copy link
Collaborator

@vibolvireak I'd like to upgrade the base runtime again; are you still using pinentry now?

@ghost
Copy link
Author

ghost commented Dec 22, 2018

@amtlib-dot-dll everything work as expect event upgrade to the new runtime... But everytime i wan to use gpg i need to type "export GPG_TTY=$(tty)" every time do you have any workround ?

@amtlib-dot-dll
Copy link
Collaborator

@vibolvireak I don't understand your English. Can you write your question in your native language? Thence I can use Google Translate to help me.

@ghost
Copy link
Author

ghost commented Dec 27, 2018

@amtlib-dot-dll Yes everything working fine.. You can close this issue!

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

No branches or pull requests

1 participant