Skip to content
This repository has been archived by the owner on Feb 28, 2019. It is now read-only.

U2F NFC - APDU protocol assignment lackness #8

Open
jshaKEYPAIR opened this issue Jan 22, 2018 · 0 comments
Open

U2F NFC - APDU protocol assignment lackness #8

jshaKEYPAIR opened this issue Jan 22, 2018 · 0 comments

Comments

@jshaKEYPAIR
Copy link

jshaKEYPAIR commented Jan 22, 2018

During the test with these codes, I had problems

First,
xchgAPDUShort() function in u2f_nfc_util.cpp, line 313~316
if (rlen > (ulong)(blockSize) + 2) { printf("!! ERROR !!, Response Longer than Le (Extended Response to Short APDU Input?) \n"); return SW_ERROR_ANY; }
In any cases, Response may be longer than Le enough.
In that case, it can ask response again.
But it prints error and returns - test fail.

Second,
In the test case, there is a BlockSize change.
xchgAPDUShort() function in u2f_nfc_util.cpp,
I exchange parts of blocksize allocation.
capdu[4] = (blockSize == 256 ? 0 : blockSize);
->
if (sw12 == 0x6100) { capdu[4] = blockSize ; } else { if (blockSize == 256) capdu[4] = (uint8_t)(blockSize == 256 ? 0 : sw12 & 0x000000ff); else capdu[4] = (uint8_t)((blockSize < (sw12 & 0x000000ff)) ? blockSize : sw12 & 0x000000ff); }

So if you get a response other than 9000, it just does not end with a test failure.
In the case of change extended APDU, it similar to the above.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant