diff options
author | siddharth <s@ricketyspace.net> | 2022-05-14 15:03:10 -0400 |
---|---|---|
committer | siddharth <s@ricketyspace.net> | 2022-05-14 15:03:10 -0400 |
commit | 24bc976b0d06637a72b013f3443815bf4ef71bc1 (patch) | |
tree | cd82da13145794dda89dea0b42452375acfebcae /lib | |
parent | 39f2d7613f8a9ee72d6bf555491b3fc043ceaf03 (diff) |
lib: SRPServer: add GetUser
Diffstat (limited to 'lib')
-rw-r--r-- | lib/srp.go | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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 |