summaryrefslogtreecommitdiffstats
path: root/lib/srp.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/srp.go')
-rw-r--r--lib/srp.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/srp.go b/lib/srp.go
index 0c5843b..f6773d0 100644
--- a/lib/srp.go
+++ b/lib/srp.go
@@ -104,6 +104,15 @@ func (server *SRPServer) RegisterUser(user *SRPUser) error {
return nil
}
+func (server *SRPServer) GetUser(ident string) (*SRPUser, error) {
+ for _, u := range server.users {
+ if u.ident == ident {
+ return u, nil
+ }
+ }
+ return nil, CPError{"user not found"}
+}
+
func NewSRPUser(n, g, k, ident, pass string) (*SRPUser, error) {
var err error
var ok bool