From 89f62861517bce0f6a70741688a479e968d32f7a Mon Sep 17 00:00:00 2001 From: Kaleyroy Date: Fri, 8 May 2020 18:16:35 +0800 Subject: [PATCH] Upgrade netfx45 to netstandard2 & Fixed DIGEST-MD5 issue 1. Support netcore (Upgrade netfx45 to netstandard2) 2. Removed System.Configuration dependency (Netfx legacy) 3. Removed RIPEMD-160 algorithm (Not supported in netcore) 4. Fixed DIGEST-MD5 issue (Please refer to https://github.com/smiley22/S22.Sasl/pull/3) 5. Excluded /Tests folder from project (For building only) --- .gitignore | 3 ++ Mechanisms/SaslSrp.cs | 2 +- S22.Sasl.csproj | 107 +++++------------------------------------- SaslFactory.cs | 16 +++---- 4 files changed, 24 insertions(+), 104 deletions(-) diff --git a/.gitignore b/.gitignore index e985ccd..80f67dc 100644 --- a/.gitignore +++ b/.gitignore @@ -165,3 +165,6 @@ pip-log.txt # Mac crap .DS_Store +*.old +/.vs/S22.Sasl/v16/Server/sqlite3 +/.vs/S22.Sasl/DesignTimeBuild diff --git a/Mechanisms/SaslSrp.cs b/Mechanisms/SaslSrp.cs index 0b1328c..813fe00 100644 --- a/Mechanisms/SaslSrp.cs +++ b/Mechanisms/SaslSrp.cs @@ -274,7 +274,7 @@ private Tuple SelectHashAlgorithm(string list) { { "SHA-256", typeof(SHA256Managed) }, { "SHA-384", typeof(SHA384Managed) }, { "SHA-512", typeof(SHA512Managed) }, - { "RIPEMD-160", typeof(RIPEMD160Managed) }, + //{ "RIPEMD-160", typeof(RIPEMD160Managed) }, { "MD5", typeof(MD5CryptoServiceProvider) } }; foreach (KeyValuePair p in l) { diff --git a/S22.Sasl.csproj b/S22.Sasl.csproj index e5dc754..573ca6c 100644 --- a/S22.Sasl.csproj +++ b/S22.Sasl.csproj @@ -1,106 +1,23 @@ - - - + - Debug - AnyCPU - {B860646A-13A2-47D9-9790-4719A91BF35B} + netstandard2.1 Library - Properties - S22.Sasl - S22.Sasl - v4.5 - 512 + false - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 bin\Debug\S22.Sasl.XML - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - False - ..\..\..\..\..\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + - - + - - - \ No newline at end of file diff --git a/SaslFactory.cs b/SaslFactory.cs index 9e4a085..41176a3 100644 --- a/SaslFactory.cs +++ b/SaslFactory.cs @@ -1,6 +1,6 @@ using System; using System.Collections.Generic; -using System.Configuration; +//using System.Configuration; namespace S22.Sasl { /// @@ -90,13 +90,13 @@ static SaslFactory() { { "Srp", typeof(Mechanisms.SaslSrp) } }; // Register any custom mechanisms configured in the app.config. - var configSection = ConfigurationManager.GetSection("saslConfigSection") - as SaslConfigurationSection; - if (configSection != null) { - foreach(SaslProvider provider in configSection.SaslProviders) { - mechanisms.Add(provider.Name, Type.GetType(provider.Type)); - } - } + //var configSection = ConfigurationManager.GetSection("saslConfigSection") + // as SaslConfigurationSection; + //if (configSection != null) { + // foreach(SaslProvider provider in configSection.SaslProviders) { + // mechanisms.Add(provider.Name, Type.GetType(provider.Type)); + // } + //} } } }