Skip to content

Commit

Permalink
fix hotp token generation
Browse files Browse the repository at this point in the history
  • Loading branch information
endorama committed Jul 4, 2018
1 parent b73d7e5 commit ae50da0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion key.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ func (k *Key) hotpToken() int {
if err != nil {
log.Fatal(err)
}
token := totp.Generate(secret, k.Digits, currentCounter)
byteKey, err := base32StringToByte(string(secret))
if err != nil {
log.Fatal(err)
}
token := totp.Generate(byteKey, k.Digits, currentCounter)
k.Counter++
return token
}
Expand Down

0 comments on commit ae50da0

Please sign in to comment.