Skip to content

Commit 5a76b44

Browse files
areeseericchiang
authored andcommitted
Update ykLogin comments to reflect the NIST documentation for the command.
1 parent 66ce787 commit 5a76b44

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

piv/piv.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,11 @@ func encodePIN(pin string) ([]byte, error) {
210210
if len(data) > 8 {
211211
return nil, fmt.Errorf("pin longer than 8 bytes")
212212
}
213+
213214
// apply padding
215+
// 2.4 Security Architecture
216+
// 2.4.3 Authentication of an Individual
217+
// https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-73-4.pdf#page=88
214218
for i := len(data); i < 8; i++ {
215219
data = append(data, 0xff)
216220
}
@@ -237,7 +241,10 @@ func ykLogin(tx *scTx, pin string) error {
237241
return err
238242
}
239243

244+
// 3.2 PIV Card Application Card Commands for Authentication
245+
// 3.2.1 VERIFY Card Command
240246
// https://csrc.nist.gov/CSRC/media/Publications/sp/800-73/4/archive/2015-05-29/documents/sp800_73-4_pt2_draft.pdf#page=20
247+
// https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-73-4.pdf#page=86
241248
cmd := apdu{instruction: insVerify, param2: 0x80, data: data}
242249
if _, err := tx.Transmit(cmd); err != nil {
243250
return fmt.Errorf("verify pin: %w", err)

0 commit comments

Comments
 (0)