Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NK Storage: Combine menu entries Generate Keys and Initialize Storage WIth Random Data #45

Closed
jans23 opened this issue May 6, 2016 · 14 comments
Assignees

Comments

@jans23
Copy link
Member

jans23 commented May 6, 2016

When using a brand new Nitrokey Storage the App shows two menu entries:

  • generate AES key
  • initialize storage with random data

Both entries should be combined to "initialize device". When this function is selected the AES keys should be generated first and the mass storage be initialized afterwards.

Also the text of warning dialogs, which are displayed as long as the device is not initialized, should be updated and refer to "initialize device".

@szszszsz szszszsz self-assigned this May 9, 2016
@szszszsz
Copy link
Member

szszszsz commented May 9, 2016

@jans23 Should these two entries always merged or only on first initialization?

@jans23
Copy link
Member Author

jans23 commented May 9, 2016

Always.

Sent from a mobile device.

@szszszsz
Copy link
Member

szszszsz commented May 10, 2016

Tested on Ubuntu 16.04 with scenario:

  1. Menu->Configure->Destroy encrypted data
  2. Confirm generating new AES keys
  3. Cancel SD card wiping
  4. Check menu
  5. Choose 'Initialize device'
  6. Accept AES key generation
  7. Accept SD card initialization
  8. Check menu

Nitrokey Storage, Unity, with HAVE_LIBAPPINDICATOR=ON and OFF

'Initialize device' is visible in both cases: when device is not initialized or when sd card is not initialiazed. Warning text updated.

@szszszsz
Copy link
Member

@jans23 Please let me know if that works for you - branch issue_45

@szszszsz szszszsz added Test and removed ongoing labels May 10, 2016
@szszszsz
Copy link
Member

Merged to master. Please reopen if any modifications would be needed.

@szszszsz szszszsz removed the Test label May 12, 2016
@jans23
Copy link
Member Author

jans23 commented May 13, 2016

The command "destroy encrypted data" should only trigger generating new AES keys but not initializing the storage with random data.

@szszszsz
Copy link
Member

@jans23 Please retest and close if correct.

@jans23
Copy link
Member Author

jans23 commented May 20, 2016

@szszszsz
I describe the expected behaviour:

  1. If brand new device is inserted, "initialize device" is displayed. User selects "initialize device", AES keys are generated and the entire storage is initialized. Finally a success message is displayed. From now on, "initialize device" should not be displayed anymore.

  2. When user selects "destroy encrypted data" new AES keys are generated. Afterwards the device appears as fully initialized. "initialize device" should not be displayed anymore.

Think of it this way: The storage needs to be initialized only once in a device's lifetime. The AES keys may be generated over and over.

Reality check:

Most of it is working as expected except the sentence marked in bold. After destroying encrypted data the command "initialized device" is displayed again. Instead it shouldn't and the device should work as fully initialized. Please let me know if fixing this issue should involve a modification of the firmware.

@szszszsz
Copy link
Member

Hi @jans23
Thanks for clearing that out. I have another question though. From what I have observed until now creating new volumes was not possible after generating AES keys without clearing SD card. Should not clearing the card be optional?

@jans23
Copy link
Member Author

jans23 commented May 22, 2016

Hi @szszszsz
That behaviour doesn't make sense to me. Could you check and provide more details, please?

@szszszsz
Copy link
Member

szszszsz commented May 25, 2016

Currently generating new AES keys sets stick's flag SDFillWithRandomChars_u8 to 0 on firmware side which forces GUI to block volume actions until storage is overwritten with random data. Let me rephrase your description:

  • each NK Storage should be initialized only once (to generate its own AES keys)
  • each SD card should be initialized only once with first use
  • after AES keys regenerating SD card random overwrite should not be done (it is not needed since it is already overwritten with quasi-random data from previous encrypted use)

I will submit proper issue report to NK Storage firmware.

@szszszsz szszszsz removed the ongoing label May 25, 2016
@szszszsz
Copy link
Member

New patch is in branch issue_45_3-initialize_device. Needs test with firmware fixes, if there would be any. Need also to apply changes to device state cache on nitro-app side.

@jans23
Copy link
Member Author

jans23 commented Jun 14, 2016

Describing the expected behaviour in different terms:

  1. A blank device is connected
  2. initialize device is displayed in the menu which:
    1. generates new AES keys
    2. formats the storage with random data
  3. Once the device has been initialized successfully, the menu entry is not displayed anymore.
  4. If user "destroys encrypted data" the AES keys are overwritten.

As long as the device is not flashed or reset to factory defaults the storage is not formated with random data again.

@szszszsz
Copy link
Member

@jans23 Please test and close if all is correct.

@jans23 jans23 closed this as completed Jun 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants