We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cc31e6e commit 0bbd48dCopy full SHA for 0bbd48d
1 file changed
src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptEncryptDecrypt.RSA.cs
@@ -3,6 +3,7 @@
3
4
using System;
5
using System.Runtime.InteropServices;
6
+using System.Security.Cryptography;
7
8
using Microsoft.Win32.SafeHandles;
9
@@ -117,6 +118,14 @@ private static unsafe bool BCryptDecryptRsa(
117
118
dwFlags);
119
}
120
121
+ // Windows 10.1903 can return success when it meant NTE_BUFFER_TOO_SMALL.
122
+ if (status == NTSTATUS.STATUS_SUCCESS && written > destination.Length)
123
+ {
124
+ CryptographicOperations.ZeroMemory(destination);
125
+ bytesWritten = 0;
126
+ return false;
127
+ }
128
+
129
if (status == NTSTATUS.STATUS_SUCCESS)
130
{
131
bytesWritten = written;
0 commit comments