Yubico / Yubico.NET.SDK

A YubiKey SDK for .NET developers
Apache License 2.0
99 stars 47 forks source link

APDU docs for for generating key pair uses wrong data length #68

Closed WillSmartYubico closed 5 months ago

WillSmartYubico commented 7 months ago

From reading the documentation, I had the idea that the 2nd byte in the data field was always 03 for generating new keys, but it looks like that's not the case.
I'm told it should be the the total number of bytes that come after it in the data field, including any bytes for indicating PIN or touch policy. (Effectively two less than Lc)

https://github.com/Yubico/Yubico.NET.SDK/blob/82a32efd7708ac771625ea922fc621e36e184a17/Yubico.YubiKey/docs/users-manual/application-piv/apdu/generate-pair.md?plain=1#L22

https://github.com/Yubico/Yubico.NET.SDK/blob/82a32efd7708ac771625ea922fc621e36e184a17/Yubico.YubiKey/docs/users-manual/application-piv/apdu/generate-pair.md?plain=1#L50 should read

  00 47 00 9C 0B AC 09 80 01 11 AA 01 02 AB 01 02
DennisDyallo commented 7 months ago

Hi, @WillSmartYubico ! After verifying the behaviour in code (in another of our SDK's) and conferring with a colleague, we come to the same conclusion.

Thanks for bringing this to our attention. We'll have the docs updated, I can't tell you when exactly as we're sorting out some of our release processes, but as soon as possible. Thanks.