diff options
author | siddharth ravikumar <s@ricketyspace.net> | 2022-06-29 20:47:28 -0400 |
---|---|---|
committer | siddharth ravikumar <s@ricketyspace.net> | 2022-06-29 20:47:28 -0400 |
commit | e7d85aa1b6e18fb68b23dfe34bf6cb970ba3d15f (patch) | |
tree | 40ac498e72d00490ad38dc0bd5aa6fa114fac345 /lib/srp.go | |
parent | cdb98133c282ee2fb51430001ad0bd8ee8328f7e (diff) |
lib: srp: update session key mac
Use `HmacSha256`.
Diffstat (limited to 'lib/srp.go')
-rw-r--r-- | lib/srp.go | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -254,7 +254,10 @@ func (u *SRPUser) ComputeSessionKey(a *big.Int) error { } func (u *SRPUser) SessionKeyMacVerify(mac []byte) bool { - return u.h.MacVerify(u.salt, u.sk, mac) + if BytesEqual(HmacSha256(u.sk, u.salt), mac) { + return true + } + return false } func (u *SRPUser) LoggedIn() bool { @@ -487,5 +490,5 @@ func (s *SRPClientSession) SessionKeyMac(salt []byte) ([]byte, error) { if len(salt) < 1 { return nil, CPError{"salt is invalid"} } - return s.h.Mac(salt, s.sk), nil + return HmacSha256(s.sk, salt), nil } |