From 92a300c41f240cf56060fa5e6507157c2700e626 Mon Sep 17 00:00:00 2001 From: Malloc of Kuzkycyziklistan Date: Tue, 30 May 2017 16:05:02 -0500 Subject: [PATCH] database work sqloomy --- client/src/sock/Connection.ts | 2 +- server/Encryption/KeyExchange.cs | 3 +-- server/Libraries/Kneesocks/Connection.cs | 7 +++++++ server/Socks/ActiveConnection.cs | 3 +-- server/Socks/PendingConnection.cs | 6 ++++++ server/scape.db | Bin 32768 -> 32768 bytes 6 files changed, 16 insertions(+), 5 deletions(-) diff --git a/client/src/sock/Connection.ts b/client/src/sock/Connection.ts index 67e5aa5..8c81704 100644 --- a/client/src/sock/Connection.ts +++ b/client/src/sock/Connection.ts @@ -54,7 +54,7 @@ class Connection { CriticalStop.redirect("Could not establish an encrypted connection with the server."); break; case kPacketId.LoginAttempt: - + break; case kPacketId.RegistrationAttempt: diff --git a/server/Encryption/KeyExchange.cs b/server/Encryption/KeyExchange.cs index 3c3b2d0..10b8899 100644 --- a/server/Encryption/KeyExchange.cs +++ b/server/Encryption/KeyExchange.cs @@ -9,7 +9,7 @@ using System.Globalization; namespace CircleScape.Encryption { class Key { - private BigInteger Secret; + private readonly static BigInteger Secret = RNG.NextPrime(512 / 8); public BigInteger Generator { get; private set; } = 2; public BigInteger Modulus { get; private set; } public BigInteger PrivateKey { get; private set; } = BigInteger.Zero; @@ -18,7 +18,6 @@ namespace CircleScape.Encryption { } public Key() { - Secret = RNG.NextPrime(512 / 8); Modulus = RNG.NextPrime(512 / 8); } diff --git a/server/Libraries/Kneesocks/Connection.cs b/server/Libraries/Kneesocks/Connection.cs index 1ab5a71..bf9df61 100644 --- a/server/Libraries/Kneesocks/Connection.cs +++ b/server/Libraries/Kneesocks/Connection.cs @@ -6,6 +6,7 @@ using System.Text; using System.Threading.Tasks; using Square; using System.IO; +using System.Net; namespace Kneesocks { public class Connection { @@ -55,6 +56,12 @@ namespace Kneesocks { public bool Handshaked { get; private set; } = false; public Handshake ClientHandshake { get; private set; } = null; + public IPAddress IP { + get { + return ((IPEndPoint)Socket.Client.RemoteEndPoint).Address; + } + } + public void Initialize(TcpClient sock) { if(Initialized) return; diff --git a/server/Socks/ActiveConnection.cs b/server/Socks/ActiveConnection.cs index 04a2279..e9f19ab 100644 --- a/server/Socks/ActiveConnection.cs +++ b/server/Socks/ActiveConnection.cs @@ -8,13 +8,12 @@ using Kneesocks; using CircleScape.Encryption; namespace CircleScape { - class ActiveConnection : Kneesocks.Connection { + class ActiveConnection : Connection { private Cipher Encryptor; public void Initialize(PendingConnection conn) { Initialize(conn, false); Encryptor = conn.Encryptor; - } } } diff --git a/server/Socks/PendingConnection.cs b/server/Socks/PendingConnection.cs index 948cfb8..01fa2ac 100644 --- a/server/Socks/PendingConnection.cs +++ b/server/Socks/PendingConnection.cs @@ -47,6 +47,12 @@ namespace CircleScape { Encryptor = new Cipher(Key.PrivateKey); break; + case Packet.kId.LoginAttempt: + + break; + default: + Disconnect(Frame.kClosingReason.ProtocolError, "Packet ID could not be understood at this time."); + break; } Console.WriteLine(Id + " says " + data.GetString()); diff --git a/server/scape.db b/server/scape.db index 2504da12d365f58efb6149179a75755513618cce..df3a227ad331f1faa75f508324444defd41f0fa1 100644 GIT binary patch delta 355 zcmZo@U}|V!njkGG!oa}50mSS;%ml<96LpN`MHuuLBY1hU7}$AI82H}uh42>fN%N%e z+VdxHyKq-;78GFSn%u~Bn5)stgk9X)nz2cH@*HlN$;-JM>OE5wJpDp+xD*sZi&Km8 z5_3}(LR=%j0s)D|#pU@$DR2R={LH*mxO$(&;u4?y^vpb%0T5}=0vI2p0K((a1UfEQ zTwI*7S-K=KDJKR delta 349 zcmZo@U}|V!njkGG#K6G70mY0!+J2&rvAht29%BSApAQ2Ek01lzTfPt;L7q?i3B0m= z(!8&DUu_l?VCI_K$aUD!FN8~zSC-+VxVSiDGk-~9Qch}VacWU9m|$`aa&-)GRS0o( z@^MuF3n^%1rYLy&H45vpi(6YWHrh`1J`b@oZBDin+SG1}XUYhbZ`k`uON5_#_sWcou*Z zgCsOHwI@6BYH~Gt>9LE;$}%>kPp;u@=SQ<=@<(17VRWN3^$jM=@~QF|K@}IX>+5fp l<#T0Z)Y+WOKQ~}f05>ZeFw|H#3kH1S->eYuoPXj3VF0XwT|xi=