trustcrypto / OnlyKey-Firmware

The OnlyKey Firmware runs on the OnlyKey itself and provides the core functionality of OnlyKey.
https://docs.crp.to/firmware.html
219 stars 41 forks source link

Single color OK restore missing some slot data #48

Closed rodgolpe closed 7 years ago

rodgolpe commented 7 years ago

To reproduce on a legacy (single color LED OnlyKey):

  1. Initialize 1st OK with PIN (seven 1's), Self-destruct PIN (seven 2's) and PD PIN (seven 3's)
  2. Save your sample PGP key (passcode 'test') as 1024-pin, slot 3, and check all options
  3. Set slot 1a data (label = myslot#1, url = myurl1.com, username = myusername#1, etc)
  4. Set slot 4b data (label = myslot#4b, url = myurl4b.com, username = myusername#4b)
  5. Save backup file per instructions on tab
  6. Initialize 2nd OK with PIN (seven 1's)
  7. Save your sample PGP key (passcode 'test') as 1024-pin, slot 3, and check all options
  8. Remove and reinsert 2nd OK and unlock with PIN
  9. Press and hold button 6 for five seconds, then unlock with PIN to enter config mode
  10. Perform restore, per instructions

RESULT: slot 1a data is correct. slot 4b label is correct, but none of the other fields are output when pressing the button.

onlykey commented 7 years ago

@rodgolpe Made some changes to the firmware so that encryption is now turned on for Backups. I think the changes may have fixed this issue because I have not been able to reproduce. One thing is that the PGP key you loaded is 4096 and 1024 was selected. I can't try this now because with encryption turned on now it knows that this is an invalid key and fails to backup. Can you try to reproduce on the latest firmware? Also can we put a quick check in the app (if 1024 is selected p+q will be 128bytes if not there should be an error wrong size selected, same for other sizes 2048 = 256bytes, 3072 = 384bytes, 4096 = 512bytes)