From: Jeremy Barton Date: Sat, 15 Jun 2019 17:28:23 +0000 (-0700) Subject: Add S.S.C.Pkcs and S.S.C.Cng netstandard2.1 ref and lib (dotnet/corefx#38439) X-Git-Tag: submit/tizen/20210909.063632~11031^2~1277 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b00417b88b4824233d98c71413c3bae8f38f2ad0;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Add S.S.C.Pkcs and S.S.C.Cng netstandard2.1 ref and lib (dotnet/corefx#38439) * Add S.S.C.Pkcs and S.S.C.Cng netstandard2.1 ref and lib The netstandard2.1 ref is equivalent to the netcoreapp3.0 ref in these two OOB packages. Ref changes: Cng: * Adds DSACng and ECDiffieHellmanCng (and related types) Pkcs: * Adds RSA-OAEP option to CmsRecipient * Adds custom private key option to CmsSigner * Adds custom private key decrypt option to EnvelopedCms * Adds Pkcs12Info and Pkcs12Builder (and associated types) * Adds Pkcs8PrivateKeyInfo * Adds RFC3161 timestamp types * Adds AddCertificate/RemoveCertificate to SignedCms * Adds AddUnsignedAttribute/RemoveUnsignedAttribute to SignerInfo * Adds SignatureAlgorithm/GetSignature to SignerInfo * Adds MatchesCertificate to SubjectIdentifier Impl changes: Cng: * The netstandard2.1 impl is a generated PNSE, the real impl is inbox on Windows. Pkcs: * The impls are the same as the netcoreapp3.0 impls, but are required because netstandard2.0 is a better match for netstandard2.1 than netcoreapp3.0 is. * Use shared netstandard21 DefineConstant * Add netstandard2.1 to ref AdditionalBuildConfigurations Commit migrated from https://github.com/dotnet/corefx/commit/985334c90d6b181cd47cd42c4c958d9dd34ab90b --- diff --git a/src/libraries/Common/src/System/Security/Cryptography/Asn1Reader/AsnCharacterStringEncodings.cs b/src/libraries/Common/src/System/Security/Cryptography/Asn1Reader/AsnCharacterStringEncodings.cs index bcaffa5..25954b4 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/Asn1Reader/AsnCharacterStringEncodings.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/Asn1Reader/AsnCharacterStringEncodings.cs @@ -65,7 +65,7 @@ namespace System.Security.Cryptography.Asn1 } public -#if netcoreapp || uap || NETCOREAPP +#if netcoreapp || uap || NETCOREAPP || netstandard21 override #endif int GetByteCount(ReadOnlySpan chars) @@ -100,7 +100,7 @@ namespace System.Security.Cryptography.Asn1 } public -#if netcoreapp || uap || NETCOREAPP +#if netcoreapp || uap || NETCOREAPP || netstandard21 override #endif int GetCharCount(ReadOnlySpan bytes) @@ -394,7 +394,7 @@ namespace System.Security.Cryptography.Asn1 return s_utf8Encoding.GetByteCount(s); } -#if netcoreapp || uap || NETCOREAPP +#if netcoreapp || uap || NETCOREAPP || netstandard21 public override int GetByteCount(ReadOnlySpan chars) { return s_utf8Encoding.GetByteCount(chars); @@ -435,7 +435,7 @@ namespace System.Security.Cryptography.Asn1 } } -#if netcoreapp || uap || NETCOREAPP +#if netcoreapp || uap || NETCOREAPP || netstandard21 public override int GetCharCount(ReadOnlySpan bytes) { try diff --git a/src/libraries/Common/src/System/Security/Cryptography/Asn1Reader/AsnWriter.BitString.cs b/src/libraries/Common/src/System/Security/Cryptography/Asn1Reader/AsnWriter.BitString.cs index a5a0675..ea54594 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/Asn1Reader/AsnWriter.BitString.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/Asn1Reader/AsnWriter.BitString.cs @@ -117,7 +117,7 @@ namespace System.Security.Cryptography.Asn1 _offset += bitString.Length; } -#if netcoreapp || uap || NETCOREAPP +#if netcoreapp || uap || NETCOREAPP || netstandard21 /// /// Write a Bit String value via a callback, with a tag UNIVERSAL 3. /// diff --git a/src/libraries/Common/src/System/Security/Cryptography/CryptoPool.cs b/src/libraries/Common/src/System/Security/Cryptography/CryptoPool.cs index 9d6413e..ffe7319 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/CryptoPool.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/CryptoPool.cs @@ -20,7 +20,7 @@ namespace System.Security.Cryptography if (!clearWholeArray && clearSize != 0) { -#if netcoreapp || uap || NETCOREAPP +#if netcoreapp || uap || NETCOREAPP || netstandard21 CryptographicOperations.ZeroMemory(array.AsSpan(0, clearSize)); #else Array.Clear(array, 0, clearSize); diff --git a/src/libraries/System.Security.Cryptography.Cng/ref/Configurations.props b/src/libraries/System.Security.Cryptography.Cng/ref/Configurations.props index b917a74..950f010 100644 --- a/src/libraries/System.Security.Cryptography.Cng/ref/Configurations.props +++ b/src/libraries/System.Security.Cryptography.Cng/ref/Configurations.props @@ -2,6 +2,7 @@ netcoreapp; + netstandard2.1; net461; net462; net47; @@ -12,4 +13,4 @@ uap; - \ No newline at end of file + diff --git a/src/libraries/System.Security.Cryptography.Cng/ref/System.Security.Cryptography.Cng.csproj b/src/libraries/System.Security.Cryptography.Cng/ref/System.Security.Cryptography.Cng.csproj index fb75986..fc71335 100644 --- a/src/libraries/System.Security.Cryptography.Cng/ref/System.Security.Cryptography.Cng.csproj +++ b/src/libraries/System.Security.Cryptography.Cng/ref/System.Security.Cryptography.Cng.csproj @@ -3,11 +3,11 @@ $(DefineConstants);FEATURE_ECPARAMETERS {9FD12550-3A7C-49D3-9A1E-C4B7410989DD} - $(DefineConstants);FEATURE_DSA_HASHDATA + $(DefineConstants);FEATURE_DSA_HASHDATA - $(DefineConstants);FEATURE_ECDH_DERIVEFROM + $(DefineConstants);FEATURE_ECDH_DERIVEFROM true - net461-Debug;net461-Release;net462-Debug;net462-Release;net47-Debug;net47-Release;netcoreapp-Debug;netcoreapp-Release;netfx-Debug;netfx-Release;uap-Debug;uap-Release + net461-Debug;net461-Release;net462-Debug;net462-Release;net47-Debug;net47-Release;netcoreapp-Debug;netcoreapp-Release;netfx-Debug;netfx-Release;netstandard2.1-Debug;netstandard2.1-Release;uap-Debug;uap-Release diff --git a/src/libraries/System.Security.Cryptography.Cng/src/Configurations.props b/src/libraries/System.Security.Cryptography.Cng/src/Configurations.props index 54f2a9c..d8379d9 100644 --- a/src/libraries/System.Security.Cryptography.Cng/src/Configurations.props +++ b/src/libraries/System.Security.Cryptography.Cng/src/Configurations.props @@ -2,6 +2,7 @@ netstandard; + netstandard2.1; net461-Windows_NT; netcoreapp-Windows_NT; netcoreapp; @@ -14,4 +15,4 @@ uap-Windows_NT; - \ No newline at end of file + diff --git a/src/libraries/System.Security.Cryptography.Cng/src/System.Security.Cryptography.Cng.csproj b/src/libraries/System.Security.Cryptography.Cng/src/System.Security.Cryptography.Cng.csproj index 581bd6b..cc566e1 100644 --- a/src/libraries/System.Security.Cryptography.Cng/src/System.Security.Cryptography.Cng.csproj +++ b/src/libraries/System.Security.Cryptography.Cng/src/System.Security.Cryptography.Cng.csproj @@ -7,7 +7,7 @@ true true true - net461-Windows_NT-Debug;net461-Windows_NT-Release;net462-Windows_NT-Debug;net462-Windows_NT-Release;net47-Windows_NT-Debug;net47-Windows_NT-Release;netcoreapp-Debug;netcoreapp-Release;netcoreapp-Windows_NT-Debug;netcoreapp-Windows_NT-Release;netfx-Windows_NT-Debug;netfx-Windows_NT-Release;netstandard-Debug;netstandard-Release;uap-Windows_NT-Debug;uap-Windows_NT-Release + net461-Windows_NT-Debug;net461-Windows_NT-Release;net462-Windows_NT-Debug;net462-Windows_NT-Release;net47-Windows_NT-Debug;net47-Windows_NT-Release;netcoreapp-Debug;netcoreapp-Release;netcoreapp-Windows_NT-Debug;netcoreapp-Windows_NT-Release;netfx-Windows_NT-Debug;netfx-Windows_NT-Release;netstandard-Debug;netstandard-Release;netstandard2.1-Debug;netstandard2.1-Release;uap-Windows_NT-Debug;uap-Windows_NT-Release SR.PlatformNotSupported_CryptographyCng @@ -380,7 +380,7 @@ - + @@ -406,4 +406,4 @@ - + \ No newline at end of file diff --git a/src/libraries/System.Security.Cryptography.Pkcs/ref/Configurations.props b/src/libraries/System.Security.Cryptography.Pkcs/ref/Configurations.props index acd9b5e..fc1c1fc 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/ref/Configurations.props +++ b/src/libraries/System.Security.Cryptography.Pkcs/ref/Configurations.props @@ -2,6 +2,7 @@ netcoreapp; + netstandard2.1; net461; diff --git a/src/libraries/System.Security.Cryptography.Pkcs/ref/System.Security.Cryptography.Pkcs.csproj b/src/libraries/System.Security.Cryptography.Pkcs/ref/System.Security.Cryptography.Pkcs.csproj index 1d8f8ec..92b6bff 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/ref/System.Security.Cryptography.Pkcs.csproj +++ b/src/libraries/System.Security.Cryptography.Pkcs/ref/System.Security.Cryptography.Pkcs.csproj @@ -1,12 +1,12 @@ - + {881269F5-9F22-4427-8DC5-63E2C05875BA} true - net461-Debug;net461-Release;netcoreapp-Debug;netcoreapp-Release;netfx-Debug;netfx-Release;uap-Debug;uap-Release + net461-Debug;net461-Release;netcoreapp-Debug;netcoreapp-Release;netfx-Debug;netfx-Release;netstandard2.1-Debug;netstandard2.1-Release;uap-Debug;uap-Release - + diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/Configurations.props b/src/libraries/System.Security.Cryptography.Pkcs/src/Configurations.props index 589f0c7..59a32d7 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/Configurations.props +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/Configurations.props @@ -3,6 +3,8 @@ netstandard; netstandard-Windows_NT; + netstandard2.1; + netstandard2.1-Windows_NT; netcoreapp-Windows_NT; netcoreapp; net461-Windows_NT; diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/Pal/AnyOS/ManagedPal.KeyTrans.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/Pal/AnyOS/ManagedPal.KeyTrans.cs index a1e5968..8bfeeac 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/Pal/AnyOS/ManagedPal.KeyTrans.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/Pal/AnyOS/ManagedPal.KeyTrans.cs @@ -189,7 +189,7 @@ namespace Internal.Cryptography.Pal.AnyOS return null; } -#if netcoreapp +#if netcoreapp || netstandard21 byte[] cek = null; int cekLength = 0; diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/Pal/AnyOS/ManagedPal.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/Pal/AnyOS/ManagedPal.cs index 41b511c..2f84574 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/Pal/AnyOS/ManagedPal.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/Pal/AnyOS/ManagedPal.cs @@ -77,7 +77,7 @@ namespace Internal.Cryptography.Pal.AnyOS return (T)(object)certificate.GetRSAPrivateKey(); if (typeof(T) == typeof(ECDsa)) return (T)(object)certificate.GetECDsaPrivateKey(); -#if netcoreapp +#if netcoreapp || netstandard21 if (typeof(T) == typeof(DSA)) return (T)(object)certificate.GetDSAPrivateKey(); #endif diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/PkcsHelpers.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/PkcsHelpers.cs index 346a2fd..e7d0ec9 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/PkcsHelpers.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/PkcsHelpers.cs @@ -22,7 +22,7 @@ namespace Internal.Cryptography { private static readonly byte[] s_pSpecifiedDefaultParameters = { 0x04, 0x00 }; -#if !netcoreapp +#if !netcoreapp && !netstandard21 // Compatibility API. internal static void AppendData(this IncrementalHash hasher, ReadOnlySpan data) { @@ -319,7 +319,7 @@ namespace Internal.Cryptography return ToUpperHexString(serialBytes); } -#if netcoreapp +#if netcoreapp || netstandard21 private static unsafe string ToUpperHexString(ReadOnlySpan ba) { fixed (byte* baPtr = ba) @@ -411,7 +411,7 @@ namespace Internal.Cryptography attributeObject = Upgrade(attributeObject); break; -#if netcoreapp +#if netcoreapp || netstandard21 case Oids.LocalKeyId: attributeObject = Upgrade(attributeObject); break; diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/System.Security.Cryptography.Pkcs.csproj b/src/libraries/System.Security.Cryptography.Pkcs/src/System.Security.Cryptography.Pkcs.csproj index d045a33..2938b9a 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/System.Security.Cryptography.Pkcs.csproj +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/System.Security.Cryptography.Pkcs.csproj @@ -1,4 +1,4 @@ - + {03D84CBD-896D-4B2F-9A22-07034F51E73D} System.Security.Cryptography.Pkcs @@ -8,7 +8,7 @@ true true $(NoWarn);CS1574;CS3016 - net461-Windows_NT-Debug;net461-Windows_NT-Release;netcoreapp-Debug;netcoreapp-Release;netcoreapp-Windows_NT-Debug;netcoreapp-Windows_NT-Release;netfx-Windows_NT-Debug;netfx-Windows_NT-Release;netstandard-Debug;netstandard-Release;netstandard-Windows_NT-Debug;netstandard-Windows_NT-Release + net461-Windows_NT-Debug;net461-Windows_NT-Release;netcoreapp-Debug;netcoreapp-Release;netcoreapp-Windows_NT-Debug;netcoreapp-Windows_NT-Release;netfx-Windows_NT-Debug;netfx-Windows_NT-Release;netstandard-Debug;netstandard-Release;netstandard-Windows_NT-Debug;netstandard-Windows_NT-Release;netstandard2.1-Debug;netstandard2.1-Release;netstandard2.1-Windows_NT-Debug;netstandard2.1-Windows_NT-Release @@ -375,7 +375,7 @@ - + @@ -396,8 +396,10 @@ - + + + @@ -643,7 +645,7 @@ - + Common\System\Security\Cryptography\KeyFormatHelper.cs diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSignature.DSA.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSignature.DSA.cs index 62cf6bd..0bde61f 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSignature.DSA.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSignature.DSA.cs @@ -37,7 +37,7 @@ namespace System.Security.Cryptography.Pkcs } internal override bool VerifySignature( -#if netcoreapp +#if netcoreapp || netstandard21 ReadOnlySpan valueHash, ReadOnlyMemory signature, #else @@ -68,7 +68,7 @@ namespace System.Security.Cryptography.Pkcs DSAParameters dsaParameters = dsa.ExportParameters(false); int bufSize = 2 * dsaParameters.Q.Length; -#if netcoreapp +#if netcoreapp || netstandard21 byte[] rented = CryptoPool.Rent(bufSize); Span ieee = new Span(rented, 0, bufSize); @@ -83,7 +83,7 @@ namespace System.Security.Cryptography.Pkcs } return dsa.VerifySignature(valueHash, ieee); -#if netcoreapp +#if netcoreapp || netstandard21 } finally { @@ -93,7 +93,7 @@ namespace System.Security.Cryptography.Pkcs } protected override bool Sign( -#if netcoreapp +#if netcoreapp || netstandard21 ReadOnlySpan dataHash, #else byte[] dataHash, @@ -133,7 +133,7 @@ namespace System.Security.Cryptography.Pkcs signatureAlgorithm = new Oid(oidValue, oidValue); -#if netcoreapp +#if netcoreapp || netstandard21 // The Q size cannot be bigger than the KeySize. byte[] rented = CryptoPool.Rent(dsa.KeySize / 8); int bytesWritten = 0; diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSignature.ECDsa.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSignature.ECDsa.cs index 827e101..21c47d0 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSignature.ECDsa.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSignature.ECDsa.cs @@ -37,7 +37,7 @@ namespace System.Security.Cryptography.Pkcs } internal override bool VerifySignature( -#if netcoreapp +#if netcoreapp || netstandard21 ReadOnlySpan valueHash, ReadOnlyMemory signature, #else @@ -73,7 +73,7 @@ namespace System.Security.Cryptography.Pkcs bufSize = 2 * fieldSize; } -#if netcoreapp +#if netcoreapp || netstandard21 byte[] rented = CryptoPool.Rent(bufSize); Span ieee = new Span(rented, 0, bufSize); @@ -88,7 +88,7 @@ namespace System.Security.Cryptography.Pkcs } return key.VerifyHash(valueHash, ieee); -#if netcoreapp +#if netcoreapp || netstandard21 } finally { @@ -98,7 +98,7 @@ namespace System.Security.Cryptography.Pkcs } protected override bool Sign( -#if netcoreapp +#if netcoreapp || netstandard21 ReadOnlySpan dataHash, #else byte[] dataHash, @@ -138,7 +138,7 @@ namespace System.Security.Cryptography.Pkcs signatureAlgorithm = new Oid(oidValue, oidValue); -#if netcoreapp +#if netcoreapp || netstandard21 int bufSize; checked { @@ -174,7 +174,7 @@ namespace System.Security.Cryptography.Pkcs #endif signatureValue = DsaIeeeToDer(key.SignHash( -#if netcoreapp +#if netcoreapp || netstandard21 dataHash.ToArray() #else dataHash diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSignature.RSA.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSignature.RSA.cs index bd3b26c..61a802d 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSignature.RSA.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSignature.RSA.cs @@ -40,7 +40,7 @@ namespace System.Security.Cryptography.Pkcs } internal override bool VerifySignature( -#if netcoreapp +#if netcoreapp || netstandard21 ReadOnlySpan valueHash, ReadOnlyMemory signature, #else @@ -76,7 +76,7 @@ namespace System.Security.Cryptography.Pkcs return publicKey.VerifyHash( valueHash, -#if netcoreapp +#if netcoreapp || netstandard21 signature.Span, #else signature, @@ -123,7 +123,7 @@ namespace System.Security.Cryptography.Pkcs } protected override bool Sign( -#if netcoreapp +#if netcoreapp || netstandard21 ReadOnlySpan dataHash, #else byte[] dataHash, @@ -151,7 +151,7 @@ namespace System.Security.Cryptography.Pkcs signatureAlgorithm = new Oid(Oids.Rsa, Oids.Rsa); -#if netcoreapp +#if netcoreapp || netstandard21 byte[] signature = new byte[privateKey.KeySize / 8]; bool signed = privateKey.TrySignHash( @@ -176,7 +176,7 @@ namespace System.Security.Cryptography.Pkcs } #endif signatureValue = privateKey.SignHash( -#if netcoreapp +#if netcoreapp || netstandard21 dataHash.ToArray(), #else dataHash, @@ -267,7 +267,7 @@ namespace System.Security.Cryptography.Pkcs } protected override bool Sign( -#if netcoreapp +#if netcoreapp || netstandard21 ReadOnlySpan dataHash, #else byte[] dataHash, diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSignature.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSignature.cs index d5fd6a6..a82239f 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSignature.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSignature.cs @@ -29,7 +29,7 @@ namespace System.Security.Cryptography.Pkcs protected abstract bool VerifyKeyType(AsymmetricAlgorithm key); internal abstract bool VerifySignature( -#if netcoreapp +#if netcoreapp || netstandard21 ReadOnlySpan valueHash, ReadOnlyMemory signature, #else @@ -42,7 +42,7 @@ namespace System.Security.Cryptography.Pkcs X509Certificate2 certificate); protected abstract bool Sign( -#if netcoreapp +#if netcoreapp || netstandard21 ReadOnlySpan dataHash, #else byte[] dataHash, @@ -70,7 +70,7 @@ namespace System.Security.Cryptography.Pkcs } internal static bool Sign( -#if netcoreapp +#if netcoreapp || netstandard21 ReadOnlySpan dataHash, #else byte[] dataHash, @@ -167,7 +167,7 @@ namespace System.Security.Cryptography.Pkcs { writer.PushSequence(); -#if netcoreapp +#if netcoreapp || netstandard21 // r BigInteger val = new BigInteger( ieeeSignature.Slice(0, fieldSize), diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/SignerInfo.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/SignerInfo.cs index b12b82f..e5eb555 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/SignerInfo.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/SignerInfo.cs @@ -594,7 +594,7 @@ namespace System.Security.Cryptography.Pkcs { writer.PopSequence(); -#if netcoreapp +#if netcoreapp || netstandard21 Span setOfTag = stackalloc byte[1]; setOfTag[0] = 0x31; @@ -610,7 +610,7 @@ namespace System.Security.Cryptography.Pkcs { writer.PopSetOf(); -#if netcoreapp +#if netcoreapp || netstandard21 hasher.AppendData(writer.EncodeAsSpan()); #else hasher.AppendData(writer.Encode()); @@ -703,7 +703,7 @@ namespace System.Security.Cryptography.Pkcs return false; } -#if netcoreapp +#if netcoreapp || netstandard21 // SHA-2-512 is the biggest digest type we know about. Span digestValue = stackalloc byte[512 / 8]; ReadOnlySpan digest = digestValue; diff --git a/src/libraries/ref.builds b/src/libraries/ref.builds index 55aeef0..0a497a0 100644 --- a/src/libraries/ref.builds +++ b/src/libraries/ref.builds @@ -2,7 +2,7 @@ - $(AdditionalBuildConfigurations);netstandard-$(OSGroup)-$(ConfigurationGroup)-$(ArchGroup) + $(AdditionalBuildConfigurations);netstandard-$(OSGroup)-$(ConfigurationGroup)-$(ArchGroup);netstandard2.1-$(OSGroup)-$(ConfigurationGroup) @@ -10,4 +10,4 @@ - \ No newline at end of file +