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

Reverse HOTP support #292

Merged
merged 11 commits into from
Nov 21, 2022
Merged

Reverse HOTP support #292

merged 11 commits into from
Nov 21, 2022

Conversation

szszszsz
Copy link
Member

This PR adds support for the reverse HOTP calls, similarly to the tool known as hotp-verification client.

Changes

  • add CLI for the reverse HOTP under verify command
  • add new credential kind: HOTP_REVERSE, which can only be used with the verify command
  • UP requirement support for the credential use
  • tests updates

Checklist

  • tested with Python3.9
  • run make check or make fix for the formatting check
  • signed commits
  • updated documentation (e.g. parameter description, inline doc, docs.nitrokey)
  • added labels

Test Environment and Execution

  • OS: Linux Fedora 35
  • device's model: NK3 CN, and USB/IP
  • device's firmware version:
    • v0.1-6-ge0859b9 Nitrokey/nitrokey-webcrypt-usbip
    • v1.2.2-12-gff88e11 Nitrokey/nitrokey-3-firmware

Relevant Output Example

$ nitropy nk3 otp verify --help                                 
Command line tool to interact with Nitrokey devices 0.4.30                                                         
Usage: nitropy nk3 otp verify [OPTIONS] NAME                                                                       
                                                                                                                   
  Proceed with the incoming OTP code verification (aka reverse HOTP).                                              
                                                                                                                   
Options:                                                                                                           
  --code INTEGER  The code to verify                                                                               
  --help          Show this message and exit.                                                                      
$ nitropy nk3 otp register --help                               
Command line tool to interact with Nitrokey devices 0.4.30                                                         
Usage: nitropy nk3 otp register [OPTIONS] NAME SECRET                                                              
                                                                                                                   
  Register OTP credential.                                                                                         
                                                                                                                   
  Write SECRET under the NAME. SECRET should be encoded in base32 format.                                          
                                                                                                                   
Options:                                                                                                           
  --digits_str [6|8]              Digits count                                                                     
  --kind [HOTP|TOTP|HOTP_REVERSE]                                                                                  
                                  OTP mechanism to use. Case insensitive.                                          
  --hash [SHA1|SHA256]            Hash algorithm to use                                                            
  --counter_start INTEGER         Starting value for the counter (HOTP only)                                       
  --touch_button                  This credential requires button press before                                     
                                  use                                                                              
  --help                          Show this message and exit.                                                      

                                                                    

Connected:

@szszszsz

This comment was marked as outdated.

@szszszsz

This comment was marked as resolved.

@szszszsz
Copy link
Member Author

Ready when you are @robin-nitrokey

Copy link
Member

@robin-nitrokey robin-nitrokey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good to me, but not tested yet.

@szszszsz szszszsz merged commit 35fb49e into master Nov 21, 2022
@szszszsz szszszsz deleted the reverse-hotp branch November 21, 2022 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
device/Nitrokey 3 enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants