You've already forked opencryptoki
mirror of
https://github.com/opencryptoki/opencryptoki.git
synced 2026-10-24 05:39:17 +03:00
During a token reinitialization, to set up a SO PIN or a User PIN again, the operation would fail mentioning that the hash of the old PIN doesn't match the entered old PIN. This happens because during InitToken operation we are resetting the NV data, and with this we are loosing the hash and md5 of the old PIN. To fix this, instead of calling init_token_data on every InitToken, we do a load_token_data, that will check if we have a NV data already created. If yes, it just loads it. If not, it calls init_token_data. Signed-off-by: Eduardo Barretto <ebarretto@linux.vnet.ibm.com>