tadfisher / pass-otp

A pass extension for managing one-time-password (OTP) tokens
GNU General Public License v3.0
1.28k stars 85 forks source link

oathtool: base32 decoding failed: Base32 string is invalid #124

Open nh2 opened 3 years ago

nh2 commented 3 years ago

Hey, thanks for your software, it is very useful.

I used zbarcam -q --raw | pass otp insert 'Amazon MFA' to bring an Amazon OTP seed from andOTP into pass, making andOTP display a bar code and scanning it with zbarcam.

Afterwards, pass otp show 'Amazon MFA' prsented the following error:

oathtool: base32 decoding failed: Base32 string is invalid

Using pass show revealed that it had

?secret=DHG...JA%3D%3D%3D%3D&issuer=

In the string. %3D is the = character, which I believe is the padding char in base32, and thus having 4 = in a row is illegal in base32.

Removing the %3D%3D%3D%3D with pass fixes pass otp working.

Do you have a suggestion where this error could be introduced? E.g. is it andOTP displaying a bad code, zbarcam converting it wrong, or is pass-otp itself putting in the padding?

Thanks.

tadfisher commented 3 years ago

I'm not sure; can you post the result of zbarcam -q --raw (with the secret and account information sanitized, of course)? I suspect an issue with the image andOTP is generating.

ghost commented 1 year ago

In pass-import I ran into the same issue: https://github.com/roddhjav/pass-import/issues/166

Maybe it is helpful.