yubico-piv-tool icon indicating copy to clipboard operation
yubico-piv-tool copied to clipboard

Automatically verify cached pin and retry general auth on sw = 6982

Open qpernil opened this issue 3 years ago • 6 comments

qpernil avatar Dec 02 '21 15:12 qpernil

Different approach to problems with always-auth keys - automatically verify cached pin and retry general-authenticate

qpernil avatar Dec 02 '21 15:12 qpernil

The trouble with this approach is that it is in the library, and hence affects all usage, not just piv-tool

qpernil avatar Dec 02 '21 15:12 qpernil

I like this approach very much, as it returns the decision whether to (re-)authenticate, back to where it belongs - to the token itself.

mouse07410 avatar Dec 02 '21 17:12 mouse07410

I think this is probably the wrong approach after all, even if it happens to be very convenient and slots into the code very smoothly. It would essentially negate the intention with always-auth keys, with no way for the application to choose behaviour.

qpernil avatar Dec 29 '21 13:12 qpernil

It is the right approach of the user wants his app to behave this way. So, using cached PIN or not should be a configurable option.

mouse07410 avatar Dec 29 '21 14:12 mouse07410

I think it is more in line with pkcs#11 that the application chooses what to do, after all there is support in pkcs11 to to it well from the application, either using the flag to preeemptively prompt, or to just automatically re-verify a pin it keeps in memory, or alternatively to base the behaviour on the return codes (and hope that different pkcs11 modules give the 'right' error code)

qpernil avatar Dec 29 '21 14:12 qpernil