Fix HMAC calculation
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
nemunaire 2022-02-19 15:30:26 +01:00
commit 21ef2f1372
5 changed files with 20 additions and 6 deletions

View file

@ -68,7 +68,9 @@ func NewStudent(login string) (*Student, error) {
}
func (s *Student) GetPKey() []byte {
return hmac.New(sha512.New512_224, []byte(SharedSecret)).Sum([]byte(s.Login))
h := hmac.New(sha512.New512_224, []byte(SharedSecret))
h.Write([]byte(s.Login))
return h.Sum(nil)
}
func (s *Student) Update() (int64, error) {