diff options
Diffstat (limited to 'crypto/src/tls/TlsProtocol.cs')
-rw-r--r-- | crypto/src/tls/TlsProtocol.cs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/crypto/src/tls/TlsProtocol.cs b/crypto/src/tls/TlsProtocol.cs index b5a955bed..3461e9b58 100644 --- a/crypto/src/tls/TlsProtocol.cs +++ b/crypto/src/tls/TlsProtocol.cs @@ -1362,7 +1362,12 @@ namespace Org.BouncyCastle.Tls SecurityParameters securityParameters = context.SecurityParameters; bool isServerContext = context.IsServer; +#if NETCOREAPP2_1_OR_GREATER || NETSTANDARD2_1_OR_GREATER + Span<byte> verify_data = stackalloc byte[securityParameters.VerifyDataLength]; + TlsUtilities.ReadFully(verify_data, buf); +#else byte[] verify_data = TlsUtilities.ReadFully(securityParameters.VerifyDataLength, buf); +#endif AssertEmpty(buf); @@ -1397,7 +1402,12 @@ namespace Org.BouncyCastle.Tls SecurityParameters securityParameters = context.SecurityParameters; bool isServerContext = context.IsServer; +#if NETCOREAPP2_1_OR_GREATER || NETSTANDARD2_1_OR_GREATER + Span<byte> verify_data = stackalloc byte[securityParameters.VerifyDataLength]; + TlsUtilities.ReadFully(verify_data, buf); +#else byte[] verify_data = TlsUtilities.ReadFully(securityParameters.VerifyDataLength, buf); +#endif AssertEmpty(buf); |