From 5a135adbbd907bcf606ab90c56f9fe43230c7f04 Mon Sep 17 00:00:00 2001 From: SendSafely-GitHub Date: Thu, 2 May 2024 09:35:34 -0400 Subject: [PATCH 1/2] v3.0.9 Dependency version updates and related changes --- SendsafelyAPI/Objects/Connection.cs | 33 +++++++++++++----------- SendsafelyAPI/Properties/AssemblyInfo.cs | 8 +++--- SendsafelyAPI/SendsafelyAPI.csproj | 19 +++++++++----- SendsafelyAPI/Utilities/CryptUtility.cs | 6 ++--- SendsafelyAPI/packages.config | 5 ++++ 5 files changed, 42 insertions(+), 29 deletions(-) create mode 100644 SendsafelyAPI/packages.config diff --git a/SendsafelyAPI/Objects/Connection.cs b/SendsafelyAPI/Objects/Connection.cs index 1657b7a..8d9cb92 100644 --- a/SendsafelyAPI/Objects/Connection.cs +++ b/SendsafelyAPI/Objects/Connection.cs @@ -239,23 +239,24 @@ private void Initialize(String host, String privateKey, String apiKey) private String SendRequest(Endpoint p, Object request) { - Stream objStream = CallServer(p, request); - - StreamReader objReader = new StreamReader(objStream); - - String sLine = ""; - String response = ""; - while (sLine != null) + using (var objStream = CallServer(p, request)) { - sLine = objReader.ReadLine(); - if (sLine != null) + StreamReader objReader = new StreamReader(objStream); + + String sLine = ""; + String response = ""; + while (sLine != null) { - response += sLine; - Logger.Log(sLine); + sLine = objReader.ReadLine(); + if (sLine != null) + { + response += sLine; + Logger.Log(sLine); + } } - } - return response; + return response; + } } private String generateUserAgent() @@ -292,8 +293,10 @@ private void WriteOutput(WebRequest req, String requestString) byte[] reqData = System.Text.Encoding.UTF8.GetBytes(requestString); req.ContentLength = reqData.Length; - Stream dataStream = req.GetRequestStream(); - dataStream.Write(reqData, 0, reqData.Length); + + using (var dataStream = req.GetRequestStream()) { + dataStream.Write(reqData, 0, reqData.Length); + } } private void SetTlsProtocol() diff --git a/SendsafelyAPI/Properties/AssemblyInfo.cs b/SendsafelyAPI/Properties/AssemblyInfo.cs index eef8034..82c3ac2 100644 --- a/SendsafelyAPI/Properties/AssemblyInfo.cs +++ b/SendsafelyAPI/Properties/AssemblyInfo.cs @@ -10,7 +10,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("SendSafely Windows Client API")] -[assembly: AssemblyCopyright("Copyright © 2023")] +[assembly: AssemblyCopyright("Copyright © 2024")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -32,7 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("3.0.8")] -[assembly: AssemblyFileVersion("3.0.8")] - -[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("APITests")] \ No newline at end of file +[assembly: AssemblyVersion("3.0.9")] +[assembly: AssemblyFileVersion("3.0.9")] \ No newline at end of file diff --git a/SendsafelyAPI/SendsafelyAPI.csproj b/SendsafelyAPI/SendsafelyAPI.csproj index deebe42..c71e506 100644 --- a/SendsafelyAPI/SendsafelyAPI.csproj +++ b/SendsafelyAPI/SendsafelyAPI.csproj @@ -11,7 +11,7 @@ Properties SendSafely SendsafelyAPI - v4.5 + v4.6.1 512 @@ -20,6 +20,7 @@ full false bin\Debug\ + v4.6.1 DEBUG;TRACE prompt 4 @@ -30,6 +31,7 @@ pdbonly true bin\Release\ + v4.6.1 TRACE prompt 4 @@ -37,12 +39,14 @@ false - - ThirdParty\BouncyCastle.Crypto.dll + + ..\packages\BouncyCastle.Cryptography.2.3.0\lib\net461\BouncyCastle.Cryptography.dll + True - - ThirdParty\Newtonsoft.Json.dll + + ..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll + True @@ -180,10 +184,13 @@ - + PreserveNewest + + +