From: Peter P. <no...@gi...> - 2021-01-22 17:59:57
|
Branch: refs/heads/master Home: https://github.com/OpenSC/OpenSC Commit: ce7fa4295896ad71d14fdd00a592217924c2fe6f https://github.com/OpenSC/OpenSC/commit/ce7fa4295896ad71d14fdd00a592217924c2fe6f Author: Peter Popovec <pop...@gm...> Date: 2021-01-22 (Fri, 22 Jan 2021) Changed paths: M src/pkcs15init/pkcs15-lib.c Log Message: ----------- Use fresh data from FCI instead of FCP for sc_pkcs15init_authenticate() Function sc_pkcs15init_update_file(): we will try to select the file, if file can not be selected, the file is created, and select operation is repeated. In both cases, the "selected_file" variable contains the current FCI of the selected file. Then the sc_pkcs15init_authenticate () function is called, but not with "selected_file" variable, but "file" variable where the FCP data is present (from the file creation operation). Difference between FCP and FCI (pkcs15-init -C / MyEID card). 62 17 80 02 00 FF 82 01 01 83 02 50 31 86 03 01 3F FF 85 02 00 00 8A 01 00 6F 17 80 02 00 FF 82 01 01 83 02 50 31 86 03 01 3F FF 85 02 00 00 8A 01 01 Here it is clear that the data from FCP are outdated. The card changed the TAG 0x8a from 0 to 1 ("no information given", "creation state".) We need to respect the authority of the card, FCI is to be used in next code, not FCP. modified: src/pkcs15init/pkcs15-lib.c |