Skip to content

Commit e9d858b

Browse files
authored
Merge branch 'release/8.0-staging' into merge/release/8.0-to-release/8.0-staging
2 parents a5e9bb7 + 5acd05e commit e9d858b

File tree

24 files changed

+446
-2736
lines changed

24 files changed

+446
-2736
lines changed

Directory.Build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@
114114
<NetFrameworkCurrent Condition="'$(DotNetBuildFromSource)' == 'true'" />
115115

116116
<!-- Important: Set this to the GA version (or a close approximation) during servicing and adjust the TFM property below. -->
117-
<ApiCompatNetCoreAppBaselineVersion>7.0.0</ApiCompatNetCoreAppBaselineVersion>
118-
<ApiCompatNetCoreAppBaselineTFM>net7.0</ApiCompatNetCoreAppBaselineTFM>
117+
<ApiCompatNetCoreAppBaselineVersion>8.0.0</ApiCompatNetCoreAppBaselineVersion>
118+
<ApiCompatNetCoreAppBaselineTFM>net8.0</ApiCompatNetCoreAppBaselineTFM>
119119

120120
<TargetFrameworkForNETFrameworkTasks>$(NetFrameworkToolCurrent)</TargetFrameworkForNETFrameworkTasks>
121121
<!-- Don't build for NETFramework during source-build. -->

eng/Version.Details.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,9 +383,13 @@
383383
<Uri>https://github.com/dotnet/roslyn-analyzers</Uri>
384384
<Sha>b4d9a1334d5189172977ba8fddd00bda70161e4a</Sha>
385385
</Dependency>
386-
<Dependency Name="Microsoft.DotNet.ApiCompat.Task" Version="8.0.100-rtm.23520.8">
386+
<Dependency Name="Microsoft.DotNet.ApiCompat.Task" Version="8.0.100">
387387
<Uri>https://github.com/dotnet/sdk</Uri>
388-
<Sha>7e33fd449381b337c290a801057fdcd68c4b7220</Sha>
388+
<Sha>e9d13cbe7e8c1d52ce276a8655f52a87e1017c46</Sha>
389+
</Dependency>
390+
<Dependency Name="Microsoft.SourceBuild.Intermediate.sdk" Version="8.0.100-rtm.23551.6">
391+
<Uri>https://github.com/dotnet/sdk</Uri>
392+
<Sha>e9d13cbe7e8c1d52ce276a8655f52a87e1017c46</Sha>
389393
<SourceBuild RepoName="sdk" ManagedOnly="true" />
390394
</Dependency>
391395
<Dependency Name="optimization.windows_nt-arm64.MIBC.Runtime" Version="1.0.0-prerelease.23525.5">

eng/Versions.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<MinorVersion>0</MinorVersion>
88
<PatchVersion>1</PatchVersion>
99
<SdkBandVersion>8.0.100</SdkBandVersion>
10-
<PackageVersionNet7>7.0.14</PackageVersionNet7>
10+
<PackageVersionNet7>7.0.$([MSBuild]::Add($(PatchVersion),14))</PackageVersionNet7>
1111
<PackageVersionNet6>6.0.$([MSBuild]::Add($([System.Version]::Parse('$(PackageVersionNet7)').Build),11))</PackageVersionNet6>
1212
<PreReleaseVersionLabel>servicing</PreReleaseVersionLabel>
1313
<PreReleaseVersionIteration>
@@ -85,7 +85,7 @@
8585
<PropertyGroup>
8686
<StaticCsVersion>0.2.0</StaticCsVersion>
8787
<!-- SDK dependencies -->
88-
<MicrosoftDotNetApiCompatTaskVersion>8.0.100-rtm.23520.8</MicrosoftDotNetApiCompatTaskVersion>
88+
<MicrosoftDotNetApiCompatTaskVersion>8.0.100</MicrosoftDotNetApiCompatTaskVersion>
8989
<!-- Arcade dependencies -->
9090
<MicrosoftDotNetBuildTasksFeedVersion>8.0.0-beta.23556.5</MicrosoftDotNetBuildTasksFeedVersion>
9191
<MicrosoftDotNetCodeAnalysisVersion>8.0.0-beta.23556.5</MicrosoftDotNetCodeAnalysisVersion>
@@ -127,7 +127,7 @@
127127
<SystemCollectionsImmutableVersion>7.0.0</SystemCollectionsImmutableVersion>
128128
<SystemComponentModelAnnotationsVersion>5.0.0</SystemComponentModelAnnotationsVersion>
129129
<SystemDataSqlClientVersion>4.8.5</SystemDataSqlClientVersion>
130-
<SystemDrawingCommonVersion>7.0.0</SystemDrawingCommonVersion>
130+
<SystemDrawingCommonVersion>8.0.0</SystemDrawingCommonVersion>
131131
<SystemIOFileSystemAccessControlVersion>5.0.0</SystemIOFileSystemAccessControlVersion>
132132
<SystemMemoryVersion>4.5.5</SystemMemoryVersion>
133133
<SystemReflectionMetadataVersion>7.0.0</SystemReflectionMetadataVersion>

eng/packaging.targets

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
'$(SuppressFinalPackageVersion)' == 'true' or
1212
'$(DotNetBuildFromSource)' == 'true'">true</DisablePackageBaselineValidation>
1313
<PackageValidationBaselineVersion Condition="'$(PackageValidationBaselineVersion)' == ''">$(ApiCompatNetCoreAppBaselineVersion)</PackageValidationBaselineVersion>
14+
1415
<BeforePack>$(BeforePack);IncludeAnalyzersInPackage;AddNETStandardCompatErrorFileForPackaging</BeforePack>
1516
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);AddRuntimeSpecificFilesToPackage;IncludeProjectReferencesWithPackAttributeInPackage</TargetsForTfmSpecificContentInPackage>
1617
<!-- Don't include target platform specific dependencies, since we use the target platform to represent RIDs instead -->
@@ -37,6 +38,13 @@
3738
<BuildProjectReferences Condition="'$(NoBuild)' == 'true'">false</BuildProjectReferences>
3839
</PropertyGroup>
3940

41+
<PropertyGroup Condition="'$(PreReleaseVersionLabel)' == 'servicing'">
42+
<!-- In servicing, the live package is compared against the GA version in strict mode. -->
43+
<EnableStrictModeForBaselineValidation>true</EnableStrictModeForBaselineValidation>
44+
<!-- In servicing, disable the APICompat rule that validates that the assembly versions must match. -->
45+
<NoWarn>$(NoWarn);CP0003</NoWarn>
46+
</PropertyGroup>
47+
4048
<PropertyGroup Condition="'$(PreReleaseVersionLabel)' == 'servicing' and
4149
'$(PackageUseIncrementalServicingVersion)' == 'true'">
4250
<!-- If no servicing version is set we need to default to 0 in order for dependency versions to

src/coreclr/gc/gc.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10069,7 +10069,6 @@ void gc_heap::update_ro_segment (heap_segment* seg, uint8_t* allocated, uint8_t*
1006910069
{
1007010070
enter_spin_lock (&gc_heap::gc_lock);
1007110071

10072-
assert (use_frozen_segments_p);
1007310072
assert (heap_segment_read_only_p (seg));
1007410073
assert (allocated <= committed);
1007510074
assert (committed <= heap_segment_reserved (seg));

src/coreclr/nativeaot/Runtime/gcrhenv.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -749,10 +749,12 @@ void GCToEEInterface::DiagGCEnd(size_t index, int gen, int reason, bool fConcurr
749749
UNREFERENCED_PARAMETER(gen);
750750
UNREFERENCED_PARAMETER(reason);
751751

752+
#ifdef FEATURE_EVENT_TRACE
752753
if (!fConcurrent)
753754
{
754755
ETW::GCLog::WalkHeap();
755756
}
757+
#endif // FEATURE_EVENT_TRACE
756758
}
757759

758760
// Note on last parameter: when calling this for bgc, only ETW

src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptSignHash.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
using System;
55
using System.Runtime.InteropServices;
6+
using Internal.Cryptography;
67

78
using Microsoft.Win32.SafeHandles;
89

@@ -30,7 +31,7 @@ internal static unsafe NTSTATUS BCryptSignHashPkcs1(
3031
{
3132
fixed (char* pHashAlgorithmName = hashAlgorithmName)
3233
fixed (byte* pHash = &MemoryMarshal.GetReference(hash))
33-
fixed (byte* pDest = &MemoryMarshal.GetReference(destination))
34+
fixed (byte* pDest = &Helpers.GetNonNullPinnableReference(destination))
3435
{
3536
BCRYPT_PKCS1_PADDING_INFO paddingInfo = default;
3637
paddingInfo.pszAlgId = (IntPtr)pHashAlgorithmName;
@@ -56,7 +57,7 @@ internal static unsafe NTSTATUS BCryptSignHashPss(
5657
{
5758
fixed (char* pHashAlgorithmName = hashAlgorithmName)
5859
fixed (byte* pHash = &MemoryMarshal.GetReference(hash))
59-
fixed (byte* pDest = &MemoryMarshal.GetReference(destination))
60+
fixed (byte* pDest = &Helpers.GetNonNullPinnableReference(destination))
6061
{
6162
BCRYPT_PSS_PADDING_INFO paddingInfo = default;
6263
paddingInfo.pszAlgId = (IntPtr)pHashAlgorithmName;

src/libraries/Common/src/Interop/Windows/NCrypt/Interop.SignVerify.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,24 @@
33

44
using System;
55
using System.Runtime.InteropServices;
6+
using Internal.Cryptography;
67
using Microsoft.Win32.SafeHandles;
78

89
internal static partial class Interop
910
{
1011
internal static partial class NCrypt
1112
{
1213
[LibraryImport(Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
13-
internal static unsafe partial ErrorCode NCryptSignHash(SafeNCryptKeyHandle hKey, void* pPaddingInfo, ReadOnlySpan<byte> pbHashValue, int cbHashValue, Span<byte> pbSignature, int cbSignature, out int pcbResult, AsymmetricPaddingMode dwFlags);
14+
private static unsafe partial ErrorCode NCryptSignHash(SafeNCryptKeyHandle hKey, void* pPaddingInfo, byte* pbHashValue, int cbHashValue, byte* pbSignature, int cbSignature, out int pcbResult, AsymmetricPaddingMode dwFlags);
15+
16+
internal static unsafe ErrorCode NCryptSignHash(SafeNCryptKeyHandle hKey, void* pPaddingInfo, ReadOnlySpan<byte> pbHashValue, Span<byte> pbSignature, out int pcbResult, AsymmetricPaddingMode dwFlags)
17+
{
18+
fixed (byte* pHash = &MemoryMarshal.GetReference(pbHashValue))
19+
fixed (byte* pSignature = &Helpers.GetNonNullPinnableReference(pbSignature))
20+
{
21+
return NCryptSignHash(hKey, pPaddingInfo, pHash, pbHashValue.Length, pSignature, pbSignature.Length, out pcbResult, dwFlags);
22+
}
23+
}
1424

1525
[LibraryImport(Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)]
1626
internal static unsafe partial ErrorCode NCryptVerifySignature(SafeNCryptKeyHandle hKey, void* pPaddingInfo, ReadOnlySpan<byte> pbHashValue, int cbHashValue, ReadOnlySpan<byte> pbSignature, int cbSignature, AsymmetricPaddingMode dwFlags);

src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DSASignVerify.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,25 @@ public void Verify2048WithSha1()
391391
}
392392
}
393393

394+
[Fact]
395+
public void SignData_NullSignature_Fails()
396+
{
397+
using (DSA dsa = DSAFactory.Create())
398+
{
399+
dsa.ImportParameters(DSATestData.GetDSA1024Params());
400+
401+
bool result = dsa.TrySignData(
402+
"hello"u8,
403+
(Span<byte>)null,
404+
HashAlgorithmName.SHA1,
405+
DSASignatureFormat.IeeeP1363FixedFieldConcatenation,
406+
out int bytesWritten);
407+
408+
Assert.False(result);
409+
Assert.Equal(0, bytesWritten);
410+
}
411+
}
412+
394413
private void SignAndVerify(byte[] data, string hashAlgorithmName, DSAParameters dsaParameters, int expectedSignatureLength)
395414
{
396415
using (DSA dsa = DSAFactory.Create())

src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaTests.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,32 @@ public void VerifyHash_InvalidArguments_Throws(ECDsa ecdsa)
8686
AssertExtensions.Throws<ArgumentNullException>("hash", () => ecdsa.VerifyHash(null, null));
8787
AssertExtensions.Throws<ArgumentNullException>("signature", () => ecdsa.VerifyHash(new byte[0], null));
8888
}
89+
90+
[Theory]
91+
[MemberData(nameof(RealImplementations))]
92+
public void SignHash_NullSignature_Fails(ECDsa ecdsa)
93+
{
94+
byte[] hash = RandomNumberGenerator.GetBytes(SHA256.HashSizeInBytes);
95+
96+
AssertExtensions.Throws<ArgumentException>("destination", () =>
97+
ecdsa.SignHash(hash, (Span<byte>)null, DSASignatureFormat.IeeeP1363FixedFieldConcatenation));
98+
99+
bool result = ecdsa.TrySignHash(hash, (Span<byte>)null, DSASignatureFormat.IeeeP1363FixedFieldConcatenation, out int bytesWritten);
100+
Assert.False(result);
101+
Assert.Equal(0, bytesWritten);
102+
}
103+
104+
[Theory]
105+
[MemberData(nameof(RealImplementations))]
106+
public void SignData_NullSignature_Fails(ECDsa ecdsa)
107+
{
108+
AssertExtensions.Throws<ArgumentException>("destination", () =>
109+
ecdsa.SignData("hello"u8, (Span<byte>)null, HashAlgorithmName.SHA256, DSASignatureFormat.IeeeP1363FixedFieldConcatenation));
110+
111+
bool result = ecdsa.TrySignData("hello"u8, (Span<byte>)null, HashAlgorithmName.SHA256, DSASignatureFormat.IeeeP1363FixedFieldConcatenation, out int bytesWritten);
112+
Assert.False(result);
113+
Assert.Equal(0, bytesWritten);
114+
}
89115
}
90116

91117
[SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")]

0 commit comments

Comments
 (0)