From 9ca08d7c07912ca2116b7aecfb12985ba7df978b Mon Sep 17 00:00:00 2001 From: luckyrat Date: Sun, 10 Sep 2017 23:12:18 +0100 Subject: [PATCH] Gracefully handle attempts to signal unauthorised connections --- KeePassRPC/KeePassRPCClient.cs | 5 ++++- KeePassRPC/KeePassRPCExt.cs | 2 +- KeePassRPC/Properties/AssemblyInfo.cs | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/KeePassRPC/KeePassRPCClient.cs b/KeePassRPC/KeePassRPCClient.cs index ba4a602..2261290 100644 --- a/KeePassRPC/KeePassRPCClient.cs +++ b/KeePassRPC/KeePassRPCClient.cs @@ -243,6 +243,9 @@ public KeePassRPCClientConnection(IWebSocketConnection connection, bool isAuthor /// The signal. public void Signal(KeePassRPC.DataExchangeModel.Signal signal, string methodName) { + // User may not have authorised the connection we are trying to signal + if (KeyContainer == null) return; + try { Jayrock.Json.JsonObject call = new Jayrock.Json.JsonObject(); @@ -670,7 +673,7 @@ public JSONRPCContainer Encrypt(string plaintext) if (string.IsNullOrEmpty(plaintext)) return null; - KeyContainerClass kc = this.KeyContainer; + KeyContainerClass kc = KeyContainer; SHA1 sha = new SHA1CryptoServiceProvider(); byte[] plaintextBytes = Encoding.UTF8.GetBytes(plaintext); diff --git a/KeePassRPC/KeePassRPCExt.cs b/KeePassRPC/KeePassRPCExt.cs index dc56d7d..52586ac 100644 --- a/KeePassRPC/KeePassRPCExt.cs +++ b/KeePassRPC/KeePassRPCExt.cs @@ -32,7 +32,7 @@ namespace KeePassRPC public sealed class KeePassRPCExt : Plugin { // version information - public static readonly Version PluginVersion = new Version(1, 7, 2); + public static readonly Version PluginVersion = new Version(1, 7, 3); public override string UpdateUrl { diff --git a/KeePassRPC/Properties/AssemblyInfo.cs b/KeePassRPC/Properties/AssemblyInfo.cs index b199ac4..7943eeb 100644 --- a/KeePassRPC/Properties/AssemblyInfo.cs +++ b/KeePassRPC/Properties/AssemblyInfo.cs @@ -19,4 +19,4 @@ // Assembly version information [assembly: AssemblyVersion("2.0.34.*")] -[assembly: AssemblyFileVersion("1.7.2.0")] // also change PluginVersion in KeePassRPCExt.cs! +[assembly: AssemblyFileVersion("1.7.3.0")] // also change PluginVersion in KeePassRPCExt.cs!