google / u2f-ref-code

U2F reference implementations
BSD 3-Clause "New" or "Revised" License
588 stars 182 forks source link

Fix coding of LE in Case 2E in xchgAPDUExtended #180

Closed fmeum closed 5 years ago

fmeum commented 5 years ago

Commit 1497409136ca77648c157723d2efc512a88cc395 fixed the coding of LC if LC==0, but wrongly encodes the LE field: In the case 2E (LC == 0, LE > 0), the LE value has to be coded on 3 bytes with a leading zero byte. This commit resolves this issue.