You've already forked linux-packaging-mono
Imported Upstream version 5.4.0.167
Former-commit-id: 5624ac747d633e885131e8349322922b6a59baaa
This commit is contained in:
parent
e49d6f06c0
commit
536cd135cc
@@ -2,7 +2,8 @@
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\dir.props" />
|
||||
<PropertyGroup>
|
||||
<AssemblyVersion>4.1.0.0</AssemblyVersion>
|
||||
<AssemblyVersion>4.1.1.0</AssemblyVersion>
|
||||
<AssemblyKey>MSFT</AssemblyKey>
|
||||
<IsNETCoreApp>true</IsNETCoreApp>
|
||||
<IsUAP>true</IsUAP>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -9,7 +9,6 @@ using System.Text;
|
||||
|
||||
namespace System.Security.Cryptography
|
||||
{
|
||||
[Serializable]
|
||||
public enum FromBase64TransformMode
|
||||
{
|
||||
IgnoreWhiteSpaces = 0,
|
||||
|
||||
@@ -124,10 +124,13 @@ namespace System.Security.Cryptography.Encoding.Tests
|
||||
Assert.Throws<ArgumentOutOfRangeException>(() => c.CopyTo(a, 3));
|
||||
Assert.Throws<ArgumentException>(() => c.CopyTo(a, 1));
|
||||
|
||||
// Array has non-zero lower bound
|
||||
ICollection ic = c;
|
||||
Array array = Array.CreateInstance(typeof(object), new int[] { 10 }, new int[] { 10 });
|
||||
Assert.Throws<IndexOutOfRangeException>(() => ic.CopyTo(array, 0));
|
||||
if (PlatformDetection.IsNonZeroLowerBoundArraySupported)
|
||||
{
|
||||
// Array has non-zero lower bound
|
||||
ICollection ic = c;
|
||||
Array array = Array.CreateInstance(typeof(object), new int[] { 10 }, new int[] { 10 });
|
||||
Assert.Throws<IndexOutOfRangeException>(() => ic.CopyTo(array, 0));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace System.Security.Cryptography.Encoding.Tests
|
||||
InvalidInput_Base64Transform(transform);
|
||||
|
||||
// These exceptions only thrown in ToBase
|
||||
Assert.Throws<ArgumentOutOfRangeException>("offsetOut", () => transform.TransformFinalBlock(data_5bytes, 0, 5));
|
||||
AssertExtensions.Throws<ArgumentOutOfRangeException>("offsetOut", () => transform.TransformFinalBlock(data_5bytes, 0, 5));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,15 +75,15 @@ namespace System.Security.Cryptography.Encoding.Tests
|
||||
{
|
||||
byte[] data_4bytes = Text.Encoding.ASCII.GetBytes("aaaa");
|
||||
|
||||
Assert.Throws<ArgumentNullException>("inputBuffer", () => transform.TransformBlock(null, 0, 0, null, 0));
|
||||
Assert.Throws<ArgumentOutOfRangeException>("inputOffset", () => transform.TransformBlock(Array.Empty<byte>(), -1, 0, null, 0));
|
||||
Assert.Throws<ArgumentNullException>("dst", () => transform.TransformBlock(data_4bytes, 0, 4, null, 0));
|
||||
AssertExtensions.Throws<ArgumentNullException>("inputBuffer", () => transform.TransformBlock(null, 0, 0, null, 0));
|
||||
AssertExtensions.Throws<ArgumentOutOfRangeException>("inputOffset", () => transform.TransformBlock(Array.Empty<byte>(), -1, 0, null, 0));
|
||||
AssertExtensions.Throws<ArgumentNullException>("dst", () => transform.TransformBlock(data_4bytes, 0, 4, null, 0));
|
||||
Assert.Throws<ArgumentException>(null, () => transform.TransformBlock(Array.Empty<byte>(), 0, 1, null, 0));
|
||||
Assert.Throws<ArgumentException>(null, () => transform.TransformBlock(Array.Empty<byte>(), 1, 0, null, 0));
|
||||
|
||||
Assert.Throws<ArgumentNullException>("inputBuffer", () => transform.TransformFinalBlock(null, 0, 0));
|
||||
Assert.Throws<ArgumentOutOfRangeException>("inputOffset", () => transform.TransformFinalBlock(Array.Empty<byte>(), -1, 0));
|
||||
Assert.Throws<ArgumentOutOfRangeException>("inputOffset", () => transform.TransformFinalBlock(Array.Empty<byte>(), -1, 0));
|
||||
AssertExtensions.Throws<ArgumentNullException>("inputBuffer", () => transform.TransformFinalBlock(null, 0, 0));
|
||||
AssertExtensions.Throws<ArgumentOutOfRangeException>("inputOffset", () => transform.TransformFinalBlock(Array.Empty<byte>(), -1, 0));
|
||||
AssertExtensions.Throws<ArgumentOutOfRangeException>("inputOffset", () => transform.TransformFinalBlock(Array.Empty<byte>(), -1, 0));
|
||||
Assert.Throws<ArgumentException>(null, () => transform.TransformFinalBlock(Array.Empty<byte>(), 1, 0));
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ namespace System.Security.Cryptography.Encoding.Tests
|
||||
Assert.True(inputBytes.Length > 4);
|
||||
|
||||
// Test passing blocks > 4 characters to TransformFinalBlock (not supported)
|
||||
Assert.Throws<ArgumentOutOfRangeException>("offsetOut", () => transform.TransformFinalBlock(inputBytes, 0, inputBytes.Length));
|
||||
AssertExtensions.Throws<ArgumentOutOfRangeException>("offsetOut", () => transform.TransformFinalBlock(inputBytes, 0, inputBytes.Length));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ namespace System.Security.Cryptography.Encoding.Tests
|
||||
additionalValidation?.Invoke(c);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNonZeroLowerBoundArraySupported))]
|
||||
public void CopyTo_NonZeroLowerBound_ThrowsIndexOutOfRangeException()
|
||||
{
|
||||
Oid item = new Oid(Sha1Oid, Sha1Name);
|
||||
|
||||
@@ -23,9 +23,15 @@
|
||||
<Compile Include="$(CommonPath)\System\Security\Cryptography\DerSequenceReader.cs">
|
||||
<Link>Common\System\Security\Cryptography\DerSequenceReader.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="$(CommonTestPath)\System\AssertExtensions.cs">
|
||||
<Link>Common\System\AssertExtensions.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="$(CommonTestPath)\System\PlatformDetection.cs">
|
||||
<Link>Common\System\PlatformDetection.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="$(CommonTestPath)\System\Security\Cryptography\ByteUtils.cs">
|
||||
<Link>CommonTest\System\Security\Cryptography\ByteUtils.cs</Link>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user