Closed joemiller closed 4 years ago
Thanks for pointing that out :) I actually never intended those to map to their spec values. They're just enum-ish fields that get mapped to byte values on the internals (that's why they're an int instead of a byte, for example). It's just coincidence that they're close to their real values and that PINPolicy matches.
Feel free to send a PR to switch the order if you'd like.
@ericchiang ok, I may do so when I find a few moments. I noticed this while parsing attestation certs and observing the incorrect value in the parsed Attestation
TouchPolicy field
The PIV spec says this about the TouchPolicy stored as byte 2 in the KeyPolicy OID:
in
key.go
the const's are out of order:👆 Cached (2) and Always (3) are reversed. Should be Always=2 and Cached=3
The other spots where touchpolicy parsing/mapping is implemented have the correct values: