<div dir="ltr"><div dir="ltr">On Fri, Mar 24, 2023 at 5:20 AM Werner Koch <<a href="mailto:wk@gnupg.org">wk@gnupg.org</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Wed, 22 Mar 2023 16:16, xeyrion--- said:<br>
<br>
> Forwarding normal socket (instead of extra socket) makes the prompt go<br>
> away. Is there a way to preset passphrase for extra socket as well?<br>
<br>
The caching behavior does not depend on the connection type.  Thus this<br>
should not be an issue.  I assume you are using 2.4.0 which has a couple<br>
of fixes for remote use.<br>
<br>
I am almost always using the extra-socket with cards and thus I unloch<br>
the card before I start working (using "gpg-card" and its "verify"<br>
command).<br>
<br>
I would suggest to add<br>
<br>
  debug ipc,cache<br>
  log-file /foo/somefile<br>
<br>
to your local gpg-agent.conf (or use watchgnupg and "socket://" as file<br>
for live watching) to see what's going on.  You should see some error<br>
message "Forbidden" when the remote site issues certain commands.<br></blockquote><div><br></div><div>Thanks for the debugging tips. I collected more info using those. Caching behavior does indeed seem to depend on connection type based on what I am seeing in the logs:</div><div><br></div><div>Call to gpg-preset-passphrase for <keygrip1>:</div><div><br></div><div>DBG: chan_8 <- PRESET_PASSPHRASE <keygrip1> -1 <long-hex-string><br>DBG: agent_put_cache '<keygrip1>'.0 (mode 1) requested ttl=-1<br>DBG: chan_8 -> OK<br></div><div><br></div><div>Asking to decrypt using normal socket:</div><div><br></div><div>DBG: chan_8 <- PKDECRYPT<br>DBG: chan_8 -> S INQUIRE_MAXLEN 4096<br>DBG: chan_8 -> INQUIRE CIPHERTEXT<br>DBG: chan_8 <- [ 00 00 00 ...(105 byte(s) skipped) ]<br>DBG: chan_8 <- END<br>DBG: agent_get_cache '<keygrip1>'.0 (mode 2) ...<br>DBG: ... hit<br></div><div><br></div><div>Asking to decrypt using extra socket:</div><div><br></div><div>DBG: chan_8 <- PKDECRYPT</div>DBG: chan_8 -> S INQUIRE_MAXLEN 4096<br>DBG: chan_8 -> INQUIRE CIPHERTEXT<br>DBG: chan_8 <- [ 00 00 00 ...(105 byte(s) skipped) ]<br>DBG: chan_8 <- END<br>DBG: agent_get_cache '<keygrip1>'.1 (mode 2) ...<br>DBG: ... miss<br>DBG: agent_get_cache '<keygrip1>'.1 (mode 2) (stored cache key) ...<br>DBG: ... miss<br>starting a new PIN Entry<br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote">The difference seems to be that normal socket uses ".0" as cache key while extra socket uses ".1" and therefore misses?</div><div class="gmail_quote"><br></div><div class="gmail_quote">This is using GnuPG 2.4.0 both on local and remote.</div><div class="gmail_quote"><br></div><div class="gmail_quote">Ideas? Is this a designed behavior? Or do I have something misconfigured?</div><div class="gmail_quote"><br></div><div class="gmail_quote">Thank you.</div><div class="gmail_quote"><br></div></div>