1
0
Fork 0
mirror of https://github.com/Luzifer/vault-totp.git synced 2024-10-18 08:04:20 +00:00

Fix: Some services provides lower-case base32 secrets

This commit is contained in:
Knut Ahlers 2017-01-03 15:10:00 +01:00
parent 786b2f51f8
commit 13b379ec1a
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -5,6 +5,7 @@ import (
"io/ioutil" "io/ioutil"
"log" "log"
"os" "os"
"strings"
"time" "time"
"github.com/Luzifer/rconfig" "github.com/Luzifer/rconfig"
@ -122,7 +123,7 @@ func buildOutput(secret string) (string, error) {
// Output: "123456 (Valid 12s)", "123456 (Valid 1s)" // Output: "123456 (Valid 12s)", "123456 (Valid 1s)"
n := time.Now() n := time.Now()
code, err := totp.GenerateCode(secret, n) code, err := totp.GenerateCode(strings.ToUpper(secret), n)
if err != nil { if err != nil {
return "", err return "", err
} }