xca icon indicating copy to clipboard operation
xca copied to clipboard

BUG: When aborting a key generation on a smartcard, the entry remains in the database but is incomplete. This causes an error pop-up during startup

Open ARGYROU-MINAS opened this issue 1 year ago • 1 comments

While generating a new ECC key on a token, during the stage where the device's PIN is asked for, I clicked "Cancel" to abort. After that, the "key" entry appeared on the Private Keys tab and had a length of 0bit. After closing and re-opening the program, the entry with the length of 0bit disappeared but, before the program's main UI appears, I get the following error. After clicking on "OK", the main UI appears.

" The following error occurred: error:**********:asn1 encoding routines::too small "

The asterisks ("*") are there to replace a number, just in case it is private information (I am not sure), even though it is probably the Error Code.

I am also attaching a screen grab:

image

ARGYROU-MINAS avatar Oct 05 '23 23:10 ARGYROU-MINAS

Hello,

I finally managed to spend some time to work on it; and, I believe that I have found a workaround (no guarantees, you take the risk):

I used DB Browser for SQLite (https://sqlitebrowser.org/) to browse the data of the database and made the following changes, which seem to have fixed the issue:

  1. In Table "public_keys", look for the item without a Public Key ("public") and Length ("len"). Make sure to note ID of the Item ("item"). Delete the whole Record of that Item.
  2. In Table "tokens", also find and delete the whole Record with the same "item" ID.
  3. In Table "items", find the Record with "id" the same as "item" from the previous Tables. There is a column called "del". Change the value of "del" for that Record to "1" (DO NOT delete this Record).
  4. Click on "Write Changes" to save.

ARGYROU-MINAS avatar Jan 01 '24 13:01 ARGYROU-MINAS