navid/veins / commit

206319a7536d

Navid M <navidmomtahen@gmail.com> · 2026-11-27

parents: bfd69df60a59

Browse files at this commit · Download source

all: fix issue with server auth drop logic in xveins and veins
--- a/veins/src/server/serve.sx+++ b/veins/src/server/serve.sx@@ -514,7 +514,10 @@                 wire.ERR_AUTH_FAILED,                 bytes.bytes(c"authentication failed", 21)             )-            return false+            if s.failed_auth >= 3 {+                s.closing = true+            }+            return true         }     }     val role: mut u8 = 255@@ -547,7 +550,7 @@         if s.failed_auth >= 3 {             s.closing = true         }-        return false+        return true     }     val fp_opt = ed.fingerprint_bytes(a.public_key)     val fp: mut bytes.Bytes = bytes.empty()--- a/xveins/src/server.cpp+++ b/xveins/src/server.cpp@@ -338,7 +338,9 @@     ++session.failed_auth;     wire::write_error(session.stream, frame.request_id, wire::ERR_AUTH_FAILED,                       "authentication failed");-    return false;+    if (session.failed_auth >= 3)+      session.closing = true;+    return true;   }   PublicKey public_key{};   const bool key_well_formed = auth->public_key.size() == public_key.size();@@ -362,7 +364,7 @@                       "authentication failed");     if (session.failed_auth >= 3)       session.closing = true;-    return false;+    return true;   }    session.authed = true;