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

v0.54 updated OTP handling #85

Merged
merged 29 commits into from
Jun 13, 2019
Merged

v0.54 updated OTP handling #85

merged 29 commits into from
Jun 13, 2019

Conversation

NKelias
Copy link
Contributor

@NKelias NKelias commented Jan 27, 2019

This reworks the OTP handling to resemble that of the Nitrokey Pro.

Functional changes:

  • OTP secret extended to 40 Bytes
  • Authorization changed from pre-authenticated CRC to temporary password in HID report
  • OTP counter transferred as 64bit unsigned Integer instead of C-String
  • OTP counter is retained when editing slots
  • Temporary passwords cleared through lock_device operation
  • HOTP verification functionality added

Further changes:

  • OTP handlng now uses struct format for message parsing and passing data around
  • Replace optimizable memset with non-optimizable memset_safe function for critical data

closes #70
closes #64
closes #26
closes #22
closes #23

Firmware:
nkstorage_v054_pr85.zip

@jans23
Copy link
Member

jans23 commented Jan 28, 2019

While this PR changes the stored OTP data structure, I suggest to include the OTP verification feature (Purism) too, to avoid another subsequent change.

@szszszsz
Copy link
Member

Related to #85 (comment) : #71

@NKelias
Copy link
Contributor Author

NKelias commented Jan 29, 2019

Are we talking about the verification functionality in the NK Pro here?
https://github.com/Nitrokey/nitrokey-pro-firmware/blob/664c11b3e6429551f1b21534efd8ae364047fa87/src/keyboard/report_protocol.c#L445

@szszszsz
Copy link
Member

Exactly. In short device should be able to calculate HOTP code on a separate slot (not available to read by the usual OTP API), and compare with the received code. If matches, should wink green, or red otherwise. Device should offer 10 attempts (AFAIR).

Tests, and the client app, are provided here: nitrokey-hotp-verification.

@szszszsz szszszsz added this to the v0.54 milestone Jan 31, 2019
@NKelias
Copy link
Contributor Author

NKelias commented Feb 7, 2019

Updated firmware:
nkstorage_v054_pr85.zip

szszszsz and others added 5 commits March 18, 2019 17:22
See Nitrokey/nitrokey-pro-firmware@c7debe2

Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Required for Nitrokey HOTP Verification tests pass
Not tested on libnitrokey's suite yet

Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
@szszszsz szszszsz merged commit 667d466 into Nitrokey:master Jun 13, 2019
szszszsz added a commit that referenced this pull request Jun 13, 2019
Following description from #85:

Functional changes:
    OTP secret extended to 40 Bytes
    Authorization changed from pre-authenticated CRC to temporary password in HID report
    OTP counter transferred as 64bit unsigned Integer instead of C-String
    OTP counter is retained when editing slots
    Temporary passwords cleared through lock_device operation
    HOTP verification functionality added

Further changes:
    OTP handlng now uses struct format for message parsing and passing data around
    Replace optimizable memset with non-optimizable memset_safe function for critical data

Additional:
    Smart card counters update on Pro request

Fixes #85
Fixes #70
Fixes #64
Fixes #26
Fixes #22
Fixes #23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants