Update aspnet50/aspnetcore50 => dnx451/dnxcore50.
This commit is contained in:
parent
88eb10dcfe
commit
cb5e7d82f9
|
|
@ -7,7 +7,7 @@ using System.Runtime.CompilerServices;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
|
|
||||||
#if !ASPNETCORE50
|
#if !DNXCORE50
|
||||||
using System.Runtime.ConstrainedExecution;
|
using System.Runtime.ConstrainedExecution;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -53,7 +53,7 @@ namespace Microsoft.AspNet.Cryptography
|
||||||
}
|
}
|
||||||
|
|
||||||
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
|
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
|
||||||
#if !ASPNETCORE50
|
#if !DNXCORE50
|
||||||
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
|
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
|
||||||
#endif
|
#endif
|
||||||
public static bool TimeConstantBuffersAreEqual(byte* bufA, byte* bufB, uint count)
|
public static bool TimeConstantBuffersAreEqual(byte* bufA, byte* bufB, uint count)
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
#if ASPNETCORE50
|
#if DNXCORE50
|
||||||
namespace Microsoft.Win32.SafeHandles
|
namespace Microsoft.Win32.SafeHandles
|
||||||
{
|
{
|
||||||
internal abstract class SafeHandleZeroOrMinusOneIsInvalid : SafeHandle
|
internal abstract class SafeHandleZeroOrMinusOneIsInvalid : SafeHandle
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ using System.Runtime.InteropServices;
|
||||||
using System.Security;
|
using System.Security;
|
||||||
using Microsoft.Win32.SafeHandles;
|
using Microsoft.Win32.SafeHandles;
|
||||||
|
|
||||||
#if !ASPNETCORE50
|
#if !DNXCORE50
|
||||||
using System.Runtime.ConstrainedExecution;
|
using System.Runtime.ConstrainedExecution;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -127,12 +127,12 @@ namespace Microsoft.AspNet.Cryptography.SafeHandles
|
||||||
return UnsafeNativeMethods.FreeLibrary(handle);
|
return UnsafeNativeMethods.FreeLibrary(handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !ASPNETCORE50
|
#if !DNXCORE50
|
||||||
[SuppressUnmanagedCodeSecurity]
|
[SuppressUnmanagedCodeSecurity]
|
||||||
#endif
|
#endif
|
||||||
private static class UnsafeNativeMethods
|
private static class UnsafeNativeMethods
|
||||||
{
|
{
|
||||||
#if ASPNETCORE50
|
#if DNXCORE50
|
||||||
private const string CORE_LIBRARY_LOADER_LIB = "api-ms-win-core-libraryloader-l1-1-0.dll";
|
private const string CORE_LIBRARY_LOADER_LIB = "api-ms-win-core-libraryloader-l1-1-0.dll";
|
||||||
private const string CORE_LOCALIZATION_LIB = "api-ms-win-core-localization-l1-2-0.dll";
|
private const string CORE_LOCALIZATION_LIB = "api-ms-win-core-localization-l1-2-0.dll";
|
||||||
#else
|
#else
|
||||||
|
|
@ -140,7 +140,7 @@ namespace Microsoft.AspNet.Cryptography.SafeHandles
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// http://msdn.microsoft.com/en-us/library/windows/desktop/ms679351(v=vs.85).aspx
|
// http://msdn.microsoft.com/en-us/library/windows/desktop/ms679351(v=vs.85).aspx
|
||||||
#if ASPNETCORE50
|
#if DNXCORE50
|
||||||
[DllImport(CORE_LOCALIZATION_LIB, EntryPoint = "FormatMessageW", CallingConvention = CallingConvention.Winapi, CharSet = CharSet.Unicode, SetLastError = true)]
|
[DllImport(CORE_LOCALIZATION_LIB, EntryPoint = "FormatMessageW", CallingConvention = CallingConvention.Winapi, CharSet = CharSet.Unicode, SetLastError = true)]
|
||||||
#else
|
#else
|
||||||
[DllImport(KERNEL32_LIB, EntryPoint = "FormatMessageW", CallingConvention = CallingConvention.Winapi, CharSet = CharSet.Unicode, SetLastError = true)]
|
[DllImport(KERNEL32_LIB, EntryPoint = "FormatMessageW", CallingConvention = CallingConvention.Winapi, CharSet = CharSet.Unicode, SetLastError = true)]
|
||||||
|
|
@ -157,7 +157,7 @@ namespace Microsoft.AspNet.Cryptography.SafeHandles
|
||||||
|
|
||||||
// http://msdn.microsoft.com/en-us/library/ms683152(v=vs.85).aspx
|
// http://msdn.microsoft.com/en-us/library/ms683152(v=vs.85).aspx
|
||||||
[return: MarshalAs(UnmanagedType.Bool)]
|
[return: MarshalAs(UnmanagedType.Bool)]
|
||||||
#if ASPNETCORE50
|
#if DNXCORE50
|
||||||
[DllImport(CORE_LIBRARY_LOADER_LIB, CallingConvention = CallingConvention.Winapi, CharSet = CharSet.Unicode)]
|
[DllImport(CORE_LIBRARY_LOADER_LIB, CallingConvention = CallingConvention.Winapi, CharSet = CharSet.Unicode)]
|
||||||
#else
|
#else
|
||||||
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
|
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
|
||||||
|
|
@ -167,7 +167,7 @@ namespace Microsoft.AspNet.Cryptography.SafeHandles
|
||||||
|
|
||||||
// http://msdn.microsoft.com/en-us/library/ms683200(v=vs.85).aspx
|
// http://msdn.microsoft.com/en-us/library/ms683200(v=vs.85).aspx
|
||||||
[return: MarshalAs(UnmanagedType.Bool)]
|
[return: MarshalAs(UnmanagedType.Bool)]
|
||||||
#if ASPNETCORE50
|
#if DNXCORE50
|
||||||
[DllImport(CORE_LIBRARY_LOADER_LIB, EntryPoint = "GetModuleHandleExW", CallingConvention = CallingConvention.Winapi, SetLastError = true)]
|
[DllImport(CORE_LIBRARY_LOADER_LIB, EntryPoint = "GetModuleHandleExW", CallingConvention = CallingConvention.Winapi, SetLastError = true)]
|
||||||
#else
|
#else
|
||||||
[DllImport(KERNEL32_LIB, EntryPoint = "GetModuleHandleExW", CallingConvention = CallingConvention.Winapi, SetLastError = true)]
|
[DllImport(KERNEL32_LIB, EntryPoint = "GetModuleHandleExW", CallingConvention = CallingConvention.Winapi, SetLastError = true)]
|
||||||
|
|
@ -178,7 +178,7 @@ namespace Microsoft.AspNet.Cryptography.SafeHandles
|
||||||
[Out] out IntPtr phModule);
|
[Out] out IntPtr phModule);
|
||||||
|
|
||||||
// http://msdn.microsoft.com/en-us/library/ms683212(v=vs.85).aspx
|
// http://msdn.microsoft.com/en-us/library/ms683212(v=vs.85).aspx
|
||||||
#if ASPNETCORE50
|
#if DNXCORE50
|
||||||
[DllImport(CORE_LIBRARY_LOADER_LIB, CallingConvention = CallingConvention.Winapi, SetLastError = true)]
|
[DllImport(CORE_LIBRARY_LOADER_LIB, CallingConvention = CallingConvention.Winapi, SetLastError = true)]
|
||||||
#else
|
#else
|
||||||
[DllImport(KERNEL32_LIB, CallingConvention = CallingConvention.Winapi, SetLastError = true)]
|
[DllImport(KERNEL32_LIB, CallingConvention = CallingConvention.Winapi, SetLastError = true)]
|
||||||
|
|
@ -188,7 +188,7 @@ namespace Microsoft.AspNet.Cryptography.SafeHandles
|
||||||
[In, MarshalAs(UnmanagedType.LPStr)] string lpProcName);
|
[In, MarshalAs(UnmanagedType.LPStr)] string lpProcName);
|
||||||
|
|
||||||
// http://msdn.microsoft.com/en-us/library/windows/desktop/ms684179(v=vs.85).aspx
|
// http://msdn.microsoft.com/en-us/library/windows/desktop/ms684179(v=vs.85).aspx
|
||||||
#if ASPNETCORE50
|
#if DNXCORE50
|
||||||
[DllImport(CORE_LIBRARY_LOADER_LIB, EntryPoint = "LoadLibraryExW", CallingConvention = CallingConvention.Winapi, SetLastError = true)]
|
[DllImport(CORE_LIBRARY_LOADER_LIB, EntryPoint = "LoadLibraryExW", CallingConvention = CallingConvention.Winapi, SetLastError = true)]
|
||||||
#else
|
#else
|
||||||
[DllImport(KERNEL32_LIB, EntryPoint = "LoadLibraryExW", CallingConvention = CallingConvention.Winapi, SetLastError = true)]
|
[DllImport(KERNEL32_LIB, EntryPoint = "LoadLibraryExW", CallingConvention = CallingConvention.Winapi, SetLastError = true)]
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ using System;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using Microsoft.Win32.SafeHandles;
|
using Microsoft.Win32.SafeHandles;
|
||||||
|
|
||||||
#if ASPNETCORE50
|
#if DNXCORE50
|
||||||
namespace Microsoft.AspNet.Cryptography.SafeHandles
|
namespace Microsoft.AspNet.Cryptography.SafeHandles
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ using System.Runtime.CompilerServices;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Security;
|
using System.Security;
|
||||||
|
|
||||||
#if !ASPNETCORE50
|
#if !DNXCORE50
|
||||||
using System.Runtime.ConstrainedExecution;
|
using System.Runtime.ConstrainedExecution;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -43,7 +43,7 @@ namespace Microsoft.AspNet.Cryptography.SafeHandles
|
||||||
return newHandle;
|
return newHandle;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !ASPNETCORE50
|
#if !DNXCORE50
|
||||||
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
|
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
|
||||||
#endif
|
#endif
|
||||||
private void AllocateImpl(IntPtr cb)
|
private void AllocateImpl(IntPtr cb)
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ using System.Runtime.CompilerServices;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using Microsoft.AspNet.Cryptography.SafeHandles;
|
using Microsoft.AspNet.Cryptography.SafeHandles;
|
||||||
|
|
||||||
#if !ASPNETCORE50
|
#if !DNXCORE50
|
||||||
using System.Runtime.ConstrainedExecution;
|
using System.Runtime.ConstrainedExecution;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -17,7 +17,7 @@ namespace Microsoft.AspNet.Cryptography
|
||||||
private static readonly byte[] _emptyArray = new byte[0];
|
private static readonly byte[] _emptyArray = new byte[0];
|
||||||
|
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
#if !ASPNETCORE50
|
#if !DNXCORE50
|
||||||
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
|
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
|
||||||
#endif
|
#endif
|
||||||
public static void BlockCopy(void* from, void* to, int byteCount)
|
public static void BlockCopy(void* from, void* to, int byteCount)
|
||||||
|
|
@ -26,7 +26,7 @@ namespace Microsoft.AspNet.Cryptography
|
||||||
}
|
}
|
||||||
|
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
#if !ASPNETCORE50
|
#if !DNXCORE50
|
||||||
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
|
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
|
||||||
#endif
|
#endif
|
||||||
public static void BlockCopy(void* from, void* to, uint byteCount)
|
public static void BlockCopy(void* from, void* to, uint byteCount)
|
||||||
|
|
@ -37,7 +37,7 @@ namespace Microsoft.AspNet.Cryptography
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !ASPNETCORE50
|
#if !DNXCORE50
|
||||||
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
|
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
|
||||||
#endif
|
#endif
|
||||||
public static void BlockCopy(LocalAllocHandle from, void* to, uint byteCount)
|
public static void BlockCopy(LocalAllocHandle from, void* to, uint byteCount)
|
||||||
|
|
@ -57,7 +57,7 @@ namespace Microsoft.AspNet.Cryptography
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !ASPNETCORE50
|
#if !DNXCORE50
|
||||||
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
|
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
|
||||||
#endif
|
#endif
|
||||||
public static void BlockCopy(byte* from, LocalAllocHandle to, uint byteCount)
|
public static void BlockCopy(byte* from, LocalAllocHandle to, uint byteCount)
|
||||||
|
|
@ -77,7 +77,7 @@ namespace Microsoft.AspNet.Cryptography
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !ASPNETCORE50
|
#if !DNXCORE50
|
||||||
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
|
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
|
||||||
#endif
|
#endif
|
||||||
public static void BlockCopy(LocalAllocHandle from, LocalAllocHandle to, IntPtr length)
|
public static void BlockCopy(LocalAllocHandle from, LocalAllocHandle to, IntPtr length)
|
||||||
|
|
@ -117,7 +117,7 @@ namespace Microsoft.AspNet.Cryptography
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
private static void BlockCopyImpl(byte* from, byte* to, uint byteCount)
|
private static void BlockCopyImpl(byte* from, byte* to, uint byteCount)
|
||||||
{
|
{
|
||||||
#if ASPNETCORE50
|
#if DNXCORE50
|
||||||
Buffer.MemoryCopy(from, to, (ulong)byteCount, (ulong)byteCount);
|
Buffer.MemoryCopy(from, to, (ulong)byteCount, (ulong)byteCount);
|
||||||
#else
|
#else
|
||||||
while (byteCount-- != 0) {
|
while (byteCount-- != 0) {
|
||||||
|
|
@ -129,7 +129,7 @@ namespace Microsoft.AspNet.Cryptography
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
private static void BlockCopyImpl(byte* from, byte* to, ulong byteCount)
|
private static void BlockCopyImpl(byte* from, byte* to, ulong byteCount)
|
||||||
{
|
{
|
||||||
#if ASPNETCORE50
|
#if DNXCORE50
|
||||||
Buffer.MemoryCopy(from, to, byteCount, byteCount);
|
Buffer.MemoryCopy(from, to, byteCount, byteCount);
|
||||||
#else
|
#else
|
||||||
while (byteCount-- != 0) {
|
while (byteCount-- != 0) {
|
||||||
|
|
@ -142,7 +142,7 @@ namespace Microsoft.AspNet.Cryptography
|
||||||
/// Securely clears a memory buffer.
|
/// Securely clears a memory buffer.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
#if !ASPNETCORE50
|
#if !DNXCORE50
|
||||||
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
|
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
|
||||||
#endif
|
#endif
|
||||||
public static void SecureZeroMemory(byte* buffer, int byteCount)
|
public static void SecureZeroMemory(byte* buffer, int byteCount)
|
||||||
|
|
@ -154,7 +154,7 @@ namespace Microsoft.AspNet.Cryptography
|
||||||
/// Securely clears a memory buffer.
|
/// Securely clears a memory buffer.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
#if !ASPNETCORE50
|
#if !DNXCORE50
|
||||||
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
|
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
|
||||||
#endif
|
#endif
|
||||||
public static void SecureZeroMemory(byte* buffer, uint byteCount)
|
public static void SecureZeroMemory(byte* buffer, uint byteCount)
|
||||||
|
|
@ -175,7 +175,7 @@ namespace Microsoft.AspNet.Cryptography
|
||||||
/// Securely clears a memory buffer.
|
/// Securely clears a memory buffer.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
#if !ASPNETCORE50
|
#if !DNXCORE50
|
||||||
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
|
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
|
||||||
#endif
|
#endif
|
||||||
public static void SecureZeroMemory(byte* buffer, ulong byteCount)
|
public static void SecureZeroMemory(byte* buffer, ulong byteCount)
|
||||||
|
|
@ -195,7 +195,7 @@ namespace Microsoft.AspNet.Cryptography
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Securely clears a memory buffer.
|
/// Securely clears a memory buffer.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
#if !ASPNETCORE50
|
#if !DNXCORE50
|
||||||
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
|
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
|
||||||
#endif
|
#endif
|
||||||
public static void SecureZeroMemory(byte* buffer, IntPtr length)
|
public static void SecureZeroMemory(byte* buffer, IntPtr length)
|
||||||
|
|
|
||||||
|
|
@ -12,13 +12,13 @@ using Microsoft.AspNet.Cryptography.Cng;
|
||||||
using Microsoft.AspNet.Cryptography.SafeHandles;
|
using Microsoft.AspNet.Cryptography.SafeHandles;
|
||||||
using Microsoft.Win32.SafeHandles;
|
using Microsoft.Win32.SafeHandles;
|
||||||
|
|
||||||
#if !ASPNETCORE50
|
#if !DNXCORE50
|
||||||
using System.Runtime.ConstrainedExecution;
|
using System.Runtime.ConstrainedExecution;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace Microsoft.AspNet.Cryptography
|
namespace Microsoft.AspNet.Cryptography
|
||||||
{
|
{
|
||||||
#if !ASPNETCORE50
|
#if !DNXCORE50
|
||||||
[SuppressUnmanagedCodeSecurity]
|
[SuppressUnmanagedCodeSecurity]
|
||||||
#endif
|
#endif
|
||||||
internal unsafe static class UnsafeNativeMethods
|
internal unsafe static class UnsafeNativeMethods
|
||||||
|
|
@ -87,7 +87,7 @@ namespace Microsoft.AspNet.Cryptography
|
||||||
[In] uint dwFlags);
|
[In] uint dwFlags);
|
||||||
|
|
||||||
[DllImport(BCRYPT_LIB, CallingConvention = CallingConvention.Winapi)]
|
[DllImport(BCRYPT_LIB, CallingConvention = CallingConvention.Winapi)]
|
||||||
#if !ASPNETCORE50
|
#if !DNXCORE50
|
||||||
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
|
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
|
||||||
#endif
|
#endif
|
||||||
// http://msdn.microsoft.com/en-us/library/windows/desktop/aa375399(v=vs.85).aspx
|
// http://msdn.microsoft.com/en-us/library/windows/desktop/aa375399(v=vs.85).aspx
|
||||||
|
|
@ -95,7 +95,7 @@ namespace Microsoft.AspNet.Cryptography
|
||||||
[In] IntPtr hHash);
|
[In] IntPtr hHash);
|
||||||
|
|
||||||
[DllImport(BCRYPT_LIB, CallingConvention = CallingConvention.Winapi)]
|
[DllImport(BCRYPT_LIB, CallingConvention = CallingConvention.Winapi)]
|
||||||
#if !ASPNETCORE50
|
#if !DNXCORE50
|
||||||
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
|
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
|
||||||
#endif
|
#endif
|
||||||
// http://msdn.microsoft.com/en-us/library/windows/desktop/aa375404(v=vs.85).aspx
|
// http://msdn.microsoft.com/en-us/library/windows/desktop/aa375404(v=vs.85).aspx
|
||||||
|
|
@ -202,7 +202,7 @@ namespace Microsoft.AspNet.Cryptography
|
||||||
*/
|
*/
|
||||||
|
|
||||||
[DllImport(CRYPT32_LIB, CallingConvention = CallingConvention.Winapi)]
|
[DllImport(CRYPT32_LIB, CallingConvention = CallingConvention.Winapi)]
|
||||||
#if !ASPNETCORE50
|
#if !DNXCORE50
|
||||||
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
|
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
|
||||||
#endif
|
#endif
|
||||||
// http://msdn.microsoft.com/en-us/library/windows/desktop/aa376045(v=vs.85).aspx
|
// http://msdn.microsoft.com/en-us/library/windows/desktop/aa376045(v=vs.85).aspx
|
||||||
|
|
@ -210,7 +210,7 @@ namespace Microsoft.AspNet.Cryptography
|
||||||
[In] IntPtr pCertContext);
|
[In] IntPtr pCertContext);
|
||||||
|
|
||||||
[DllImport(CRYPT32_LIB, CallingConvention = CallingConvention.Winapi)]
|
[DllImport(CRYPT32_LIB, CallingConvention = CallingConvention.Winapi)]
|
||||||
#if !ASPNETCORE50
|
#if !DNXCORE50
|
||||||
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
|
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
|
||||||
#endif
|
#endif
|
||||||
// http://msdn.microsoft.com/en-us/library/windows/desktop/aa376075(v=vs.85).aspx
|
// http://msdn.microsoft.com/en-us/library/windows/desktop/aa376075(v=vs.85).aspx
|
||||||
|
|
@ -227,7 +227,7 @@ namespace Microsoft.AspNet.Cryptography
|
||||||
|
|
||||||
[DllImport(CRYPT32_LIB, CallingConvention = CallingConvention.Winapi, SetLastError = true)]
|
[DllImport(CRYPT32_LIB, CallingConvention = CallingConvention.Winapi, SetLastError = true)]
|
||||||
// http://msdn.microsoft.com/en-us/library/windows/desktop/aa379885(v=vs.85).aspx
|
// http://msdn.microsoft.com/en-us/library/windows/desktop/aa379885(v=vs.85).aspx
|
||||||
#if !ASPNETCORE50
|
#if !DNXCORE50
|
||||||
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
|
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
|
||||||
#endif
|
#endif
|
||||||
internal static extern bool CryptAcquireCertificatePrivateKey(
|
internal static extern bool CryptAcquireCertificatePrivateKey(
|
||||||
|
|
@ -286,7 +286,7 @@ namespace Microsoft.AspNet.Cryptography
|
||||||
*/
|
*/
|
||||||
|
|
||||||
[DllImport(NCRYPT_LIB, CallingConvention = CallingConvention.Winapi)]
|
[DllImport(NCRYPT_LIB, CallingConvention = CallingConvention.Winapi)]
|
||||||
#if !ASPNETCORE50
|
#if !DNXCORE50
|
||||||
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
|
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
|
||||||
#endif
|
#endif
|
||||||
// http://msdn.microsoft.com/en-us/library/windows/desktop/hh706799(v=vs.85).aspx
|
// http://msdn.microsoft.com/en-us/library/windows/desktop/hh706799(v=vs.85).aspx
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"version": "1.0.0-*",
|
"version": "1.0.0-*",
|
||||||
"description": "Infrastructure for ASP.NET 5 cryptographic packages. Developers should not reference this package.",
|
"description": "Infrastructure for ASP.NET 5 cryptographic packages. Developers should not reference this package.",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
},
|
},
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"net451": { },
|
"net451": { },
|
||||||
"aspnet50": { },
|
"dnx451": { },
|
||||||
"aspnetcore50": {
|
"dnxcore50": {
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"System.Diagnostics.Debug": "4.0.10-beta-*",
|
"System.Diagnostics.Debug": "4.0.10-beta-*",
|
||||||
"System.Globalization": "4.0.10-beta-*",
|
"System.Globalization": "4.0.10-beta-*",
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
{
|
||||||
"version": "1.0.0-*",
|
"version": "1.0.0-*",
|
||||||
"description": "ASP.NET 5 utilities for key derivation.",
|
"description": "ASP.NET 5 utilities for key derivation.",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
@ -6,8 +6,8 @@
|
||||||
},
|
},
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"net451": { },
|
"net451": { },
|
||||||
"aspnet50": { },
|
"dnx451": { },
|
||||||
"aspnetcore50": {
|
"dnxcore50": {
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"System.Runtime.Extensions": "4.0.10-beta-*",
|
"System.Runtime.Extensions": "4.0.10-beta-*",
|
||||||
"System.Security.Cryptography.Hashing.Algorithms": "4.0.0-beta-*"
|
"System.Security.Cryptography.Hashing.Algorithms": "4.0.0-beta-*"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
{
|
||||||
"version": "1.0.0-*",
|
"version": "1.0.0-*",
|
||||||
"description": "ASP.NET 5 blob storage repository for DataProtection.",
|
"description": "ASP.NET 5 blob storage repository for DataProtection.",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
},
|
},
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"net451": {},
|
"net451": {},
|
||||||
"aspnet50": {}
|
"dnx451": {}
|
||||||
},
|
},
|
||||||
"compilationOptions": {
|
"compilationOptions": {
|
||||||
"warningsAsErrors": true
|
"warningsAsErrors": true
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ namespace Microsoft.AspNet.DataProtection.Cng
|
||||||
};
|
};
|
||||||
DATA_BLOB dataOut = default(DATA_BLOB);
|
DATA_BLOB dataOut = default(DATA_BLOB);
|
||||||
|
|
||||||
#if !ASPNETCORE50
|
#if !DNXCORE50
|
||||||
RuntimeHelpers.PrepareConstrainedRegions();
|
RuntimeHelpers.PrepareConstrainedRegions();
|
||||||
#endif
|
#endif
|
||||||
try
|
try
|
||||||
|
|
@ -152,7 +152,7 @@ namespace Microsoft.AspNet.DataProtection.Cng
|
||||||
fixed (byte* pbRetVal = retVal)
|
fixed (byte* pbRetVal = retVal)
|
||||||
{
|
{
|
||||||
bool handleAcquired = false;
|
bool handleAcquired = false;
|
||||||
#if !ASPNETCORE50
|
#if !DNXCORE50
|
||||||
RuntimeHelpers.PrepareConstrainedRegions();
|
RuntimeHelpers.PrepareConstrainedRegions();
|
||||||
#endif
|
#endif
|
||||||
try
|
try
|
||||||
|
|
@ -202,7 +202,7 @@ namespace Microsoft.AspNet.DataProtection.Cng
|
||||||
};
|
};
|
||||||
DATA_BLOB dataOut = default(DATA_BLOB);
|
DATA_BLOB dataOut = default(DATA_BLOB);
|
||||||
|
|
||||||
#if !ASPNETCORE50
|
#if !DNXCORE50
|
||||||
RuntimeHelpers.PrepareConstrainedRegions();
|
RuntimeHelpers.PrepareConstrainedRegions();
|
||||||
#endif
|
#endif
|
||||||
try
|
try
|
||||||
|
|
@ -275,7 +275,7 @@ namespace Microsoft.AspNet.DataProtection.Cng
|
||||||
using (unencryptedPayloadHandle)
|
using (unencryptedPayloadHandle)
|
||||||
{
|
{
|
||||||
bool handleAcquired = false;
|
bool handleAcquired = false;
|
||||||
#if !ASPNETCORE50
|
#if !DNXCORE50
|
||||||
RuntimeHelpers.PrepareConstrainedRegions();
|
RuntimeHelpers.PrepareConstrainedRegions();
|
||||||
#endif
|
#endif
|
||||||
try
|
try
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,7 @@ namespace Microsoft.Framework.DependencyInjection
|
||||||
|
|
||||||
private static DirectoryInfo TryGetLocalAppDataKeysFolderForUser()
|
private static DirectoryInfo TryGetLocalAppDataKeysFolderForUser()
|
||||||
{
|
{
|
||||||
#if !ASPNETCORE50
|
#if !DNXCORE50
|
||||||
// Environment.GetFolderPath returns null if the user profile isn't loaded.
|
// Environment.GetFolderPath returns null if the user profile isn't loaded.
|
||||||
string folderPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
|
string folderPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
|
||||||
if (!String.IsNullOrEmpty(folderPath))
|
if (!String.IsNullOrEmpty(folderPath))
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
// We only define this type in core CLR since desktop CLR already contains it.
|
// We only define this type in core CLR since desktop CLR already contains it.
|
||||||
#if ASPNETCORE50
|
#if DNXCORE50
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace System.Security.Cryptography
|
namespace System.Security.Cryptography
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ namespace Microsoft.AspNet.DataProtection.Dpapi
|
||||||
{
|
{
|
||||||
public byte[] Protect(byte[] userData, byte[] optionalEntropy, DataProtectionScope scope)
|
public byte[] Protect(byte[] userData, byte[] optionalEntropy, DataProtectionScope scope)
|
||||||
{
|
{
|
||||||
#if ASPNETCORE50
|
#if DNXCORE50
|
||||||
fixed (byte* pbUserData = userData)
|
fixed (byte* pbUserData = userData)
|
||||||
{
|
{
|
||||||
fixed (byte* pbOptionalEntropy = optionalEntropy)
|
fixed (byte* pbOptionalEntropy = optionalEntropy)
|
||||||
|
|
@ -31,7 +31,7 @@ namespace Microsoft.AspNet.DataProtection.Dpapi
|
||||||
|
|
||||||
public byte[] Unprotect(byte[] encryptedData, byte[] optionalEntropy, DataProtectionScope scope)
|
public byte[] Unprotect(byte[] encryptedData, byte[] optionalEntropy, DataProtectionScope scope)
|
||||||
{
|
{
|
||||||
#if ASPNETCORE50
|
#if DNXCORE50
|
||||||
Secret blob;
|
Secret blob;
|
||||||
fixed (byte* pbEncryptedData = encryptedData)
|
fixed (byte* pbEncryptedData = encryptedData)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -357,7 +357,7 @@ namespace Microsoft.AspNet.DataProtection.Managed
|
||||||
|
|
||||||
using (var validationAlgorithm = CreateValidationAlgorithm(validationSubkey))
|
using (var validationAlgorithm = CreateValidationAlgorithm(validationSubkey))
|
||||||
{
|
{
|
||||||
#if !ASPNETCORE50
|
#if !DNXCORE50
|
||||||
// As an optimization, avoid duplicating the underlying buffer if we're on desktop CLR.
|
// As an optimization, avoid duplicating the underlying buffer if we're on desktop CLR.
|
||||||
byte[] underlyingBuffer = outputStream.GetBuffer();
|
byte[] underlyingBuffer = outputStream.GetBuffer();
|
||||||
#else
|
#else
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ namespace Microsoft.AspNet.DataProtection.XmlEncryption
|
||||||
using (var memoryStream = new MemoryStream())
|
using (var memoryStream = new MemoryStream())
|
||||||
{
|
{
|
||||||
plaintextElement.Save(memoryStream);
|
plaintextElement.Save(memoryStream);
|
||||||
#if !ASPNETCORE50
|
#if !DNXCORE50
|
||||||
// If we're on full desktop CLR, utilize the underlying buffer directly as an optimization.
|
// If we're on full desktop CLR, utilize the underlying buffer directly as an optimization.
|
||||||
byte[] underlyingBuffer = memoryStream.GetBuffer();
|
byte[] underlyingBuffer = memoryStream.GetBuffer();
|
||||||
secret = new Secret(new ArraySegment<byte>(underlyingBuffer, 0, checked((int)memoryStream.Length)));
|
secret = new Secret(new ArraySegment<byte>(underlyingBuffer, 0, checked((int)memoryStream.Length)));
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ namespace Microsoft.AspNet.DataProtection.XmlEncryption
|
||||||
{
|
{
|
||||||
plaintextElement.Save(memoryStream);
|
plaintextElement.Save(memoryStream);
|
||||||
|
|
||||||
#if !ASPNETCORE50
|
#if !DNXCORE50
|
||||||
// If we're on full desktop CLR, utilize the underlying buffer directly as an optimization.
|
// If we're on full desktop CLR, utilize the underlying buffer directly as an optimization.
|
||||||
byte[] underlyingBuffer = memoryStream.GetBuffer();
|
byte[] underlyingBuffer = memoryStream.GetBuffer();
|
||||||
secret = new Secret(new ArraySegment<byte>(underlyingBuffer, 0, checked((int)memoryStream.Length)));
|
secret = new Secret(new ArraySegment<byte>(underlyingBuffer, 0, checked((int)memoryStream.Length)));
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
{
|
||||||
"version": "1.0.0-*",
|
"version": "1.0.0-*",
|
||||||
"description": "ASP.NET 5 logic to protect and unprotect data, similar to DPAPI.",
|
"description": "ASP.NET 5 logic to protect and unprotect data, similar to DPAPI.",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
@ -14,14 +14,14 @@
|
||||||
"System.Xml.Linq": ""
|
"System.Xml.Linq": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"aspnet50": {
|
"dnx451": {
|
||||||
"frameworkAssemblies": {
|
"frameworkAssemblies": {
|
||||||
"System.Security": "",
|
"System.Security": "",
|
||||||
"System.Xml": "",
|
"System.Xml": "",
|
||||||
"System.Xml.Linq": ""
|
"System.Xml.Linq": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"aspnetcore50": {
|
"dnxcore50": {
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.Win32.Registry": "4.0.0-beta-*",
|
"Microsoft.Win32.Registry": "4.0.0-beta-*",
|
||||||
"System.IO": "4.0.10-beta-*",
|
"System.IO": "4.0.10-beta-*",
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.AspNet.Cryptography.Internal": "1.0.0-*",
|
"Microsoft.AspNet.Cryptography.Internal": "1.0.0-*",
|
||||||
"Microsoft.AspNet.Testing": "1.0.0-*",
|
"Microsoft.AspNet.Testing": "1.0.0-*",
|
||||||
"xunit.runner.kre": "1.0.0-*"
|
"xunit.runner.kre": "1.0.0-*"
|
||||||
},
|
},
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"aspnet50": { }
|
"dnx451": { }
|
||||||
},
|
},
|
||||||
"commands": {
|
"commands": {
|
||||||
"test": "xunit.runner.kre"
|
"test": "xunit.runner.kre"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.AspNet.Cryptography.Internal": "1.0.0-*",
|
"Microsoft.AspNet.Cryptography.Internal": "1.0.0-*",
|
||||||
"Microsoft.AspNet.Cryptography.KeyDerivation": "1.0.0-*",
|
"Microsoft.AspNet.Cryptography.KeyDerivation": "1.0.0-*",
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
"xunit.runner.kre": "1.0.0-*"
|
"xunit.runner.kre": "1.0.0-*"
|
||||||
},
|
},
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"aspnet50": { }
|
"dnx451": { }
|
||||||
},
|
},
|
||||||
"commands": {
|
"commands": {
|
||||||
"test": "xunit.runner.kre"
|
"test": "xunit.runner.kre"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.AspNet.DataProtection": "1.0.0-*",
|
"Microsoft.AspNet.DataProtection": "1.0.0-*",
|
||||||
"Microsoft.AspNet.Testing": "1.0.0-*",
|
"Microsoft.AspNet.Testing": "1.0.0-*",
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
"xunit.runner.kre": "1.0.0-*"
|
"xunit.runner.kre": "1.0.0-*"
|
||||||
},
|
},
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"aspnet50": { }
|
"dnx451": { }
|
||||||
},
|
},
|
||||||
"commands": {
|
"commands": {
|
||||||
"test": "xunit.runner.kre"
|
"test": "xunit.runner.kre"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue