Can't create TOTP - "No OTP for this entry"
KeePass Command Line Interface
Brought to you by:
hightowe,
perlsaiyan
The 'otp' command does not appear to function. It always returns 'No OTP for this entry', regardless of whether or not there is a 2FA entry in the notes/comments. Also, the 'show' command does not redact 2FA entries in the notes.
kpcli:/keepass/A/Folder> show 16
Title: TestTOTP
Uname: VA1DER
Pass:
URL:
Notes: 2FA-TOTP: I552WYNJ26HQNZXP
kpcli:/keepass/A/Folder> otp 16
No OTP for this entry.
kpcli:/keepass/A/Folder> help otp
...
To configure an entry for this feature, place a line in
in the entry's Comments, as follows:
2FA-TOTP: TheBase32SecretKeyProvided
...
Is this an error in the way I'm adding the 2FA-TOTP line?
Using v4.0
Hi, and thank you for providing TheBase32SecretKeyProvided so that I could test this with real data. Unfortunately, I cannot replicate what you see:
Perhaps comparing the list of modules used on my side versus your side would be helpful:
I will gladly reopen this bug if needed, but am closing it for now since I cannot replicate the issue.
If I start with a new database, it works as advertised. If I use my existing KDBX4 database, it doesn't:
My database employs a key file, in case that makes a difference.
Thank you for following up. You found a bug in v4.0.
The bug can be replicated like this:
I will fix this bug in the next release of kpcli. For now, if you are comfortable editing the kpcli source code, the fix is a small change to line 7974, as shown here:
I hope this helps and thanks again for reporting this problem.
It was line 7957 on mine. The fix is in and working perfectly now.
Thanks so much for finding this so quickly!
If you'd like, you can grab the DEVELOPMENT version, that will eventually become v4.1, from here: https://sourceforge.net/p/kpcli/code/HEAD/tree/trunk/
Note that it has the fix that this bug covers, plus a couple of other OTP-related features that you may like. You can review this diff to see those details: https://sourceforge.net/p/kpcli/code/41/tree//trunk/kpcli-DEVELOPMENT.pl?diff=40