token-validator: fix bug with bonus 0
This commit is contained in:
parent
833d3198f2
commit
758326ff0d
|
@ -9,7 +9,8 @@ func GenerateToken(pkey []byte, id int, a ...[]byte) ([]byte, error) {
|
||||||
h := sha512.New()
|
h := sha512.New()
|
||||||
|
|
||||||
h.Write([]byte(fmt.Sprintf("%x", pkey)))
|
h.Write([]byte(fmt.Sprintf("%x", pkey)))
|
||||||
if id != 0 {
|
// Challenge toctoc(6) should not have that
|
||||||
|
if id != 0 && id != 6 {
|
||||||
h.Write([]byte(fmt.Sprintf(":%d", id)))
|
h.Write([]byte(fmt.Sprintf(":%d", id)))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in New Issue