-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updates to PIV PUK documentation to reflect new behavior in firmware 5.7 #133
Changes from all commits
21f2134
b0cda9b
34beb77
ad75535
d607889
c399757
35602b9
9ce6982
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -581,7 +581,9 @@ All YubiKeys with the PIV application. | |
Which reference data element to change (PIN or PUK), the current reference value, and | ||
the new value. | ||
|
||
Both the PIN and PUK are allowed to be 6 to 8 characters. | ||
Both the PIN and the PUK are allowed to be 6 to 8 characters. The PIN can be composed of any ASCII character, but PUK composition depends on the key's firmware. For YubiKeys with firmware versions prior to 5.7, the PUK is allowed to be any character in the `0x00` - | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment as above. |
||
`0xFF` range. For YubiKeys with firmware version 5.7 and above, the PUK is allowed to be any character in the `0x00` - | ||
`0x7F` range. | ||
|
||
### Output | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,11 +32,17 @@ is a 6- to 8-byte value, each of the bytes an ASCII number ('0' to '9', which in | |
(upper- and lower-case), and even non-alphanumeric characters such as !, %, or # (among | ||
others). | ||
|
||
The PUK is used to unblock the PIN (see the section below on Blocking). The standard | ||
specifies that it is to be an 8-byte value, each of the bytes any binary value (`0x00` - | ||
`0xFF`). If your application uses the keyboard to insert the PUK, you might limit the user | ||
to ASCII characters, but the YubiKey will accept any byte value in the PUK. In addition, | ||
the YubiKey will allow the PUK to be 6, 7, or 8 bytes long. | ||
The PUK is used to unblock the PIN (see the section below on [blocking](#blocking)). The standard | ||
specifies that the PUK is to be an 8-byte value, with each of the bytes any binary value from `0x00` to | ||
`0xFF`. The YubiKey, however, will accept a PUK of 6 to 8 characters. For YubiKeys with firmware versions prior to 5.7, the key will accept any value in the `0x00` - | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above |
||
`0xFF` range in the PUK. For YubiKeys with firmware version 5.7 and above, the key will only accept values in the `0x00` - | ||
`0x7F` range. Values from `0x80` - `0xFF` will be considered invalid by the key, and any attempt to change the PUK to a byte array containing one of these values will fail. | ||
|
||
These restrictions are due to the YubiKey's PUK length requirements: for firmware versions prior to 5.7, the YubiKey simply requires a PUK length of 6-8 bytes, but for firmware version 5.7 and above, that requirement has changed to 6-8 *Unicode code points* in length. This is an important change because the byte representation (UTF-8 encoding) of a single code point can be 1-4 bytes in length, which means that a 6-byte PUK may be less than 6 code points. In order to accommodate keys of varying firmware versions, the SDK maintains a 6-8 byte length requirement when calling [PivSession.TryChangePuk](xref:Yubico.YubiKey.Piv.PivSession.TryChangePuk) or [Piv.Commands.ChangeReferenceDataCommand](xref:Yubico.YubiKey.Piv.Commands.ChangeReferenceDataCommand). However, keys with firmware 5.7 and above will only accept values that represent single-byte code points, hence the restricted range of `0x00` - `0x7F` (the range of `0x80` - `0xFF` represents code points of two bytes in length). For additional information on Unicode, UTF-8, and the SDK, see the [FIDO2 documentation](xref:TheFido2Pin). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above |
||
|
||
> [!NOTE] | ||
> If your application uses the keyboard to insert the PUK, you might limit the user | ||
to ASCII characters, regardless of a key's firmware version. | ||
|
||
The management key is used to authenticate the entity allowed to perform many YubiKey | ||
management operations, such as generating a key pair. On YubiKeys before version 5.4.2, it | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@equijano21 the PUK has to be 8 characters and 8 characters only. The PIN can be 6-8 characters and will be padded if less than 8.