<div dir="ltr"><div>Hello,</div><div><br></div><div>I think I'm currently facing the issue described in <a href="https://lists.gnupg.org/pipermail/gnupg-users/2016-September/056771.html">https://lists.gnupg.org/pipermail/gnupg-users/2016-September/056771.html</a> (sorry, couldn't find how to just reply to that thread).</div><div><br></div><div>I'm using GnuPG, gpg and gpg-agent in my Windows Git bash environment (MSYS) (on Windows 10 x64). I like having everything in there for ease of use and portability.<br></div><div><br></div><div>I'd like to know if this is just a known issue/limitation with a known workaround or if it's just not supported?</div><div><br></div><div>Some more background about what I've configured/tried:</div><div><br></div><div><div style="font-size:12.8px">Just starting gpg-agent with gpg-connect-agent/bye doesn't work for me, it always gives the following error:</div><div style="font-size:12.8px"><span style="font-size:12.8px">$ gpg-connect-agent /bye</span><br></div><div style="font-size:12.8px"><div>ERR 67109139 Unknown IPC command <GPG Agent></div><div><br></div><div><span style="font-size:12.8px">I could work around that error using: MSYS_NO_PATHCONV=1 gpg-connect-agent --homedir $GNUPGHOME_WIN /bye</span><br></div></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Where $GNUPGHOME_WIN just contains the Windows style path to my gnupg folder (in my case c:\CloudStation\Configuration\<wbr>SebHome\.gnupg). Effectively like that MSYS doesn't perform path conversions and gpg-connect-agent / gpg-agent seem to receive the correct path.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">In my ~/.gnupg folder I then do find those files:</div><div style="font-size:12.8px">gnupg_spawn_agent_sentinel.<wbr>lock<br></div><div style="font-size:12.8px">S.gpg-agent</div><div style="font-size:12.8px">...</div><div style="font-size:12.8px">S.gpg-agent.ssh</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">And the agent seems to be running:</div><div style="font-size:12.8px"><div>$ gpg-agent</div><div>gpg-agent[14380]: gpg-agent running and available</div></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Unfortunately if I execute ssh-add -L, I get:</div><div style="font-size:12.8px">$ ssh-add -L<br></div><div style="font-size:12.8px">Error connecting to agent: Bad file descriptor</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><span style="font-size:12.8px">Here's the part of my bash profile with comments about things I've tried and that didn't help:</span><br></div><div style="font-size:12.8px"><br></div><blockquote style="font-size:12.8px;margin:0px 0px 0px 40px;border:none;padding:0px"><div># GnuPG home</div><div>export GPG4WIN_HOME=$TOOLS_HOME/<wbr>Gpg4Win_3.0.1</div><div>export GPG_HOME=$GPG4WIN_HOME/GnuPG</div><div>export KLEOPATRA_HOME=$GPG4WIN_HOME/<wbr>Gpg4win</div><div><br></div><div>append_to_path $GPG_HOME</div><div>append_to_path $GPG_HOME/bin</div><div>append_to_path $KLEOPATRA_HOME/bin_64</div><div>append_to_path $KLEOPATRA_HOME/bin</div><div><br></div><div># where it puts its files and looks for its configuration</div><div>export GNUPGHOME=$HOME/.gnupg</div><div><div><br></div><div># path conversion ref: <a href="https://stackoverflow.com/questions/13701218/windows-path-to-posix-path-conversion-in-bash" target="_blank">https://stackoverflow.com/<wbr>questions/13701218/windows-<wbr>path-to-posix-path-conversion-<wbr>in-bash</a></div></div><div>export GNUPGHOME_WIN=$(eval "echo $GNUPGHOME" | sed -e 's/^\///' -e 's/\//\\/g' -e 's/^./\0:/')</div><div><br></div><div># create the home folder otherwise gpg will complain</div><div>mkdir -p `echo $GNUPGHOME`</div><div>alias gpg='gpg.exe'</div><div>alias pgp='gpg'</div><div>alias kleopatra='kleopatra.exe'</div><div><br></div><div># Start the gpg-agent (daemon)<br></div><div># Eliminate path conversion issues for that specific command</div><div># Reference: <a href="https://stackoverflow.com/questions/7250130/how-to-stop-mingw-and-msys-from-mangling-path-names-given-at-the-command-line" target="_blank">https://stackoverflow.com/<wbr>questions/7250130/how-to-stop-<wbr>mingw-and-msys-from-mangling-<wbr>path-names-given-at-the-<wbr>command-line</a></div><div><br></div><div># daemon that will manage the gpg keys and allow to perform ssh auth</div><div>#eval $( MSYS_NO_PATHCONV=1 gpg-agent --daemon --enable-ssh-support --enable-putty-support  --homedir $GNUPGHOME_WIN ) &</div><div><br></div><div># Ref: <a href="https://incenp.org/notes/2015/gnupg-for-ssh-authentication.html" target="_blank">https://incenp.org/notes/2015/<wbr>gnupg-for-ssh-authentication.<wbr>html</a></div><div># Ref: <a href="https://www.gnupg.org/documentation/manuals/gnupg/Invoking-gpg_002dconnect_002dagent.html" target="_blank">https://www.gnupg.org/<wbr>documentation/manuals/gnupg/<wbr>Invoking-gpg_002dconnect_<wbr>002dagent.html</a></div><div>MSYS_NO_PATHCONV=1 gpg-connect-agent --homedir $GNUPGHOME_WIN /bye</div><div><br></div><div># Configure SSH_AUTH_SOCK (so that ssh-add can contact the gpg-agent)</div><div>#export GPG_AGENT_PID=$$</div><div>#export GPG_AUTH_SOCK=$(echo $HOME/.gnupg/S.gpg-agent.ssh)</div><div>#export SSH_AUTH_SOCK=$GPG_AUTH_SOCK</div><div><br></div><div># with Win path (not helping)</div><div>#export GPG_AUTH_SOCK=$(echo $GNUPGHOME_WIN/S.gpg-agent.<wbr>ssh)</div><div>#export SSH_AUTH_SOCK=$GPG_AUTH_SOCK</div><div><br></div><div>#export SSH_ENV="$HOME/.ssh/<wbr>environment"</div></blockquote><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Any help would really be appreciated!</div></div></div>