From 5adf6d45302b20fb958ad7a7b7dc3f9861f3987d Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Sat, 11 May 2024 02:13:26 +0700 Subject: [PATCH] DSAParameters.Y should be padded --- MimeKit/Cryptography/AsymmetricAlgorithmExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MimeKit/Cryptography/AsymmetricAlgorithmExtensions.cs b/MimeKit/Cryptography/AsymmetricAlgorithmExtensions.cs index 663ddc7bed..96cf9c9804 100644 --- a/MimeKit/Cryptography/AsymmetricAlgorithmExtensions.cs +++ b/MimeKit/Cryptography/AsymmetricAlgorithmExtensions.cs @@ -260,7 +260,7 @@ static AsymmetricAlgorithm GetAsymmetricAlgorithm (DsaPrivateKeyParameters key, static AsymmetricAlgorithm GetAsymmetricAlgorithm (DsaPublicKeyParameters key) { var parameters = GetDSAParameters (key); - parameters.Y = key.Y.ToByteArrayUnsigned (); + parameters.Y = GetPaddedByteArray (key.Y, parameters.P.Length); var dsa = new DSACryptoServiceProvider ();