SCardReadCache/SCardWriteCache should actually cache data
authorAlex Wilson <alex@cooperi.net>
Mon, 20 Apr 2020 11:42:02 +0000 (21:42 +1000)
committerakallabeth <akallabeth@users.noreply.github.com>
Tue, 28 Apr 2020 12:03:19 +0000 (14:03 +0200)
commit6e73a9ecf229e4fc3588a4a8d4d541ee0f7e9016
treed25f4144fff86a38090c8273624b6dedabb17503
parent5587bc6fc343fcc86d8e06c38cdb087e1f10a0de
SCardReadCache/SCardWriteCache should actually cache data

Currently since the hash/keyCompare/keyClone members on the
context->cache were never being set, we were using the
HashTable_Pointer* variants, meaning that lookup always
failed (since we never ask for the same *pointer* twice).

This also revealed that the logic for autoallocate on these ops
was a bit backwards, and some error codes and support for the
"freshness" counter were missing.

In Win10 (at least with some card minidrivers) the freshness
counter is load-bearing and smartcard login won't work without
implementing a very basic version of it.
channels/smartcard/client/smartcard_operations.c
channels/smartcard/client/smartcard_pack.c
winpr/libwinpr/smartcard/smartcard_pcsc.c