diff options
author | siddharth <s@ricketyspace.net> | 2022-04-16 20:14:29 -0400 |
---|---|---|
committer | siddharth <s@ricketyspace.net> | 2022-04-16 20:14:29 -0400 |
commit | 1362ed8d4d68c10f20e67027482826eea3214fb3 (patch) | |
tree | c77146b4b8a6fe1d96e20b9d10036e7eab3bac18 /lib/srp_test.go | |
parent | 8e1700059a73f7090528194fab0b36751d6d1693 (diff) |
lib: add srp mac verification functions
Diffstat (limited to 'lib/srp_test.go')
-rw-r--r-- | lib/srp_test.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/srp_test.go b/lib/srp_test.go index 1445e01..edcc588 100644 --- a/lib/srp_test.go +++ b/lib/srp_test.go @@ -334,4 +334,17 @@ func TestSRPSessionKey(t *testing.T) { " server_sk(%v): client_sk(%v)", user.sk, session.sk) return } + + // Generate MAC of client session's session key + sMac, err := session.SessionKeyMac(user.salt) + if err != nil { + t.Errorf("unable to generate client session's mac: %v", err) + return + } + + // Verify MAC with server. + if !user.SessionKeyMacVerify(sMac) { + t.Errorf("client session mac verify failed: %v", err) + return + } } |