Yubikey: PIV.9C restriction in scdaemon
Open, NormalPublic

Assigned To
Authored By
• gniibe
Tue, Sep 8, 4:00 AM

Description

In gnupg/scd/app-piv.c, we have a comment:

/* According to table 4b of SP800-73-4 the signing key always
 * requires a verify.  */

and set force_verify = 1 for 0x9c.

We received a report from a user (gnupg-devel xmpp channel), questioned if this restriction by scdaemon is relevant or not.
Yubikey itself has a feature to control the behavior (pin auth ONCE, touch is required, etc.).
It seems for me that we don't need to restrict this due to the NIST standards. In my opinion, it is up to users to control the behavior of the device.

So, I propose the removal of the restriction for PIV.9C..

BTW, the standard has been updated, and it's now SP800-73-5 (part1, Table 5).
https://csrc.nist.gov/pubs/sp/800/73/pt1/5/final

Revisions and Commits

Event Timeline

We could read the Yubikey configuration to decide what to do. But I have no problems if you lift this force.

• gniibe triaged this task as Normal priority.

This bug is not only for 0x9c key, but it also affects when a user sets PIN policy Always.

Correct behavior of scdaemon for Yubikey is that:

  • PIN Policy should be examined
  • It should set force_verify to 1, when PIN policy is Always _or_ keyref is 0x9c and PIN policy is Default
• gniibe set External Link to https://github.com/Yubico/yubico-piv-tool.Tue, Sep 15, 7:05 AM

Reading yubico-piv-tool, getting the information for per slot PIN/Touch Policy:

  • Issue the APDU: 00 F7 00 <KEYREF-BYTE>
  • Parse the TLV values, searching the tag 02 (YKPIV_METADATA_POLICY_TAG)
  • the first byte is PIN Policy value, and the second byte is Touch Policy value
  • 0 means Default, 1 means never, 2 means once, and 3 means always

Too PIV users:


Please test. I don't have any experience of using PIV.

• gniibe mentioned this in Unknown Object (Maniphest Task).Mon, Sep 21, 3:41 AM