Skip to content

Conversation

@popovec
Copy link
Member

@popovec popovec commented Jun 8, 2023

This PR implements new card_ctl (SC_CARDCTL_GET_CHANGE_COUNTER) which makes it possible to identify every change on the card. This information allows us to safely use the file cache even if the contents of the card is changed on another computer. In this PR, this operation is implemented for the MyEID driver and the file cache for the MyEID card is turned on by default.

Checklist
  • Documentation is added or updated
  • PKCS#11 module is tested

@popovec
Copy link
Member Author

popovec commented Jun 12, 2023

Ok "size_t" is perfectly sufficient.

popovec added 3 commits June 12, 2023 13:33
…ache.

The card's file cache needs a timestamp so that we know when the cache does
not match the card's content.  The solution used so far is based on
information from EF.Tokeninfo, where the time of the last modification of
the card is recorded.  However, EF.Tokeninfo does not provide sufficient
granularity of the timestamp and is not updated atomically for changes on
the card.  Some of the cards provide an internal "change counter", which is
incremented after each change of the card's content.  If such information is
available, it is used as a timestamp for the name of the card's cached file.

	modified:   src/libopensc/cardctl.h
	modified:   src/libopensc/pkcs15-cache.c
Copy link
Member

@frankmorgner frankmorgner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, thank you

@frankmorgner frankmorgner merged commit df69335 into OpenSC:master Jun 28, 2023
@xhanulik xhanulik mentioned this pull request Jul 3, 2023
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

Successfully merging this pull request may close these issues.

2 participants