Skip to content

Commit

Permalink
Only send NIST RID in APT '79' '4F' tag
Browse files Browse the repository at this point in the history
See discussion on #43
  • Loading branch information
arekinath committed Mar 1, 2021
1 parent cbb6e55 commit ed27e31
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/net/cooperi/pivapplet/PivApplet.java
Original file line number Diff line number Diff line change
Expand Up @@ -874,9 +874,14 @@ else if (key == (byte)0x81)
wtlv.writeTagRealLen((byte)0x4F, (short)PIV_AID.length);
wtlv.write(PIV_AID, (short)0, (short)PIV_AID.length);

/*
* The NIST demo cards only return the first 5 bytes of the AID
* here (the NIST RID). The spec is not especially explicit
* about it, but we'll go with that.
*/
wtlv.push((byte)0x79);
wtlv.writeTagRealLen((byte)0x4F, (short)PIV_AID.length);
wtlv.write(PIV_AID, (short)0, (short)PIV_AID.length);
wtlv.writeTagRealLen((byte)0x4F, (short)5);
wtlv.write(PIV_AID, (short)0, (short)5);
wtlv.pop();

wtlv.writeTagRealLen((byte)0x50, (short)APP_NAME.length);
Expand Down

0 comments on commit ed27e31

Please sign in to comment.