agent: Request insertion of smartcard when no card present
Open, Needs TriagePublic

Description

(I've since worked out that this is probably only a problem on w32 - Unfortunately I can't test a physical linux system at present, but from the dim dark past I seem to remember it working there)

Currently, if you have the wrong smart card inserted, the agent requests you to insert the right card. It would be nice if it also did this when you don't have a card inserted at all.

Looking at line 111 of agent/divert-scd.c, in my limited knowledge of the code base, it looks like the logic test could be changed from:

if (!rc) {

to:

if (!rc || no_card) {

to achieve this?

The ternary operator on line 117 appears to already have the appropriate prompt ready to go, but the code path will never make it there (rc is only ever set when there is a card inserted, no_card is only set when there isn't a card present - the check above only checks rc)

mjb created this task.Thu, Nov 29, 10:36 AM
mjb updated the task description. (Show Details)Thu, Nov 29, 10:39 AM
mjb added a project: gpgagent.
mjb removed External Link.
mjb added a comment.Fri, Nov 30, 10:20 AM

..... And now after looking into this a bit deeper after attempting to build gpg-agent for windows, it appears that this is a bit deeper than the logic above (which is actually sound, when I read it for the second time)

So perhaps I should re-submit this as a bug? (Something like: "On windows, gpg-agent never asks for a smart card to be inserted when none is present")

mjb updated the task description. (Show Details)Fri, Nov 30, 10:25 AM
mjb updated the task description. (Show Details)