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

U2F NFC - APDU protocol assignment lackness #8

@jshaKEYPAIR

Description

@jshaKEYPAIR

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions