diff options
author | siddharth <s@ricketyspace.net> | 2022-05-14 15:05:01 -0400 |
---|---|---|
committer | siddharth <s@ricketyspace.net> | 2022-05-14 15:05:01 -0400 |
commit | cf34eb1586f3192c3498fe67f365996858b8e2fb (patch) | |
tree | 919423333ded1ea700d2a289726bb272fa53f5d3 /lib/srp.go | |
parent | 1df94973e5a9f76c01a614f4531837824a8f39b6 (diff) |
lib: SRPClient: add news functions
To set and get unexoposed fields.
Diffstat (limited to 'lib/srp.go')
-rw-r--r-- | lib/srp.go | 29 |
1 files changed, 29 insertions, 0 deletions
@@ -266,6 +266,35 @@ func (u *SRPUser) Salt() []byte { return u.salt } +func (client *SRPClient) LoggedIn() bool { + if client.Session == nil { + return false + } + return client.Session.loggedIn +} + +func (client *SRPClient) LogIn() { + if client.Session == nil { + return + } + client.Session.loggedIn = true +} + +func (client *SRPClient) LogOut() { + if client.Session == nil { + return + } + client.Session.loggedIn = false +} + +func (client *SRPClient) Ident() string { + if !client.LoggedIn() { + return "" + } else { + return client.Session.ident + } +} + func NewSRPClientSession(n, g, k, ident string) (*SRPClientSession, error) { var ok bool |