summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorsiddharth <s@ricketyspace.net>2022-05-14 15:05:01 -0400
committersiddharth <s@ricketyspace.net>2022-05-14 15:05:01 -0400
commitcf34eb1586f3192c3498fe67f365996858b8e2fb (patch)
tree919423333ded1ea700d2a289726bb272fa53f5d3 /lib
parent1df94973e5a9f76c01a614f4531837824a8f39b6 (diff)
lib: SRPClient: add news functions
To set and get unexoposed fields.
Diffstat (limited to 'lib')
-rw-r--r--lib/srp.go29
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/srp.go b/lib/srp.go
index ee0b1df..ec3fed6 100644
--- a/lib/srp.go
+++ b/lib/srp.go
@@ -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