funtoo / keychain

keychain ssh-agent front-end
http://www.funtoo.org
GNU General Public License v2.0
750 stars 105 forks source link

keychain does not add GPG subkey for decrypting V2 #62

Open n3ph opened 8 years ago

n3ph commented 8 years ago

Like already described here i got still problems by using subkeys with gpg-agent in keychain up to 2.8.2..

Just got it to work by this stupid workaround:

diff --git a/usr/bin/keychain b/usr/bin/keychain-modified
index 5f0bf9d..3b8b1f8 100755
--- a/usr/bin/keychain
+++ b/usr/bin/keychain-modified
@@ -981,7 +981,11 @@ gpg_listmissing() {
        for glm_k in "$@"; do
                # Check if this key is known to the agent.      Don't know another way...
                if echo | env -i GPG_TTY="$GPG_TTY" PATH="$PATH" GPG_AGENT_INFO="$GPG_AGENT_INFO" \
-                               gpg --no-options --use-agent --no-tty --sign --local-user "$glm_k" -o- >/dev/null 2>&1; then
+                               gpg --no-options --use-agent --no-tty --sign --local-user "$glm_k" -o- >/dev/null 2>&1 && \
+                               echo > /tmp/test && gpg --use-agent --quiet --batch --encrypt -r "$glm_k" /tmp/test && \
+                               gpg --use-agent --quiet --batch --decrypt /tmp/test.gpg; then
+                       rm -f /tmp/test && rm -f /tmp/test.gpg
+
                        # already know about this key
                        mesg "Known gpg key: ${CYANN}${glm_k}${OFF}"
                        continue
danielrobbins commented 7 years ago

This issue has been imported into the Funtoo Linux bug tracker. This helps us to ensure that your bug is prioritized and gets the attention it deserves. You are welcome to create a Funtoo account and participate in the Funtoo Linux workflow or follow-up in the GitHub issue (comments are not currently synchronized.) Follow the action here: https://bugs.funtoo.org/browse/FL-3408

Konfekt commented 4 years ago

If problems getting gpg-agent to work with keychain persist, then sshstart could be a viable alternative.