token-validator: fix bug with bonus 0

This commit is contained in:
nemunaire 2021-02-18 01:14:32 +01:00
parent 833d3198f2
commit 758326ff0d
1 changed files with 2 additions and 1 deletions

View File

@ -9,7 +9,8 @@ func GenerateToken(pkey []byte, id int, a ...[]byte) ([]byte, error) {
h := sha512.New()
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)))
}