Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Change default timeout or remove it. #76

Open
martinpaljak opened this issue Nov 8, 2018 · 2 comments
Open

Change default timeout or remove it. #76

martinpaljak opened this issue Nov 8, 2018 · 2 comments

Comments

@martinpaljak
Copy link
Member

The timeout of a transceive command is enforced to the default on connect(), irrelevant of the existing timeout (which can be queried with getTimeout()):

https://github.com/fidesmo/nordpol/blob/master/android/src/main/java/nordpol/AndroidCard.java#L63

The default timeout is a pretty arbitrary number. As the documentation (https://developer.android.com/reference/android/nfc/tech/IsoDep#setTimeout(int)) tells, increasing the timeout might be necessary to facilitate longer commands, such as key generation (which, for RSA, can take well over current default of 15 seconds, or even 1 minute, per key)

Changing the (default) timeout should only happen to facilitate a feature or remove a bug. If nordpol is used in a proxy-style application, passing remotely generated APDU-s to a card, the context of the APDU-s is not known (e.g. APDU-s triggering key generation can be encrypted) to facilitate manual changing of the timeout for such single commands. Thus the default timeout set should be "infinity" to support any kind of APDU-s, irrelevant of context.

Thus, some or all of the following should be done:

  • make the default value programmatically configurable (setter)
  • change the default value to "infinity" (or a measurable value of similar practical effect) in nordpol
  • remove setting the default timeout during connect() and let the calling application set a default based on application context
  • document the fact so that nordpol users could set the right default value or a single timeout for a long command.
@monday8am
Copy link

agreed!

@monday8am
Copy link

remove setting the default timeout during connect() and let the calling application set a default based on application context

I was doing tests removing the setTimeOut after connect and it didn't work properly. Seems to be that the defined value should be set always after connect() in order to makes it work.

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

2 participants