This is an automated email from the ASF dual-hosted git repository.

tabish pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-proton-dotnet.git


The following commit(s) were added to refs/heads/main by this push:
     new 18d4004  PROTON-2570 Try to detect disabled MD5 Algorithm and disable 
test
18d4004 is described below

commit 18d40040e7afaff045bd7a2619f41450165c30d5
Author: Timothy Bish <[email protected]>
AuthorDate: Mon Jun 27 15:37:20 2022 -0400

    PROTON-2570 Try to detect disabled MD5 Algorithm and disable test
---
 CodeAnalysis.src.globalconfig                                | 2 +-
 src/Proton/Engine/Sasl/Client/CramMD5Mechanism.cs            | 1 -
 test/Proton.Tests/Engine/Sasl/Client/CramMD5MechanismTest.cs | 9 +++++++++
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/CodeAnalysis.src.globalconfig b/CodeAnalysis.src.globalconfig
index 61e8fbc..91845c9 100644
--- a/CodeAnalysis.src.globalconfig
+++ b/CodeAnalysis.src.globalconfig
@@ -1451,7 +1451,7 @@ dotnet_diagnostic.IDE0053.severity = silent
 dotnet_diagnostic.IDE0054.severity = suggestion
 
 # IDE0055: Fix formatting
-dotnet_diagnostic.IDE0055.severity = suggestion
+dotnet_diagnostic.IDE0055.severity = silent
 
 # IDE0056: Use index operator
 dotnet_diagnostic.IDE0056.severity = silent
diff --git a/src/Proton/Engine/Sasl/Client/CramMD5Mechanism.cs 
b/src/Proton/Engine/Sasl/Client/CramMD5Mechanism.cs
index b31f155..b8189f9 100644
--- a/src/Proton/Engine/Sasl/Client/CramMD5Mechanism.cs
+++ b/src/Proton/Engine/Sasl/Client/CramMD5Mechanism.cs
@@ -15,7 +15,6 @@
  * limitations under the License.
  */
 
-using System;
 using System.Security.Cryptography;
 using System.Text;
 using Apache.Qpid.Proton.Buffer;
diff --git a/test/Proton.Tests/Engine/Sasl/Client/CramMD5MechanismTest.cs 
b/test/Proton.Tests/Engine/Sasl/Client/CramMD5MechanismTest.cs
index a5ea87b..2e6fd15 100644
--- a/test/Proton.Tests/Engine/Sasl/Client/CramMD5MechanismTest.cs
+++ b/test/Proton.Tests/Engine/Sasl/Client/CramMD5MechanismTest.cs
@@ -16,6 +16,7 @@
  */
 
 using System;
+using System.Security.Cryptography;
 using Apache.Qpid.Proton.Buffer;
 using NUnit.Framework;
 
@@ -33,6 +34,14 @@ namespace Apache.Qpid.Proton.Engine.Sasl.Client
       private static readonly string TEST_USERNAME = "tim";
       private static readonly string TEST_PASSWORD = "tanstaaftanstaaf";
 
+      [SetUp]
+      public void TestSetUp()
+      {
+         // Test if MD5 API works, if not we assume the system has disabled 
access to that
+         // algorithm and ignore these tests.
+         Assume.That(() => new HMACMD5(Guid.NewGuid().ToByteArray()), 
Throws.Nothing);
+      }
+
       [Test]
       public void TestSuccessfulAuthentication()
       {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to