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

TOTP Doesn't Work on Amazon.com Key #937

Closed
ajgrf opened this issue Sep 26, 2018 · 9 comments
Closed

TOTP Doesn't Work on Amazon.com Key #937

ajgrf opened this issue Sep 26, 2018 · 9 comments
Labels

Comments

@ajgrf
Copy link

ajgrf commented Sep 26, 2018

Summary

gopass totp amazon.com fails even though it works with all of my other accounts. The error given is Error: No OTP entry found for amazon.com: illegal base32 data at input byte 48, as though something is wrong with the key even though there isn't. My current workaround is to run oathtool --totp=sha1 --base32 $(gopass amazon.com totp).

The key does seem to be a different size than my other accounts, which may be causing the issue. When base32-encoded it is 52 characters long.

Steps To Reproduce

  1. Set up 2FA on Amazon.com
  2. Store TOTP key in gopass
  3. Run gopass totp amazon.com

Expected behavior

It should give me a 6 digit totp pin.

Environment

  • OS: Debian 9
  • OS version: Linux hostname 4.17.0-0.bpo.3-amd64 Add template feature #1 SMP Debian 4.17.17-1~bpo9+1 (2018-08-27) x86_64 GNU/Linux
  • gopass Version: gopass 1.8.2-git+HEAD go1.11 linux amd64
  • Installation method: go get
@ajgrf
Copy link
Author

ajgrf commented Oct 3, 2018

I was able to get this working by converting the "totp:" key-value pair to an otpauth URI. There may still be a bug here because I didn't have a problem with any other key, and I don't think it was user error.

@dominikschulz dominikschulz added the bug Defects label Oct 4, 2018
@colemickens
Copy link
Contributor

@ajgrf Have you tried making sure the URL doesn't have anything after secret=VAL, no &issuer... etc?

(And possibly only has the secret parameter?)

I'm seeing really weird behavior too.

@ajgrf
Copy link
Author

ajgrf commented Nov 6, 2018

Yes, before I converted it to an otpauth:// URL, it was a totp: key-value pair with just the key. All caps, no spaces, no other leading or trailing characters (other than a single space between the colon and key).

@nokernel
Copy link
Contributor

nokernel commented Dec 5, 2018

From what I can understand, it looks like it's the yaml library that is not able to find they totp key in the "yaml" document.

It returns an empty document.

I am not done yet investigating.

When printing out the real error from the yaml library you get ~ Key not found error.

@nokernel
Copy link
Contributor

nokernel commented Dec 6, 2018

I was able to make this work with 1.8.2 pre-built binary.

In the yaml format.

Edit your token for this format :

---
totp: yourtokenhere

The trick that made it work for me is the --- line on top

Then gopass totp amazon.com

@colemickens
Copy link
Contributor

I think this issue was about getting WRONG codes, rather than no codes.

My issue with this wound up being that I was using a script to export OTPs from Authy and it was including extra query parameters in the otpauth:// URL that were causing invalid codes to be generated. It took me forever to figure this out. I wound up finding it via process of elimination.

@stale
Copy link

stale bot commented Mar 6, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Mar 6, 2019
@stale stale bot closed this as completed Apr 5, 2019
@NuLL3rr0r
Copy link

@ajgrf thanks converting "totp:" key-value pair to an otpauth URI worked for me. I have the same issue on gopass 1.9.2.

@fi0
Copy link

fi0 commented Sep 11, 2020

Confirming the otpauth URI workaround generates a correct code, and the totp: SECRET will generate a wrong code.
gopass 1.10.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants