diff options
author | Filip Navara <navara@emclient.com> | 2018-06-01 18:49:58 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2018-06-03 09:41:55 +0300 |
commit | 68e02dec52855b0ccf2f8431b70197f233917f96 (patch) | |
tree | b8fa924b4d1f1d32b0fee822b9328f916ac93f30 | |
parent | 3a3f1bc99878a0bfb82aea366805f8ec00c38e17 (diff) |
Switch CmsSigner default algorithm to SHA-1 to match documented .NET Framework behaviour. Make EnvelopedCms class partial to allow adding methods to it.
2 files changed, 5 insertions, 1 deletions
diff --git a/src/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSigner.cs b/src/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSigner.cs index 0a98a79bf9..6099fcfe2c 100644 --- a/src/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSigner.cs +++ b/src/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSigner.cs @@ -13,7 +13,11 @@ namespace System.Security.Cryptography.Pkcs { public sealed class CmsSigner { +#if MONO + private static readonly Oid s_defaultAlgorithm = Oid.FromOidValue(Oids.Sha1, OidGroup.HashAlgorithm); +#else private static readonly Oid s_defaultAlgorithm = Oid.FromOidValue(Oids.Sha256, OidGroup.HashAlgorithm); +#endif public X509Certificate2 Certificate { get; set; } public X509Certificate2Collection Certificates { get; set; } = new X509Certificate2Collection(); diff --git a/src/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/EnvelopedCms.cs b/src/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/EnvelopedCms.cs index 9c2521a0ba..f3a03c9a7c 100644 --- a/src/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/EnvelopedCms.cs +++ b/src/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/EnvelopedCms.cs @@ -10,7 +10,7 @@ using Internal.Cryptography; namespace System.Security.Cryptography.Pkcs { - public sealed class EnvelopedCms + public sealed partial class EnvelopedCms { // // Constructors |