Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smartcard timeout with high latency networks (>60ms) #234

Closed
trentasis opened this issue Jan 23, 2018 · 16 comments
Closed

Smartcard timeout with high latency networks (>60ms) #234

trentasis opened this issue Jan 23, 2018 · 16 comments

Comments

@trentasis
Copy link

trentasis commented Jan 23, 2018

Hi,

I have detected that if you use -r scard with a remote environment (for example with ADSL that reports a 60ms latency)

Error reported in debug mode is:

Protocol(debug): rdpdr_send_completion()
Protocol(debug): channel_send(), length = 100
Protocol(debug): channel_send(), sending 100 bytes with FLAG_FIRST set
Protocol(debug): rdpdr_process()
SmartCard(debug): TS_SCardGetStatusChange(), context: 0x00000010 [0x11afd155], timeout: 0x000003e8, count: 1
SmartCard(debug): TS_SCardGetStatusChange(), reader='Cherry KC 1000 SC [KC 1000 SC] 00 00', user=(nil), state=6012200060122, event=0x00313520
Protocol(debug): rdpdr_process()
SmartCard(debug): TS_SCardGetStatusChange(), context: 0x0000000e [0x3eb51666], timeout: 0x0000ea60, count: 1
SmartCard(debug): TS_SCardGetStatusChange(), reader='\?PnP?\Notification', user=(nil), state=100000000, event=0x00000000
SmartCard(debug): TS_SCardGetStatusChange(), success
SmartCard(debug): TS_SCardGetStatusChange(), reader='\?PnP?\Notification', user=(nil), state=100000000, event=0x00000000
Protocol(debug): rdpdr_send_completion()
Protocol(debug): channel_send(), length = 100
Protocol(debug): channel_send(), sending 100 bytes with FLAG_FIRST set
Protocol(debug): rdpdr_process()
SmartCard(debug): TS_SCardGetStatusChange(), context: 0x0000000e [0x3eb51666], timeout: 0x0000ea60, count: 1
SmartCard(debug): TS_SCardGetStatusChange(), reader='\?PnP?\Notification', user=(nil), state=100000000, event=0x00000000
SmartCard(debug): TS_SCardGetStatusChange(), success
SmartCard(debug): TS_SCardGetStatusChange(), reader='\?PnP?\Notification', user=(nil), state=100000000, event=0x00000000
Protocol(debug): rdpdr_send_completion()
Protocol(debug): channel_send(), length = 100
Protocol(debug): channel_send(), sending 100 bytes with FLAG_FIRST set
Protocol(debug): rdpdr_process()

Same rdesktop command using from local network issue is not reproduced (<1ms), tried with windows 2003 and also with windows 2012r2, with windwos 2003 you can work, but seems that with widnows 2012r2 is not working and you can't work with smartcards
Tried with multiple smartcard reader and multiple smartcards, always error is reported and impossible to work with windows 2012r2

I have tried to search timeout parameter in rdesktop code to find the issue, but my knowledge with smartcards is low...

Anybody can help?

Tested with latest master branch version

Thanks

@trentasis
Copy link
Author

trentasis commented Jan 23, 2018

It could be this https://msdn.microsoft.com/en-us/library/cc229803.aspx ?

dwTimeout | 0x0000EA60 | 60000

where is defined this valued? can be increased?

Thanks

@trentasis
Copy link
Author

Hi,

Anybody can give some information where I can find more ifnormation about this issue, can be modified this timeout? If it is possible where and that issued can generate?
With old versions rdesktop this issue was not reproduced but I don't know where is the issue...
Anybody can help?

Thanks

@uglym8
Copy link
Member

uglym8 commented Jan 29, 2018

@trentasis,
I'll check it within a week.

With old versions rdesktop this issue was not reproduced but I don't know where is the issue...

Meanwhile, could you specify (if you can remember) which rdesktop version does not show such an error?

@trentasis
Copy link
Author

NOT sure but seems that errors appears connecting with windows 2003 and 2012, but smargcard works with 2003, but same version to 2012 with high latency is not working

Thanks

@trentasis
Copy link
Author

Hi,

Any news about this issue?
Thanks

@uglym8
Copy link
Member

uglym8 commented Mar 11, 2018

@trentasis, sorry for the delay, was settling at the new place.
I'll check it though I can't estimate the time.

@trentasis
Copy link
Author

Ok, thanks for your information

@trentasis
Copy link
Author

If I can do any action, I can help
Thanks

@uglym8
Copy link
Member

uglym8 commented Apr 18, 2018

What application do you use to work with smartcards?
What errors are you getting?

@trentasis
Copy link
Author

trentasis commented Apr 18, 2018

Is a owned code, and used with safesign drivers
And errors are related with timeout like
Protocol(debug): rdpdr_send_completion()
Protocol(debug): channel_send(), length = 100
Protocol(debug): channel_send(), sending 100 bytes with FLAG_FIRST set
Protocol(debug): rdpdr_process()
SmartCard(debug): TS_SCardGetStatusChange(), context: 0x00000010 [0x11afd155], timeout: 0x000003e8, count: 1
SmartCard(debug): TS_SCardGetStatusChange(), reader='Cherry KC 1000 SC [KC 1000 SC] 00 00', user=(nil), state=6012200060122, event=0x00313520
Protocol(debug): rdpdr_process()
SmartCard(debug): TS_SCardGetStatusChange(), context: 0x0000000e [0x3eb51666], timeout: 0x0000ea60, count: 1
SmartCard(debug): TS_SCardGetStatusChange(), reader='?PnP?\Notification', user=(nil), state=100000000, event=0x00000000
SmartCard(debug): TS_SCardGetStatusChange(), success
SmartCard(debug): TS_SCardGetStatusChange(), reader='?PnP?\Notification', user=(nil), state=100000000, event=0x00000000
Protocol(debug): rdpdr_send_completion()
Protocol(debug): channel_send(), length = 100
Protocol(debug): channel_send(), sending 100 bytes with FLAG_FIRST set
Protocol(debug): rdpdr_process()
SmartCard(debug): TS_SCardGetStatusChange(), context: 0x0000000e [0x3eb51666], timeout: 0x0000ea60, count: 1
SmartCard(debug): TS_SCardGetStatusChange(), reader='?PnP?\Notification', user=(nil), state=100000000, event=0x00000000
SmartCard(debug): TS_SCardGetStatusChange(), success
SmartCard(debug): TS_SCardGetStatusChange(), reader='?PnP?\Notification', user=(nil), state=100000000, event=0x00000000
Protocol(debug): rdpdr_send_completion()
Protocol(debug): channel_send(), length = 100
Protocol(debug): channel_send(), sending 100 bytes with FLAG_FIRST set
Protocol(debug): rdpdr_process()

Same config used in local network at 1ms works but with high latencies no

@uglym8
Copy link
Member

uglym8 commented Apr 19, 2018

Could you please check the branch with smartcard fixes from #257 (https://github.com/uglym8/rdesktop/tree/sc_drop_refs)?

I could reproduce the issue with hanging proprietary application when the latency is 60 ms and using the above branches fixes this issue.
Though it hangs only with particular reader and not with others.

If it doesn't help we'll dig deeper:)

TIA.
Best regards.

@trentasis
Copy link
Author

Perfect!
I have checked that there are multiple issues related with smartcard that are requirjng tests, It is possible to merge this pr to abranch or master to tests all changes
Issues are related with
#234
#257
#73
#258
This can help to test all changes with one phase of tests, is this possible?
It seems that some of them are tested and validated and I like to test all smartcard with all pr applied to master branch
Thanks

@uglym8
Copy link
Member

uglym8 commented Apr 27, 2018

Hi!
#73 still waits for approval by other members of the team.
It doesn't relate in any way to the issue you're experiencing as it manifests it self only under very specific conditions (e.g. the response from the card should be bigger than 1600 bytes).

I'll merge #258 today as I've haven't seen formal objections so far, got confirmation that it works (#257) and the changes are easily revertible in a case of any issues.

@uglym8
Copy link
Member

uglym8 commented Apr 27, 2018

Merged #258.
You can test now using master branch.

@trentasis
Copy link
Author

Great job!
We will test and reports the results.
Thanks

@trentasis
Copy link
Author

Thanks

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

No branches or pull requests

2 participants