aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHimbeerserverDE <himbeerserverde@gmail.com>2021-09-01 10:50:02 +0200
committerHimbeerserverDE <himbeerserverde@gmail.com>2021-09-01 10:50:02 +0200
commit2368b5dfb1fbf8a054a6a6fbc42f0bc3e27a28cf (patch)
tree117189beccf290b9f255ab9c969ed73619a1c8fd
parentd913616f97ca2213e0f98b135d56c9785e449ca7 (diff)
Fix #24
-rw-r--r--client_conn.go10
-rw-r--r--hop.go2
-rw-r--r--server_conn.go5
3 files changed, 13 insertions, 4 deletions
diff --git a/client_conn.go b/client_conn.go
index 228abb9..cb1e6a8 100644
--- a/client_conn.go
+++ b/client_conn.go
@@ -235,7 +235,10 @@ func handleClt(cc *clientConn) {
break
}
- cc.auth.method = 0
+ cc.auth = struct {
+ method mt.AuthMethods
+ salt, srpA, srpB, srpM, srpK []byte
+ }{}
if cmd.EmptyPasswd && conf.RequirePasswd {
cc.log("<--", "empty password disallowed")
@@ -390,7 +393,10 @@ func handleClt(cc *clientConn) {
M := srp.ClientProof([]byte(cc.name), cc.auth.salt, cc.auth.srpA, cc.auth.srpB, cc.auth.srpK)
if subtle.ConstantTimeCompare(cmd.M, M) == 1 {
- cc.auth.method = 0
+ cc.auth = struct {
+ method mt.AuthMethods
+ salt, srpA, srpB, srpM, srpK []byte
+ }{}
if wantSudo {
cc.state++
diff --git a/hop.go b/hop.go
index ad0d362..ab80df4 100644
--- a/hop.go
+++ b/hop.go
@@ -59,6 +59,6 @@ func (cc *clientConn) hop(serverName string) error {
cc.SendCmd(&mt.ToCltRmHUD{ID: hud})
}
- // Stateless packets
+ // Static parameters
return nil
}
diff --git a/server_conn.go b/server_conn.go
index 816e3e5..a4d0812 100644
--- a/server_conn.go
+++ b/server_conn.go
@@ -179,7 +179,10 @@ func handleSrv(sc *serverConn) {
sc.clt = nil
}
case *mt.ToCltAcceptAuth:
- sc.auth.method = 0
+ sc.auth = struct {
+ method mt.AuthMethods
+ salt, srpA, a, srpK []byte
+ }{}
sc.SendCmd(&mt.ToSrvInit2{Lang: sc.client().lang})
case *mt.ToCltDenySudoMode:
sc.log("<--", "deny sudo")