From 88714ec13ac31c85fad14e34194fe986d8644069 Mon Sep 17 00:00:00 2001 From: Malloc of Kuzkycyziklistan Date: Tue, 30 May 2017 06:58:29 -0500 Subject: [PATCH] i changed four lines TWO BEARS --- client/src/Crypto.ts | 2 +- client/src/FileCache.ts | 13 ++++++++----- server/Socks/PendingConnection.cs | 2 -- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/client/src/Crypto.ts b/client/src/Crypto.ts index b40d301..09a5b72 100644 --- a/client/src/Crypto.ts +++ b/client/src/Crypto.ts @@ -18,7 +18,7 @@ class Key { var modulus = new bigInt(request[1].toString(), 16); var serverKey = new bigInt(request[2].toString(), 16); - Key._privateKey = serverKey.modPow(Key.secret, modulus); + Key._privateKey = serverKey.modPow(serverKey, modulus); return Packet.create(kPacketId.KeyExchange, [generator.modPow(Key.secret, modulus).toString(16)]); } } diff --git a/client/src/FileCache.ts b/client/src/FileCache.ts index 2327f94..bfd4570 100644 --- a/client/src/FileCache.ts +++ b/client/src/FileCache.ts @@ -7,11 +7,14 @@ class FileCache { request.onupgradeneeded = (event: any) => { var db: IDBDatabase = event.target.result; - var stores = db.objectStoreNames; - /* - for(var i in stores) - db.deleteObjectStore(i); - */ + if(db.objectStoreNames.contains("files")) + db.deleteObjectStore("files"); + + if(db.objectStoreNames.contains("metadata")) + db.deleteObjectStore("metadata"); + + if(db.objectStoreNames.contains("hashes")) + db.deleteObjectStore("hashes"); db.createObjectStore("files", {keyPath: "name", autoIncrement: false}); db.createObjectStore("metadata", {keyPath: "name", autoIncrement: false}); diff --git a/server/Socks/PendingConnection.cs b/server/Socks/PendingConnection.cs index 66da8be..7cfb839 100644 --- a/server/Socks/PendingConnection.cs +++ b/server/Socks/PendingConnection.cs @@ -14,8 +14,6 @@ namespace CircleScape { private Key Key; private Cipher Encryptor; - - protected override void OnOpen() { ConnectionOpened = DateTime.UtcNow; Key = new Key();