-
Notifications
You must be signed in to change notification settings - Fork 10
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
Unable to parse long totp secret #10
Comments
I think we'll have a fix here shortly, thanks to @qbit. |
I think 'a6mryljlbufszudtjdt42nh5by' is base32 encoded, it just missing padding. 'a6mryljlbufszudtjdt42nh5by======' should be decoded correctly. |
Hey thanks for this update. I've updated, and the OTPs I'm getting aren't valid. Here is a URI for Amazon:
When using the secret with oathtool I get the correct otp:
It looks like it is indeed base32 encoded as @gl-sergei said. |
looks like we will have to add a check for padding. I will come up with something shortly. |
Looks like this snippet does the thing: package main
import (
"fmt"
"strings"
"encoding/base32"
)
func main() {
secret := strings.ToUpper("a6mryljlbufszudtjdt42nh5by")
bytes, err := base32.StdEncoding.WithPadding(base32.NoPadding).DecodeString(secret)
if err != nil {
fmt.Println("error: ", err)
} else {
fmt.Println("bytes: ", bytes)
}
} |
Creating a bug on behalf of @dustinwilson who will provide you with additional details if needed 😉
Returns the error
error: illegal base32 data at input byte 24
.pass-otp and iOS pass reportedly support this URL just fine.
Reference: browserpass/browserpass-legacy#255
The text was updated successfully, but these errors were encountered: