diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json
index 2b469ddd92bcee..058644afd46753 100644
--- a/.config/dotnet-tools.json
+++ b/.config/dotnet-tools.json
@@ -15,7 +15,7 @@
]
},
"microsoft.dotnet.xharness.cli": {
- "version": "9.0.0-prerelease.25103.3",
+ "version": "9.0.0-prerelease.25113.3",
"commands": [
"xharness"
]
diff --git a/NuGet.config b/NuGet.config
index 7a77a883fb2871..deafa2a01414c9 100644
--- a/NuGet.config
+++ b/NuGet.config
@@ -9,28 +9,10 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
-
+
https://github.com/dotnet/cecil
- aa3ae0d49da3cfb31a383f16303a3f2f0c3f1a19
+ 8debcd23b73a27992a5fdb2229f546e453619d11
-
+
https://github.com/dotnet/emsdk
- dad5528e5bdf92a05a5a404c5f7939523390b96d
+ 78be8cdf4f0bfd93018fd7a87f8282a41d041298
-
+
https://github.com/dotnet/emsdk
- dad5528e5bdf92a05a5a404c5f7939523390b96d
+ 78be8cdf4f0bfd93018fd7a87f8282a41d041298
-
+
https://github.com/dotnet/emsdk
- dad5528e5bdf92a05a5a404c5f7939523390b96d
+ 78be8cdf4f0bfd93018fd7a87f8282a41d041298
@@ -92,195 +92,195 @@
-
+
https://github.com/dotnet/arcade
- bac7e1caea791275b7c3ccb4cb75fd6a04a26618
+ f33d9e642f0e68a61312164cd9e0baf4e142a999
-
+
https://github.com/dotnet/arcade
- bac7e1caea791275b7c3ccb4cb75fd6a04a26618
+ f33d9e642f0e68a61312164cd9e0baf4e142a999
-
+
https://github.com/dotnet/arcade
- bac7e1caea791275b7c3ccb4cb75fd6a04a26618
+ f33d9e642f0e68a61312164cd9e0baf4e142a999
-
+
https://github.com/dotnet/arcade
- bac7e1caea791275b7c3ccb4cb75fd6a04a26618
+ f33d9e642f0e68a61312164cd9e0baf4e142a999
-
+
https://github.com/dotnet/arcade
- bac7e1caea791275b7c3ccb4cb75fd6a04a26618
+ f33d9e642f0e68a61312164cd9e0baf4e142a999
-
+
https://github.com/dotnet/arcade
- bac7e1caea791275b7c3ccb4cb75fd6a04a26618
+ f33d9e642f0e68a61312164cd9e0baf4e142a999
-
+
https://github.com/dotnet/arcade
- bac7e1caea791275b7c3ccb4cb75fd6a04a26618
+ f33d9e642f0e68a61312164cd9e0baf4e142a999
-
+
https://github.com/dotnet/arcade
- bac7e1caea791275b7c3ccb4cb75fd6a04a26618
+ f33d9e642f0e68a61312164cd9e0baf4e142a999
-
+
https://github.com/dotnet/arcade
- bac7e1caea791275b7c3ccb4cb75fd6a04a26618
+ f33d9e642f0e68a61312164cd9e0baf4e142a999
-
+
https://github.com/dotnet/arcade
- bac7e1caea791275b7c3ccb4cb75fd6a04a26618
+ f33d9e642f0e68a61312164cd9e0baf4e142a999
-
+
https://github.com/dotnet/arcade
- bac7e1caea791275b7c3ccb4cb75fd6a04a26618
+ f33d9e642f0e68a61312164cd9e0baf4e142a999
-
+
https://github.com/dotnet/arcade
- bac7e1caea791275b7c3ccb4cb75fd6a04a26618
+ f33d9e642f0e68a61312164cd9e0baf4e142a999
-
+
https://github.com/dotnet/arcade
- bac7e1caea791275b7c3ccb4cb75fd6a04a26618
+ f33d9e642f0e68a61312164cd9e0baf4e142a999
-
+
https://github.com/dotnet/arcade
- bac7e1caea791275b7c3ccb4cb75fd6a04a26618
+ f33d9e642f0e68a61312164cd9e0baf4e142a999
-
+
https://github.com/dotnet/arcade
- bac7e1caea791275b7c3ccb4cb75fd6a04a26618
+ f33d9e642f0e68a61312164cd9e0baf4e142a999
-
+
https://github.com/dotnet/arcade
- bac7e1caea791275b7c3ccb4cb75fd6a04a26618
+ f33d9e642f0e68a61312164cd9e0baf4e142a999
-
+
https://github.com/dotnet/arcade
- bac7e1caea791275b7c3ccb4cb75fd6a04a26618
+ f33d9e642f0e68a61312164cd9e0baf4e142a999
-
+
https://github.com/dotnet/arcade
- bac7e1caea791275b7c3ccb4cb75fd6a04a26618
+ f33d9e642f0e68a61312164cd9e0baf4e142a999
-
+
https://github.com/dotnet/arcade
- bac7e1caea791275b7c3ccb4cb75fd6a04a26618
+ f33d9e642f0e68a61312164cd9e0baf4e142a999
-
+
https://github.com/dotnet/arcade
- bac7e1caea791275b7c3ccb4cb75fd6a04a26618
+ f33d9e642f0e68a61312164cd9e0baf4e142a999
-
+
https://github.com/dotnet/runtime-assets
- ceeaaca3ae019d656421fdf49fc2dde5f29c9d09
+ 739921bd3405841c06d3f74701c9e6ccfbd19e2e
-
+
https://github.com/dotnet/runtime-assets
- ceeaaca3ae019d656421fdf49fc2dde5f29c9d09
+ 739921bd3405841c06d3f74701c9e6ccfbd19e2e
-
+
https://github.com/dotnet/runtime-assets
- ceeaaca3ae019d656421fdf49fc2dde5f29c9d09
+ 739921bd3405841c06d3f74701c9e6ccfbd19e2e
-
+
https://github.com/dotnet/runtime-assets
- ceeaaca3ae019d656421fdf49fc2dde5f29c9d09
+ 739921bd3405841c06d3f74701c9e6ccfbd19e2e
-
+
https://github.com/dotnet/runtime-assets
- ceeaaca3ae019d656421fdf49fc2dde5f29c9d09
+ 739921bd3405841c06d3f74701c9e6ccfbd19e2e
-
+
https://github.com/dotnet/runtime-assets
- ceeaaca3ae019d656421fdf49fc2dde5f29c9d09
+ 739921bd3405841c06d3f74701c9e6ccfbd19e2e
-
+
https://github.com/dotnet/runtime-assets
- ceeaaca3ae019d656421fdf49fc2dde5f29c9d09
+ 739921bd3405841c06d3f74701c9e6ccfbd19e2e
-
+
https://github.com/dotnet/runtime-assets
- ceeaaca3ae019d656421fdf49fc2dde5f29c9d09
+ 739921bd3405841c06d3f74701c9e6ccfbd19e2e
-
+
https://github.com/dotnet/runtime-assets
- ceeaaca3ae019d656421fdf49fc2dde5f29c9d09
+ 739921bd3405841c06d3f74701c9e6ccfbd19e2e
-
+
https://github.com/dotnet/runtime-assets
- ceeaaca3ae019d656421fdf49fc2dde5f29c9d09
+ 739921bd3405841c06d3f74701c9e6ccfbd19e2e
-
+
https://github.com/dotnet/runtime-assets
- ceeaaca3ae019d656421fdf49fc2dde5f29c9d09
+ 739921bd3405841c06d3f74701c9e6ccfbd19e2e
-
+
https://github.com/dotnet/runtime-assets
- ceeaaca3ae019d656421fdf49fc2dde5f29c9d09
+ 739921bd3405841c06d3f74701c9e6ccfbd19e2e
-
+
https://github.com/dotnet/runtime-assets
- ceeaaca3ae019d656421fdf49fc2dde5f29c9d09
+ 739921bd3405841c06d3f74701c9e6ccfbd19e2e
-
+
https://github.com/dotnet/llvm-project
- d1f598a5c2922be959c9a21cd50adc2fa780f064
+ f98a0db595fe3f28dac4594acc7114b16281d090
-
+
https://github.com/dotnet/llvm-project
- d1f598a5c2922be959c9a21cd50adc2fa780f064
+ f98a0db595fe3f28dac4594acc7114b16281d090
-
+
https://github.com/dotnet/llvm-project
- d1f598a5c2922be959c9a21cd50adc2fa780f064
+ f98a0db595fe3f28dac4594acc7114b16281d090
-
+
https://github.com/dotnet/llvm-project
- d1f598a5c2922be959c9a21cd50adc2fa780f064
+ f98a0db595fe3f28dac4594acc7114b16281d090
-
+
https://github.com/dotnet/llvm-project
- d1f598a5c2922be959c9a21cd50adc2fa780f064
+ f98a0db595fe3f28dac4594acc7114b16281d090
-
+
https://github.com/dotnet/llvm-project
- d1f598a5c2922be959c9a21cd50adc2fa780f064
+ f98a0db595fe3f28dac4594acc7114b16281d090
-
+
https://github.com/dotnet/llvm-project
- d1f598a5c2922be959c9a21cd50adc2fa780f064
+ f98a0db595fe3f28dac4594acc7114b16281d090
-
+
https://github.com/dotnet/llvm-project
- d1f598a5c2922be959c9a21cd50adc2fa780f064
+ f98a0db595fe3f28dac4594acc7114b16281d090
-
+
https://github.com/dotnet/llvm-project
- d1f598a5c2922be959c9a21cd50adc2fa780f064
+ f98a0db595fe3f28dac4594acc7114b16281d090
-
+
https://github.com/dotnet/llvm-project
- d1f598a5c2922be959c9a21cd50adc2fa780f064
+ f98a0db595fe3f28dac4594acc7114b16281d090
-
+
https://github.com/dotnet/llvm-project
- d1f598a5c2922be959c9a21cd50adc2fa780f064
+ f98a0db595fe3f28dac4594acc7114b16281d090
-
+
https://github.com/dotnet/llvm-project
- d1f598a5c2922be959c9a21cd50adc2fa780f064
+ f98a0db595fe3f28dac4594acc7114b16281d090
-
+
https://github.com/dotnet/llvm-project
- d1f598a5c2922be959c9a21cd50adc2fa780f064
+ f98a0db595fe3f28dac4594acc7114b16281d090
-
+
https://github.com/dotnet/llvm-project
- d1f598a5c2922be959c9a21cd50adc2fa780f064
+ f98a0db595fe3f28dac4594acc7114b16281d090
https://github.com/dotnet/runtime
@@ -320,21 +320,21 @@
https://github.com/dotnet/runtime
b030c4dfdfa1bf287f10f96006619a06bc2000ae
-
+
https://github.com/dotnet/xharness
- 22a44bd14f5d6308acdda4b6dd67e4d7aa0bca5b
+ edc52ac68c1bf77e3b107fc8a448674a6d058d8a
-
+
https://github.com/dotnet/xharness
- 22a44bd14f5d6308acdda4b6dd67e4d7aa0bca5b
+ edc52ac68c1bf77e3b107fc8a448674a6d058d8a
-
+
https://github.com/dotnet/xharness
- 22a44bd14f5d6308acdda4b6dd67e4d7aa0bca5b
+ edc52ac68c1bf77e3b107fc8a448674a6d058d8a
-
+
https://github.com/dotnet/arcade
- bac7e1caea791275b7c3ccb4cb75fd6a04a26618
+ f33d9e642f0e68a61312164cd9e0baf4e142a999
https://dev.azure.com/dnceng/internal/_git/dotnet-optimization
@@ -352,48 +352,48 @@
https://dev.azure.com/dnceng/internal/_git/dotnet-optimization
9d7532585ce71e30ab55f0364d3cecccaf0775d1
-
+
https://github.com/dotnet/hotreload-utils
- fe67b0da4c0a7e82f0f9a4da1cb966c730e6934f
+ fd21b154f1152569e7fa49a4e030927eccbf4aaa
-
+
https://github.com/dotnet/runtime-assets
- ceeaaca3ae019d656421fdf49fc2dde5f29c9d09
+ 739921bd3405841c06d3f74701c9e6ccfbd19e2e
-
+
https://github.com/dotnet/roslyn
- 25acc509a1cb1d1a4923b0091cbc5ce837b024d0
+ 3f5cf9fbbd91f2047e988801a5142ca1cb6bab45
-
+
https://github.com/dotnet/roslyn
- 25acc509a1cb1d1a4923b0091cbc5ce837b024d0
+ 3f5cf9fbbd91f2047e988801a5142ca1cb6bab45
-
+
https://github.com/dotnet/roslyn
- 25acc509a1cb1d1a4923b0091cbc5ce837b024d0
+ 3f5cf9fbbd91f2047e988801a5142ca1cb6bab45
-
+
https://github.com/dotnet/roslyn-analyzers
16865ea61910500f1022ad2b96c499e5df02c228
-
+
https://github.com/dotnet/roslyn-analyzers
16865ea61910500f1022ad2b96c499e5df02c228
-
+
https://github.com/dotnet/roslyn
- 25acc509a1cb1d1a4923b0091cbc5ce837b024d0
+ 3f5cf9fbbd91f2047e988801a5142ca1cb6bab45
-
+
https://github.com/dotnet/sdk
- 049799c39d766c58ef6388865d5f5ed273b6a75e
+ 346d06baea1cf7113e181e779b056b955973c633
-
+
https://github.com/dotnet/sdk
- 049799c39d766c58ef6388865d5f5ed273b6a75e
+ 346d06baea1cf7113e181e779b056b955973c633
diff --git a/eng/Versions.props b/eng/Versions.props
index 9bc7f6caeff393..8ba353723841c2 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -1,11 +1,11 @@
- 9.0.3
+ 9.0.4
9
0
- 3
+ 4
9.0.100
8.0.$([MSBuild]::Add($(PatchVersion),11))
7.0.20
@@ -36,17 +36,17 @@
- 3.11.0-beta1.25076.3
- 9.0.0-preview.25076.3
+ 3.11.0-beta1.25123.3
+ 9.0.0-preview.25123.3
- 4.12.0-3.25105.5
- 4.12.0-3.25105.5
- 4.12.0-3.25105.5
+ 4.12.0-3.25124.2
+ 4.12.0-3.25124.2
+ 4.12.0-3.25124.2
- 9.0.103
+ 9.0.104
- 9.0.0-beta.25077.4
- 9.0.0-beta.25077.4
- 9.0.0-beta.25077.4
- 9.0.0-beta.25077.4
- 2.9.0-beta.25077.4
- 9.0.0-beta.25077.4
- 2.9.0-beta.25077.4
- 9.0.0-beta.25077.4
- 9.0.0-beta.25077.4
- 9.0.0-beta.25077.4
- 9.0.0-beta.25077.4
- 9.0.0-beta.25077.4
- 9.0.0-beta.25077.4
- 9.0.0-beta.25077.4
- 9.0.0-beta.25077.4
- 9.0.0-beta.25077.4
+ 9.0.0-beta.25161.4
+ 9.0.0-beta.25161.4
+ 9.0.0-beta.25161.4
+ 9.0.0-beta.25161.4
+ 2.9.0-beta.25161.4
+ 9.0.0-beta.25161.4
+ 2.9.0-beta.25161.4
+ 9.0.0-beta.25161.4
+ 9.0.0-beta.25161.4
+ 9.0.0-beta.25161.4
+ 9.0.0-beta.25161.4
+ 9.0.0-beta.25161.4
+ 9.0.0-beta.25161.4
+ 9.0.0-beta.25161.4
+ 9.0.0-beta.25161.4
+ 9.0.0-beta.25161.4
1.4.0
@@ -141,20 +141,20 @@
8.0.0
8.0.0
- 9.0.0-beta.25071.2
- 9.0.0-beta.25071.2
- 9.0.0-beta.25071.2
- 9.0.0-beta.25071.2
- 9.0.0-beta.25071.2
- 9.0.0-beta.25071.2
- 9.0.0-beta.25071.2
- 9.0.0-beta.25071.2
- 9.0.0-beta.25071.2
- 9.0.0-beta.25071.2
- 9.0.0-beta.25071.2
- 9.0.0-beta.25071.2
- 9.0.0-beta.25071.2
- 9.0.0-beta.25071.2
+ 9.0.0-beta.25113.2
+ 9.0.0-beta.25113.2
+ 9.0.0-beta.25113.2
+ 9.0.0-beta.25113.2
+ 9.0.0-beta.25113.2
+ 9.0.0-beta.25113.2
+ 9.0.0-beta.25113.2
+ 9.0.0-beta.25113.2
+ 9.0.0-beta.25113.2
+ 9.0.0-beta.25113.2
+ 9.0.0-beta.25113.2
+ 9.0.0-beta.25113.2
+ 9.0.0-beta.25113.2
+ 9.0.0-beta.25113.2
1.0.0-prerelease.24462.2
1.0.0-prerelease.24462.2
@@ -184,10 +184,10 @@
1.4.0
17.4.0-preview-20220707-01
- 9.0.0-prerelease.25103.3
- 9.0.0-prerelease.25103.3
- 9.0.0-prerelease.25103.3
- 9.0.0-alpha.0.25077.3
+ 9.0.0-prerelease.25113.3
+ 9.0.0-prerelease.25113.3
+ 9.0.0-prerelease.25113.3
+ 9.0.0-alpha.0.25153.2
3.12.0
4.5.0
6.0.0
@@ -215,55 +215,55 @@
9.0.0-preview-20241010.1
- 0.11.5-alpha.25102.5
+ 0.11.5-alpha.25112.2
9.0.0-rtm.24511.16
- 9.0.0-rtm.25105.1
+ 9.0.0-rtm.25157.1
9.0.0-rtm.24466.4
- 2.4.3
+ 2.4.8
9.0.0-alpha.1.24167.3
- 19.1.0-alpha.1.24575.1
- 19.1.0-alpha.1.24575.1
- 19.1.0-alpha.1.24575.1
- 19.1.0-alpha.1.24575.1
- 19.1.0-alpha.1.24575.1
- 19.1.0-alpha.1.24575.1
- 19.1.0-alpha.1.24575.1
- 19.1.0-alpha.1.24575.1
- 19.1.0-alpha.1.24575.1
- 19.1.0-alpha.1.24575.1
- 19.1.0-alpha.1.24575.1
- 19.1.0-alpha.1.24575.1
- 19.1.0-alpha.1.24575.1
- 19.1.0-alpha.1.24575.1
+ 19.1.0-alpha.1.25113.2
+ 19.1.0-alpha.1.25113.2
+ 19.1.0-alpha.1.25113.2
+ 19.1.0-alpha.1.25113.2
+ 19.1.0-alpha.1.25113.2
+ 19.1.0-alpha.1.25113.2
+ 19.1.0-alpha.1.25113.2
+ 19.1.0-alpha.1.25113.2
+ 19.1.0-alpha.1.25113.2
+ 19.1.0-alpha.1.25113.2
+ 19.1.0-alpha.1.25113.2
+ 19.1.0-alpha.1.25113.2
+ 19.1.0-alpha.1.25113.2
+ 19.1.0-alpha.1.25113.2
- 9.0.3-servicing.25105.2
- 9.0.3
+ 9.0.4-servicing.25157.2
+ 9.0.4
$(MicrosoftNETWorkloadEmscriptenCurrentManifest90100Version)
1.1.87-gba258badda
1.0.0-v3.14.0.5722
- 19.1.0-alpha.1.24575.1
- 19.1.0-alpha.1.24575.1
- 19.1.0-alpha.1.24575.1
- 19.1.0-alpha.1.24575.1
- 19.1.0-alpha.1.24575.1
- 19.1.0-alpha.1.24575.1
- 19.1.0-alpha.1.24575.1
- 19.1.0-alpha.1.24575.1
+ 19.1.0-alpha.1.25113.2
+ 19.1.0-alpha.1.25113.2
+ 19.1.0-alpha.1.25113.2
+ 19.1.0-alpha.1.25113.2
+ 19.1.0-alpha.1.25113.2
+ 19.1.0-alpha.1.25113.2
+ 19.1.0-alpha.1.25113.2
+ 19.1.0-alpha.1.25113.2
3.1.7
1.0.406601
-
- 9.0.102
+ $(MicrosoftDotNetApiCompatTaskVersion)
+
9.0.0-alpha.1.24175.1
$(MicrosoftNETRuntimeEmscriptenVersion)
$(runtimewinx64MicrosoftNETCoreRuntimeWasmNodeTransportPackageVersion)
diff --git a/eng/common/core-templates/steps/generate-sbom.yml b/eng/common/core-templates/steps/generate-sbom.yml
index d938b60e1bb534..56a090094824f4 100644
--- a/eng/common/core-templates/steps/generate-sbom.yml
+++ b/eng/common/core-templates/steps/generate-sbom.yml
@@ -38,7 +38,7 @@ steps:
PackageName: ${{ parameters.packageName }}
BuildDropPath: ${{ parameters.buildDropPath }}
PackageVersion: ${{ parameters.packageVersion }}
- ManifestDirPath: ${{ parameters.manifestDirPath }}
+ ManifestDirPath: ${{ parameters.manifestDirPath }}/$(ARTIFACT_NAME)
${{ if ne(parameters.IgnoreDirectories, '') }}:
AdditionalComponentDetectorArgs: '--IgnoreDirectories ${{ parameters.IgnoreDirectories }}'
diff --git a/eng/common/generate-sbom-prep.ps1 b/eng/common/generate-sbom-prep.ps1
index 3e5c1c74a1c50d..a0c7d792a76fbe 100644
--- a/eng/common/generate-sbom-prep.ps1
+++ b/eng/common/generate-sbom-prep.ps1
@@ -4,18 +4,26 @@ Param(
. $PSScriptRoot\pipeline-logging-functions.ps1
+# Normally - we'd listen to the manifest path given, but 1ES templates will overwrite if this level gets uploaded directly
+# with their own overwriting ours. So we create it as a sub directory of the requested manifest path.
+$ArtifactName = "${env:SYSTEM_STAGENAME}_${env:AGENT_JOBNAME}_SBOM"
+$SafeArtifactName = $ArtifactName -replace '["/:<>\\|?@*"() ]', '_'
+$SbomGenerationDir = Join-Path $ManifestDirPath $SafeArtifactName
+
+Write-Host "Artifact name before : $ArtifactName"
+Write-Host "Artifact name after : $SafeArtifactName"
+
Write-Host "Creating dir $ManifestDirPath"
+
# create directory for sbom manifest to be placed
-if (!(Test-Path -path $ManifestDirPath))
+if (!(Test-Path -path $SbomGenerationDir))
{
- New-Item -ItemType Directory -path $ManifestDirPath
- Write-Host "Successfully created directory $ManifestDirPath"
+ New-Item -ItemType Directory -path $SbomGenerationDir
+ Write-Host "Successfully created directory $SbomGenerationDir"
}
else{
Write-PipelineTelemetryError -category 'Build' "Unable to create sbom folder."
}
Write-Host "Updating artifact name"
-$artifact_name = "${env:SYSTEM_STAGENAME}_${env:AGENT_JOBNAME}_SBOM" -replace '["/:<>\\|?@*"() ]', '_'
-Write-Host "Artifact name $artifact_name"
-Write-Host "##vso[task.setvariable variable=ARTIFACT_NAME]$artifact_name"
+Write-Host "##vso[task.setvariable variable=ARTIFACT_NAME]$SafeArtifactName"
diff --git a/eng/common/generate-sbom-prep.sh b/eng/common/generate-sbom-prep.sh
index d5c76dc827b496..b8ecca72bbf506 100644
--- a/eng/common/generate-sbom-prep.sh
+++ b/eng/common/generate-sbom-prep.sh
@@ -14,19 +14,24 @@ done
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
. $scriptroot/pipeline-logging-functions.sh
+
+# replace all special characters with _, some builds use special characters like : in Agent.Jobname, that is not a permissible name while uploading artifacts.
+artifact_name=$SYSTEM_STAGENAME"_"$AGENT_JOBNAME"_SBOM"
+safe_artifact_name="${artifact_name//["/:<>\\|?@*$" ]/_}"
manifest_dir=$1
-if [ ! -d "$manifest_dir" ] ; then
- mkdir -p "$manifest_dir"
- echo "Sbom directory created." $manifest_dir
+# Normally - we'd listen to the manifest path given, but 1ES templates will overwrite if this level gets uploaded directly
+# with their own overwriting ours. So we create it as a sub directory of the requested manifest path.
+sbom_generation_dir="$manifest_dir/$safe_artifact_name"
+
+if [ ! -d "$sbom_generation_dir" ] ; then
+ mkdir -p "$sbom_generation_dir"
+ echo "Sbom directory created." $sbom_generation_dir
else
Write-PipelineTelemetryError -category 'Build' "Unable to create sbom folder."
fi
-artifact_name=$SYSTEM_STAGENAME"_"$AGENT_JOBNAME"_SBOM"
echo "Artifact name before : "$artifact_name
-# replace all special characters with _, some builds use special characters like : in Agent.Jobname, that is not a permissible name while uploading artifacts.
-safe_artifact_name="${artifact_name//["/:<>\\|?@*$" ]/_}"
echo "Artifact name after : "$safe_artifact_name
export ARTIFACT_NAME=$safe_artifact_name
echo "##vso[task.setvariable variable=ARTIFACT_NAME]$safe_artifact_name"
diff --git a/eng/common/templates-official/job/job.yml b/eng/common/templates-official/job/job.yml
index 605692d2fb770c..817555505aa602 100644
--- a/eng/common/templates-official/job/job.yml
+++ b/eng/common/templates-official/job/job.yml
@@ -16,6 +16,7 @@ jobs:
parameters:
PackageVersion: ${{ parameters.packageVersion }}
BuildDropPath: ${{ parameters.buildDropPath }}
+ ManifestDirPath: $(Build.ArtifactStagingDirectory)/sbom
publishArtifacts: false
# publish artifacts
diff --git a/eng/install-native-dependencies.sh b/eng/install-native-dependencies.sh
index 41895e0b9254c8..f8c9db632860de 100755
--- a/eng/install-native-dependencies.sh
+++ b/eng/install-native-dependencies.sh
@@ -44,7 +44,7 @@ case "$os" in
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
# Skip brew update for now, see https://github.com/actions/setup-python/issues/577
# brew update --preinstall
- brew bundle --no-upgrade --no-lock --file "$(dirname "$0")/Brewfile"
+ brew bundle --no-upgrade --file "$(dirname "$0")/Brewfile"
;;
*)
diff --git a/eng/packaging.targets b/eng/packaging.targets
index 0bef49c86a16e7..a14c954df54dbc 100644
--- a/eng/packaging.targets
+++ b/eng/packaging.targets
@@ -133,7 +133,7 @@
- <_RuntimeSymbolPath Include="$(RuntimeSymbolPath)" />
+ <_RuntimeSymbolPath Include="@(TfmRuntimeSpecificPackageFile->'%(RootDir)%(Directory)%(FileName).pdb')" Condition="'%(TfmRuntimeSpecificPackageFile.Extension)' == '.dll'" KeepMetadata="None" />
true
-
-
- false
-
-
diff --git a/src/coreclr/.nuget/Directory.Build.targets b/src/coreclr/.nuget/Directory.Build.targets
index 379fbd65030b32..f30471ded8ae4f 100644
--- a/src/coreclr/.nuget/Directory.Build.targets
+++ b/src/coreclr/.nuget/Directory.Build.targets
@@ -4,7 +4,7 @@
$(ProductVersion)
- $(PackageVersion)
+ $(PackageVersion)
diff --git a/src/coreclr/jit/assertionprop.cpp b/src/coreclr/jit/assertionprop.cpp
index 3d61a698a08d5c..f720ca6c826cba 100644
--- a/src/coreclr/jit/assertionprop.cpp
+++ b/src/coreclr/jit/assertionprop.cpp
@@ -2211,6 +2211,22 @@ AssertionInfo Compiler::optAssertionGenJtrue(GenTree* tree)
// If op1 is lcl and op2 is const or lcl, create assertion.
if ((op1->gtOper == GT_LCL_VAR) && (op2->OperIsConst() || (op2->gtOper == GT_LCL_VAR))) // Fix for Dev10 851483
{
+ // Watch out for cases where long local(s) are implicitly truncated.
+ //
+ LclVarDsc* const lcl1Dsc = lvaGetDesc(op1->AsLclVarCommon());
+ if ((lcl1Dsc->TypeGet() == TYP_LONG) && (op1->TypeGet() != TYP_LONG))
+ {
+ return NO_ASSERTION_INDEX;
+ }
+ if (op2->OperIs(GT_LCL_VAR))
+ {
+ LclVarDsc* const lcl2Dsc = lvaGetDesc(op2->AsLclVarCommon());
+ if ((lcl2Dsc->TypeGet() == TYP_LONG) && (op2->TypeGet() != TYP_LONG))
+ {
+ return NO_ASSERTION_INDEX;
+ }
+ }
+
return optCreateJtrueAssertions(op1, op2, assertionKind);
}
else if (!optLocalAssertionProp)
diff --git a/src/coreclr/jit/emitarm64.cpp b/src/coreclr/jit/emitarm64.cpp
index 2a5c947de175c5..624a737234fcbb 100644
--- a/src/coreclr/jit/emitarm64.cpp
+++ b/src/coreclr/jit/emitarm64.cpp
@@ -217,7 +217,6 @@ void emitter::emitInsSanityCheck(instrDesc* id)
case IF_BR_1B: // BR_1B ................ ......nnnnn..... Rn
if (emitComp->IsTargetAbi(CORINFO_NATIVEAOT_ABI) && id->idIsTlsGD())
{
- assert(isGeneralRegister(id->idReg1()));
assert(id->idAddr()->iiaAddr != nullptr);
}
else
@@ -9184,11 +9183,14 @@ void emitter::emitIns_Call(EmitCallType callType,
if (emitComp->IsTargetAbi(CORINFO_NATIVEAOT_ABI) && EA_IS_CNS_TLSGD_RELOC(retSize))
{
// For NativeAOT linux/arm64, we need to also record the relocation of methHnd.
- // Since we do not have space to embed it in instrDesc, we store the register in
- // reg1 and instead use the `iiaAdd` to store the method handle. Likewise, during
- // emitOutputInstr, we retrieve the register from reg1 for this specific case.
+ // Since we do not have space to embed it in instrDesc, we use the `iiaAddr` to
+ // store the method handle.
+ // The target handle need to be always in R2 and hence the assert check.
+ // We cannot use reg1 and reg2 fields of instrDesc because they contain the gc
+ // registers (emitEncodeCallGCregs()) that are live across the call.
+
+ assert(ireg == REG_R2);
id->idSetTlsGD();
- id->idReg1(ireg);
id->idAddr()->iiaAddr = (BYTE*)methHnd;
}
else
@@ -10990,12 +10992,13 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp)
{
emitRecordRelocation(odst, (CORINFO_METHOD_HANDLE)id->idAddr()->iiaAddr,
IMAGE_REL_AARCH64_TLSDESC_CALL);
- code |= insEncodeReg_Rn(id->idReg1()); // nnnnn
+ code |= insEncodeReg_Rn(REG_R2); // nnnnn
}
else
{
code |= insEncodeReg_Rn(id->idReg3()); // nnnnn
}
+
dst += emitOutputCall(ig, dst, id, code);
sz = id->idIsLargeCall() ? sizeof(instrDescCGCA) : sizeof(instrDesc);
break;
@@ -13315,7 +13318,15 @@ void emitter::emitDispInsHelp(
case IF_BR_1B: // BR_1B ................ ......nnnnn..... Rn
// The size of a branch target is always EA_PTRSIZE
assert(insOptsNone(id->idInsOpt()));
- emitDispReg(id->idReg3(), EA_PTRSIZE, false);
+
+ if (emitComp->IsTargetAbi(CORINFO_NATIVEAOT_ABI) && id->idIsTlsGD())
+ {
+ emitDispReg(REG_R2, EA_PTRSIZE, false);
+ }
+ else
+ {
+ emitDispReg(id->idReg3(), EA_PTRSIZE, false);
+ }
break;
case IF_LS_1A: // LS_1A XX...V..iiiiiiii iiiiiiiiiiittttt Rt PC imm(1MB)
diff --git a/src/coreclr/vm/peassembly.cpp b/src/coreclr/vm/peassembly.cpp
index 3f54dbff556af2..8594e62c9a0e6b 100644
--- a/src/coreclr/vm/peassembly.cpp
+++ b/src/coreclr/vm/peassembly.cpp
@@ -518,7 +518,6 @@ BOOL PEAssembly::GetResource(LPCSTR szName, DWORD *cbResource,
}
CONTRACTL_END;
-
mdToken mdLinkRef;
DWORD dwResourceFlags;
DWORD dwOffset;
@@ -567,30 +566,31 @@ BOOL PEAssembly::GetResource(LPCSTR szName, DWORD *cbResource,
}
- switch(TypeFromToken(mdLinkRef)) {
+ switch(TypeFromToken(mdLinkRef))
+ {
case mdtAssemblyRef:
{
if (pAssembly == NULL)
return FALSE;
AssemblySpec spec;
- spec.InitializeSpec(mdLinkRef, GetMDImport(), pAssembly);
- DomainAssembly* pDomainAssembly = spec.LoadDomainAssembly(FILE_LOADED);
+ spec.InitializeSpec(mdLinkRef, pAssembly->GetMDImport(), pAssembly);
+ Assembly* pLoadedAssembly = spec.LoadAssembly(FILE_LOADED);
if (dwLocation) {
if (pAssemblyRef)
- *pAssemblyRef = pDomainAssembly->GetAssembly();
+ *pAssemblyRef = pLoadedAssembly;
*dwLocation = *dwLocation | 2; // ResourceLocation.containedInAnotherAssembly
}
- return GetResource(szName,
- cbResource,
- pbInMemoryResource,
- pAssemblyRef,
- szFileName,
- dwLocation,
- pDomainAssembly->GetAssembly());
+ return pLoadedAssembly->GetResource(
+ szName,
+ cbResource,
+ pbInMemoryResource,
+ pAssemblyRef,
+ szFileName,
+ dwLocation);
}
case mdtFile:
diff --git a/src/libraries/Common/src/Interop/Interop.Ldap.cs b/src/libraries/Common/src/Interop/Interop.Ldap.cs
index 90c0ba997cd962..512242230093ff 100644
--- a/src/libraries/Common/src/Interop/Interop.Ldap.cs
+++ b/src/libraries/Common/src/Interop/Interop.Ldap.cs
@@ -157,6 +157,8 @@ internal enum LdapOption
LDAP_OPT_ROOTDSE_CACHE = 0x9a, // Not Supported in Linux
LDAP_OPT_DEBUG_LEVEL = 0x5001,
LDAP_OPT_URI = 0x5006, // Not Supported in Windows
+ LDAP_OPT_X_TLS_CACERTDIR = 0x6003, // Not Supported in Windows
+ LDAP_OPT_X_TLS_NEWCTX = 0x600F, // Not Supported in Windows
LDAP_OPT_X_SASL_REALM = 0x6101,
LDAP_OPT_X_SASL_AUTHCID = 0x6102,
LDAP_OPT_X_SASL_AUTHZID = 0x6103
diff --git a/src/libraries/Common/tests/System/DirectoryServices/LDAP.Configuration.xml b/src/libraries/Common/tests/System/DirectoryServices/LDAP.Configuration.xml
index 3523d7762232af..1a7f36e6f047bd 100644
--- a/src/libraries/Common/tests/System/DirectoryServices/LDAP.Configuration.xml
+++ b/src/libraries/Common/tests/System/DirectoryServices/LDAP.Configuration.xml
@@ -1,6 +1,6 @@
-To enable the tests marked with [ConditionalFact(nameof(IsLdapConfigurationExist))], you need to setup an LDAP server and provide the needed server info here.
+To enable the tests marked with [ConditionalFact(nameof(IsLdapConfigurationExist))], you need to setup an LDAP server as described below and set the environment variable LDAP_TEST_SERVER_INDEX to the appropriate offset into the XML section found at the end of this file.
To ship, we should test on both an Active Directory LDAP server, and at least one other server, as behaviors are a little different. However for local testing, it is easiest to connect to an OpenDJ LDAP server in a docker container (eg., in WSL2).
@@ -11,7 +11,7 @@ OPENDJ SERVER
test it with this command - it should return some results in WSL2
- ldapsearch -h localhost -p 1389 -D 'cn=admin,dc=example,dc=com' -x -w password
+ ldapsearch -H ldap://localhost:1389 -D 'cn=admin,dc=example,dc=com' -x -w password
this command views the status
@@ -24,16 +24,16 @@ SLAPD OPENLDAP SERVER
and to test and view status
- ldapsearch -h localhost -p 390 -D 'cn=admin,dc=example,dc=com' -x -w password
+ ldapsearch -H ldap://localhost:390 -D 'cn=admin,dc=example,dc=com' -x -w password
docker exec -it slapd01 slapcat
SLAPD OPENLDAP SERVER WITH TLS
==============================
-The osixia/openldap container image automatically creates a TLS lisener with a self-signed certificate. This can be used to test TLS.
+The osixia/openldap container image automatically creates a TLS listener with a self-signed certificate. This can be used to test TLS.
-Start the container, with TLS on port 1636, without client certificate verification:
+Start the container, with TLS on port 1636, but without client certificate verification:
docker run --publish 1389:389 --publish 1636:636 --name ldap --hostname ldap.local --detach --rm --env LDAP_TLS_VERIFY_CLIENT=never --env LDAP_ADMIN_PASSWORD=password osixia/openldap --loglevel debug
@@ -56,6 +56,8 @@ To test and view the status:
ldapsearch -H ldaps://ldap.local:1636 -b dc=example,dc=org -x -D cn=admin,dc=example,dc=org -w password
+use '-d 1' or '-d 2' for debugging.
+
ACTIVE DIRECTORY
================
@@ -65,7 +67,7 @@ When running against Active Directory from a Windows client, you should not see
If you are running your AD server as a VM on the same machine that you are running WSL2, you must execute this command on the host to bridge the two Hyper-V networks so that it is visible from WSL2:
- Get-NetIPInterface | where {$_.InterfaceAlias -eq 'vEthernet (WSL)' -or $_.InterfaceAlias -eq 'vEthernet (Default Switch)'} | Set-NetIPInterface -Forwarding Enabled
+ Get-NetIPInterface | where {$_.InterfaceAlias -eq 'vEthernet (WSL)' -or $_.InterfaceAlias -eq 'vEthernet (Default Switch)'} | Set-NetIPInterface -Forwarding Enabled
The WSL2 VM should now be able to see the AD VM by IP address. To make it visible by host name, it's probably easiest to just add it to /etc/hosts.
@@ -82,7 +84,7 @@ Note:
@@ -105,15 +107,6 @@ Note:
ServerBind,None
False
-
- danmose-ldap.danmose-domain.com
- DC=danmose-domain,DC=com
- 389
- danmose-domain\Administrator
- %TESTPASSWORD%
- ServerBind,None
- True
-
ldap.local
DC=example,DC=org
@@ -124,5 +117,14 @@ Note:
true
False
+
+ danmose-ldap.danmose-domain.com
+ DC=danmose-domain,DC=com
+ 389
+ danmose-domain\Administrator
+ %TESTPASSWORD%
+ ServerBind,None
+ True
+
diff --git a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Windows.cs b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Windows.cs
index 6a166b298cd517..1cd57d147a77ed 100644
--- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Windows.cs
+++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Windows.cs
@@ -26,6 +26,7 @@ public static partial class PlatformDetection
public static bool IsWindows10OrLater => IsWindowsVersionOrLater(10, 0);
public static bool IsWindowsServer2019 => IsWindows && IsNotWindowsNanoServer && GetWindowsVersion() == 10 && GetWindowsMinorVersion() == 0 && GetWindowsBuildVersion() == 17763;
public static bool IsWindowsServer2022 => IsWindows && IsNotWindowsNanoServer && GetWindowsVersion() == 10 && GetWindowsMinorVersion() == 0 && GetWindowsBuildVersion() == 20348;
+ public static bool IsWindowsServer2025 => IsWindows && IsNotWindowsNanoServer && GetWindowsVersion() == 10 && GetWindowsMinorVersion() == 0 && GetWindowsBuildVersion() == 26100;
public static bool IsWindowsNanoServer => IsWindows && (IsNotWindowsIoTCore && GetWindowsInstallationType().Equals("Nano Server", StringComparison.OrdinalIgnoreCase));
public static bool IsWindowsServerCore => IsWindows && GetWindowsInstallationType().Equals("Server Core", StringComparison.OrdinalIgnoreCase);
public static int WindowsVersion => IsWindows ? (int)GetWindowsVersion() : -1;
diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/System.Diagnostics.DiagnosticSource.csproj b/src/libraries/System.Diagnostics.DiagnosticSource/src/System.Diagnostics.DiagnosticSource.csproj
index 2316c532efb58b..f110b765c8adcd 100644
--- a/src/libraries/System.Diagnostics.DiagnosticSource/src/System.Diagnostics.DiagnosticSource.csproj
+++ b/src/libraries/System.Diagnostics.DiagnosticSource/src/System.Diagnostics.DiagnosticSource.csproj
@@ -25,7 +25,7 @@ System.Diagnostics.DiagnosticSource
-
+
diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/tests/HttpHandlerDiagnosticListenerTests.cs b/src/libraries/System.Diagnostics.DiagnosticSource/tests/HttpHandlerDiagnosticListenerTests.cs
index 0c23059c17ae88..ecfe219e072843 100644
--- a/src/libraries/System.Diagnostics.DiagnosticSource/tests/HttpHandlerDiagnosticListenerTests.cs
+++ b/src/libraries/System.Diagnostics.DiagnosticSource/tests/HttpHandlerDiagnosticListenerTests.cs
@@ -145,6 +145,7 @@ public async Task TestBasicReceiveAndResponseEvents()
}
}
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/112792")]
[OuterLoop]
[ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))]
public void TestW3CHeaders()
@@ -194,6 +195,7 @@ public void TestW3CHeadersTraceStateAndCorrelationContext()
{
using (var eventRecords = new EventObserverAndRecorder())
{
+ Activity.DefaultIdFormat = ActivityIdFormat.W3C;
var parent = new Activity("w3c activity");
parent.SetParentId(ActivityTraceId.CreateRandom(), ActivitySpanId.CreateRandom());
parent.TraceStateString = "some=state";
diff --git a/src/libraries/System.DirectoryServices.Protocols/ref/System.DirectoryServices.Protocols.cs b/src/libraries/System.DirectoryServices.Protocols/ref/System.DirectoryServices.Protocols.cs
index 32262da81be3e2..126be30b3ddb26 100644
--- a/src/libraries/System.DirectoryServices.Protocols/ref/System.DirectoryServices.Protocols.cs
+++ b/src/libraries/System.DirectoryServices.Protocols/ref/System.DirectoryServices.Protocols.cs
@@ -382,6 +382,8 @@ public partial class LdapSessionOptions
internal LdapSessionOptions() { }
public bool AutoReconnect { get { throw null; } set { } }
public string DomainName { get { throw null; } set { } }
+ [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("windows")]
+ public string TrustedCertificatesDirectory { get { throw null; } set { } }
public string HostName { get { throw null; } set { } }
public bool HostReachable { get { throw null; } }
public System.DirectoryServices.Protocols.LocatorFlags LocatorFlag { get { throw null; } set { } }
@@ -402,6 +404,8 @@ internal LdapSessionOptions() { }
public bool Signing { get { throw null; } set { } }
public System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation SslInformation { get { throw null; } }
public int SspiFlag { get { throw null; } set { } }
+ [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("windows")]
+ public void StartNewTlsSessionContext() { }
public bool TcpKeepAlive { get { throw null; } set { } }
public System.DirectoryServices.Protocols.VerifyServerCertificateCallback VerifyServerCertificate { get { throw null; } set { } }
public void FastConcurrentBind() { }
diff --git a/src/libraries/System.DirectoryServices.Protocols/src/CompatibilitySuppressions.xml b/src/libraries/System.DirectoryServices.Protocols/src/CompatibilitySuppressions.xml
new file mode 100644
index 00000000000000..2647f901c1a47e
--- /dev/null
+++ b/src/libraries/System.DirectoryServices.Protocols/src/CompatibilitySuppressions.xml
@@ -0,0 +1,67 @@
+
+
+
+
+ CP0002
+ M:System.DirectoryServices.Protocols.LdapSessionOptions.get_TrustedCertificatesDirectory
+ lib/net8.0/System.DirectoryServices.Protocols.dll
+ lib/net8.0/System.DirectoryServices.Protocols.dll
+ true
+
+
+ CP0002
+ M:System.DirectoryServices.Protocols.LdapSessionOptions.set_TrustedCertificatesDirectory(System.String)
+ lib/net8.0/System.DirectoryServices.Protocols.dll
+ lib/net8.0/System.DirectoryServices.Protocols.dll
+ true
+
+
+ CP0002
+ M:System.DirectoryServices.Protocols.LdapSessionOptions.StartNewTlsSessionContext
+ lib/net8.0/System.DirectoryServices.Protocols.dll
+ lib/net8.0/System.DirectoryServices.Protocols.dll
+ true
+
+
+ CP0002
+ M:System.DirectoryServices.Protocols.LdapSessionOptions.get_TrustedCertificatesDirectory
+ lib/net9.0/System.DirectoryServices.Protocols.dll
+ lib/net9.0/System.DirectoryServices.Protocols.dll
+ true
+
+
+ CP0002
+ M:System.DirectoryServices.Protocols.LdapSessionOptions.set_TrustedCertificatesDirectory(System.String)
+ lib/net9.0/System.DirectoryServices.Protocols.dll
+ lib/net9.0/System.DirectoryServices.Protocols.dll
+ true
+
+
+ CP0002
+ M:System.DirectoryServices.Protocols.LdapSessionOptions.StartNewTlsSessionContext
+ lib/net9.0/System.DirectoryServices.Protocols.dll
+ lib/net9.0/System.DirectoryServices.Protocols.dll
+ true
+
+
+ CP0002
+ M:System.DirectoryServices.Protocols.LdapSessionOptions.get_TrustedCertificatesDirectory
+ lib/netstandard2.0/System.DirectoryServices.Protocols.dll
+ lib/netstandard2.0/System.DirectoryServices.Protocols.dll
+ true
+
+
+ CP0002
+ M:System.DirectoryServices.Protocols.LdapSessionOptions.set_TrustedCertificatesDirectory(System.String)
+ lib/netstandard2.0/System.DirectoryServices.Protocols.dll
+ lib/netstandard2.0/System.DirectoryServices.Protocols.dll
+ true
+
+
+ CP0002
+ M:System.DirectoryServices.Protocols.LdapSessionOptions.StartNewTlsSessionContext
+ lib/netstandard2.0/System.DirectoryServices.Protocols.dll
+ lib/netstandard2.0/System.DirectoryServices.Protocols.dll
+ true
+
+
\ No newline at end of file
diff --git a/src/libraries/System.DirectoryServices.Protocols/src/Resources/Strings.resx b/src/libraries/System.DirectoryServices.Protocols/src/Resources/Strings.resx
index b63f103619fbdb..1f6c9734a7384c 100644
--- a/src/libraries/System.DirectoryServices.Protocols/src/Resources/Strings.resx
+++ b/src/libraries/System.DirectoryServices.Protocols/src/Resources/Strings.resx
@@ -426,4 +426,7 @@
Only ReferralChasingOptions.None and ReferralChasingOptions.All are supported on Linux.
+
+ The directory '{0}' does not exist.
+
\ No newline at end of file
diff --git a/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapConnection.cs b/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapConnection.cs
index 1125bfd568d385..facdfc6a484bb9 100644
--- a/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapConnection.cs
+++ b/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapConnection.cs
@@ -955,13 +955,13 @@ private unsafe Interop.BOOL ProcessClientCertificate(IntPtr ldapHandle, IntPtr C
private void Connect()
{
- //Ccurrently ldap does not accept more than one certificate.
+ // Currently ldap does not accept more than one certificate.
if (ClientCertificates.Count > 1)
{
throw new InvalidOperationException(SR.InvalidClientCertificates);
}
- // Set the certificate callback routine here if user adds the certifcate to the certificate collection.
+ // Set the certificate callback routine here if user adds the certificate to the certificate collection.
if (ClientCertificates.Count != 0)
{
int certError = LdapPal.SetClientCertOption(_ldapHandle, LdapOption.LDAP_OPT_CLIENT_CERTIFICATE, _clientCertificateRoutine);
diff --git a/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.Linux.cs b/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.Linux.cs
index e1cfffebb531fc..5059c40499d5c6 100644
--- a/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.Linux.cs
+++ b/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.Linux.cs
@@ -2,6 +2,8 @@
// The .NET Foundation licenses this file to you under the MIT license.
using System.ComponentModel;
+using System.IO;
+using System.Runtime.Versioning;
namespace System.DirectoryServices.Protocols
{
@@ -11,6 +13,34 @@ public partial class LdapSessionOptions
private bool _secureSocketLayer;
+ ///
+ /// Specifies the path of the directory containing CA certificates in the PEM format.
+ /// Multiple directories may be specified by separating with a semi-colon.
+ ///
+ ///
+ /// The certificate files are looked up by the CA subject name hash value where that hash can be
+ /// obtained by using, for example, openssl x509 -hash -noout -in CA.crt
.
+ /// It is a common practice to have the certificate file be a symbolic link to the actual certificate file
+ /// which can be done by using openssl rehash .
or c_rehash .
in the directory
+ /// containing the certificate files.
+ ///
+ /// The directory not exist.
+ [UnsupportedOSPlatform("windows")]
+ public string TrustedCertificatesDirectory
+ {
+ get => GetStringValueHelper(LdapOption.LDAP_OPT_X_TLS_CACERTDIR, releasePtr: true);
+
+ set
+ {
+ if (!Directory.Exists(value))
+ {
+ throw new DirectoryNotFoundException(SR.Format(SR.DirectoryNotFound, value));
+ }
+
+ SetStringOptionHelper(LdapOption.LDAP_OPT_X_TLS_CACERTDIR, value);
+ }
+ }
+
public bool SecureSocketLayer
{
get
@@ -52,6 +82,16 @@ public ReferralChasingOptions ReferralChasing
}
}
+ ///
+ /// Create a new TLS library context.
+ /// Calling this is necessary after setting TLS-based options, such as TrustedCertificatesDirectory.
+ ///
+ [UnsupportedOSPlatform("windows")]
+ public void StartNewTlsSessionContext()
+ {
+ SetIntValueHelper(LdapOption.LDAP_OPT_X_TLS_NEWCTX, 0);
+ }
+
private bool GetBoolValueHelper(LdapOption option)
{
if (_connection._disposed) throw new ObjectDisposedException(GetType().Name);
@@ -71,5 +111,14 @@ private void SetBoolValueHelper(LdapOption option, bool value)
ErrorChecking.CheckAndSetLdapError(error);
}
+
+ private void SetStringOptionHelper(LdapOption option, string value)
+ {
+ if (_connection._disposed) throw new ObjectDisposedException(GetType().Name);
+
+ int error = LdapPal.SetStringOption(_connection._ldapHandle, option, value);
+
+ ErrorChecking.CheckAndSetLdapError(error);
+ }
}
}
diff --git a/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.Windows.cs b/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.Windows.cs
index 813005c5ecb72b..cc73449104adf4 100644
--- a/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.Windows.cs
+++ b/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.Windows.cs
@@ -10,6 +10,13 @@ public partial class LdapSessionOptions
{
private static void PALCertFreeCRLContext(IntPtr certPtr) => Interop.Ldap.CertFreeCRLContext(certPtr);
+ [UnsupportedOSPlatform("windows")]
+ public string TrustedCertificatesDirectory
+ {
+ get => throw new PlatformNotSupportedException();
+ set => throw new PlatformNotSupportedException();
+ }
+
public bool SecureSocketLayer
{
get
@@ -24,6 +31,9 @@ public bool SecureSocketLayer
}
}
+ [UnsupportedOSPlatform("windows")]
+ public void StartNewTlsSessionContext() => throw new PlatformNotSupportedException();
+
public int ProtocolVersion
{
get => GetIntValueHelper(LdapOption.LDAP_OPT_VERSION);
diff --git a/src/libraries/System.DirectoryServices.Protocols/tests/DirectoryServicesProtocolsTests.cs b/src/libraries/System.DirectoryServices.Protocols/tests/DirectoryServicesProtocolsTests.cs
index 00433bae9875c2..05dda66bbda001 100644
--- a/src/libraries/System.DirectoryServices.Protocols/tests/DirectoryServicesProtocolsTests.cs
+++ b/src/libraries/System.DirectoryServices.Protocols/tests/DirectoryServicesProtocolsTests.cs
@@ -2,12 +2,10 @@
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
-using System.Diagnostics;
using System.DirectoryServices.Tests;
using System.Globalization;
+using System.IO;
using System.Net;
-using System.Text;
-using System.Threading;
using Xunit;
namespace System.DirectoryServices.Protocols.Tests
@@ -16,6 +14,7 @@ public partial class DirectoryServicesProtocolsTests
{
internal static bool LdapConfigurationExists => LdapConfiguration.Configuration != null;
internal static bool IsActiveDirectoryServer => LdapConfigurationExists && LdapConfiguration.Configuration.IsActiveDirectoryServer;
+ internal static bool UseTls => LdapConfigurationExists && LdapConfiguration.Configuration.UseTls;
internal static bool IsServerSideSortSupported => LdapConfigurationExists && LdapConfiguration.Configuration.SupportsServerSideSort;
@@ -706,6 +705,64 @@ public void TestMultipleServerBind()
connection.Timeout = new TimeSpan(0, 3, 0);
}
+#if NET
+ [ConditionalFact(nameof(UseTls))]
+ [PlatformSpecific(TestPlatforms.Linux)]
+ public void StartNewTlsSessionContext()
+ {
+ using (var connection = GetConnection(bind: false))
+ {
+ // We use "." as the directory since it must be a valid directory for StartNewTlsSessionContext() + Bind() to be successful even
+ // though there are no client certificates in ".".
+ connection.SessionOptions.TrustedCertificatesDirectory = ".";
+
+ // For a real-world scenario, we would call 'StartTransportLayerSecurity(null)' here which would do the TLS handshake including
+ // providing the client certificate to the server and validating the server certificate. However, this requires additional
+ // setup that we don't have including trusting the server certificate and by specifying "demand" in the setup of the server
+ // via 'LDAP_TLS_VERIFY_CLIENT=demand' to force the TLS handshake to occur.
+
+ connection.SessionOptions.StartNewTlsSessionContext();
+ connection.Bind();
+
+ SearchRequest searchRequest = new (LdapConfiguration.Configuration.SearchDn, "(objectClass=*)", SearchScope.Subtree);
+ _ = (SearchResponse)connection.SendRequest(searchRequest);
+ }
+ }
+
+ [ConditionalFact(nameof(UseTls))]
+ [PlatformSpecific(TestPlatforms.Linux)]
+ public void StartNewTlsSessionContext_ThrowsLdapException()
+ {
+ using (var connection = GetConnection(bind: false))
+ {
+ // Create a new session context without setting TrustedCertificatesDirectory.
+ connection.SessionOptions.StartNewTlsSessionContext();
+ Assert.Throws(() => connection.Bind());
+ }
+ }
+
+ [ConditionalFact(nameof(LdapConfigurationExists))]
+ [PlatformSpecific(TestPlatforms.Linux)]
+ public void TrustedCertificatesDirectory_ThrowsDirectoryNotFoundException()
+ {
+ using (var connection = GetConnection(bind: false))
+ {
+ Assert.Throws(() => connection.SessionOptions.TrustedCertificatesDirectory = "nonexistent");
+ }
+ }
+
+ [ConditionalFact(nameof(LdapConfigurationExists))]
+ [PlatformSpecific(TestPlatforms.Windows)]
+ public void StartNewTlsSessionContext_ThrowsPlatformNotSupportedException()
+ {
+ using (var connection = new LdapConnection("server"))
+ {
+ LdapSessionOptions options = connection.SessionOptions;
+ Assert.Throws(() => options.StartNewTlsSessionContext());
+ }
+ }
+#endif
+
private void DeleteAttribute(LdapConnection connection, string entryDn, string attributeName)
{
string dn = entryDn + "," + LdapConfiguration.Configuration.SearchDn;
@@ -786,24 +843,24 @@ private SearchResultEntry SearchUser(LdapConnection connection, string rootDn, s
return null;
}
- private LdapConnection GetConnection(string server)
+ private static LdapConnection GetConnection(string server)
{
LdapDirectoryIdentifier directoryIdentifier = new LdapDirectoryIdentifier(server, fullyQualifiedDnsHostName: true, connectionless: false);
return GetConnection(directoryIdentifier);
}
- private LdapConnection GetConnection()
+ private static LdapConnection GetConnection(bool bind = true)
{
LdapDirectoryIdentifier directoryIdentifier = string.IsNullOrEmpty(LdapConfiguration.Configuration.Port) ?
new LdapDirectoryIdentifier(LdapConfiguration.Configuration.ServerName, fullyQualifiedDnsHostName: true, connectionless: false) :
new LdapDirectoryIdentifier(LdapConfiguration.Configuration.ServerName,
int.Parse(LdapConfiguration.Configuration.Port, NumberStyles.None, CultureInfo.InvariantCulture),
fullyQualifiedDnsHostName: true, connectionless: false);
- return GetConnection(directoryIdentifier);
+ return GetConnection(directoryIdentifier, bind);
}
- private static LdapConnection GetConnection(LdapDirectoryIdentifier directoryIdentifier)
+ private static LdapConnection GetConnection(LdapDirectoryIdentifier directoryIdentifier, bool bind = true)
{
NetworkCredential credential = new NetworkCredential(LdapConfiguration.Configuration.UserName, LdapConfiguration.Configuration.Password);
@@ -816,7 +873,11 @@ private static LdapConnection GetConnection(LdapDirectoryIdentifier directoryIde
// to LDAP v2, which we do not support, and will return LDAP_PROTOCOL_ERROR
connection.SessionOptions.ProtocolVersion = 3;
connection.SessionOptions.SecureSocketLayer = LdapConfiguration.Configuration.UseTls;
- connection.Bind();
+
+ if (bind)
+ {
+ connection.Bind();
+ }
connection.Timeout = new TimeSpan(0, 3, 0);
return connection;
diff --git a/src/libraries/System.DirectoryServices.Protocols/tests/LdapSessionOptionsTests.cs b/src/libraries/System.DirectoryServices.Protocols/tests/LdapSessionOptionsTests.cs
index 5f6a737834ac23..2a8ab23a16d421 100644
--- a/src/libraries/System.DirectoryServices.Protocols/tests/LdapSessionOptionsTests.cs
+++ b/src/libraries/System.DirectoryServices.Protocols/tests/LdapSessionOptionsTests.cs
@@ -7,6 +7,8 @@
namespace System.DirectoryServices.Protocols.Tests
{
+ // To enable these tests locally for Mono, comment out this line in DirectoryServicesTestHelpers.cs:
+ // [assembly: ActiveIssue("https://github.com/dotnet/runtime/issues/35912", TestRuntimes.Mono)]
[ConditionalClass(typeof(DirectoryServicesTestHelpers), nameof(DirectoryServicesTestHelpers.IsWindowsOrLibLdapIsInstalled))]
public class LdapSessionOptionsTests
{
@@ -27,6 +29,7 @@ public void ReferralChasing_Set_GetReturnsExpected_On_Windows(ReferralChasingOpt
}
[Theory]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/112146")]
[PlatformSpecific(TestPlatforms.Linux)]
[InlineData(ReferralChasingOptions.None)]
[InlineData(ReferralChasingOptions.All)]
@@ -756,5 +759,32 @@ public void StopTransportLayerSecurity_Disposed_ThrowsObjectDisposedException()
Assert.Throws(() => connection.SessionOptions.StopTransportLayerSecurity());
}
+
+#if NET
+ [Fact]
+ [PlatformSpecific(TestPlatforms.Linux)]
+ public void CertificateDirectoryProperty()
+ {
+ using (var connection = new LdapConnection("server"))
+ {
+ LdapSessionOptions options = connection.SessionOptions;
+ Assert.Null(options.TrustedCertificatesDirectory);
+
+ options.TrustedCertificatesDirectory = ".";
+ Assert.Equal(".", options.TrustedCertificatesDirectory);
+ }
+ }
+
+ [Fact]
+ [PlatformSpecific(TestPlatforms.Windows)]
+ public void CertificateDirectoryProperty_ThrowsPlatformNotSupportedException()
+ {
+ using (var connection = new LdapConnection("server"))
+ {
+ LdapSessionOptions options = connection.SessionOptions;
+ Assert.Throws(() => options.TrustedCertificatesDirectory = "CertificateDirectory");
+ }
+ }
+#endif
}
}
diff --git a/src/libraries/System.Linq/src/System/Linq/SkipTake.SpeedOpt.cs b/src/libraries/System.Linq/src/System/Linq/SkipTake.SpeedOpt.cs
index 5cb53aa2997e06..ef043f9f6755e7 100644
--- a/src/libraries/System.Linq/src/System/Linq/SkipTake.SpeedOpt.cs
+++ b/src/libraries/System.Linq/src/System/Linq/SkipTake.SpeedOpt.cs
@@ -430,9 +430,12 @@ public override Iterator Take(int count)
{
if (_source is Iterator iterator &&
iterator.GetCount(onlyIfCheap: true) is int count &&
- count >= _minIndexInclusive)
+ count > _minIndexInclusive)
{
- return !HasLimit ?
+ // If there's no upper bound, or if there are fewer items in the list
+ // than the upper bound allows, just return the last element of the list.
+ // Otherwise, get the element at the upper bound.
+ return (uint)count <= (uint)_maxIndexInclusive ?
iterator.TryGetLast(out found) :
iterator.TryGetElementAt(_maxIndexInclusive, out found);
}
diff --git a/src/libraries/System.Linq/tests/AggregateByTests.cs b/src/libraries/System.Linq/tests/AggregateByTests.cs
index b574660c9e5ac8..43b9262f78b813 100644
--- a/src/libraries/System.Linq/tests/AggregateByTests.cs
+++ b/src/libraries/System.Linq/tests/AggregateByTests.cs
@@ -11,10 +11,10 @@ public class AggregateByTests : EnumerableTests
[Fact]
public void Empty()
{
- Assert.All(IdentityTransforms(), transform =>
+ Assert.All(CreateSources([]), source =>
{
- Assert.Equal(Enumerable.Empty>(), transform(Enumerable.Empty()).AggregateBy(i => i, i => i, (a, i) => a + i));
- Assert.Equal(Enumerable.Empty>(), transform(Enumerable.Empty()).AggregateBy(i => i, 0, (a, i) => a + i));
+ Assert.Equal([], source.AggregateBy(i => i, i => i, (a, i) => a + i));
+ Assert.Equal([], source.AggregateBy(i => i, 0, (a, i) => a + i));
});
}
diff --git a/src/libraries/System.Linq/tests/ChunkTests.cs b/src/libraries/System.Linq/tests/ChunkTests.cs
index 31433ddabff30f..1a12ac7fd6765d 100644
--- a/src/libraries/System.Linq/tests/ChunkTests.cs
+++ b/src/libraries/System.Linq/tests/ChunkTests.cs
@@ -42,10 +42,8 @@ public void ChunkSourceLazily()
[InlineData(new[] {9999, 0, 888, -1, 66, -777, 1, 2, -12345})]
public void ChunkSourceRepeatCalls(int[] array)
{
- Assert.All(IdentityTransforms(), t =>
+ Assert.All(CreateSources(array), source =>
{
- IEnumerable source = t(array);
-
Assert.Equal(source.Chunk(3), source.Chunk(3));
});
}
@@ -54,10 +52,8 @@ public void ChunkSourceRepeatCalls(int[] array)
[InlineData(new[] {9999, 0, 888, -1, 66, -777, 1, 2, -12345})]
public void ChunkSourceEvenly(int[] array)
{
- Assert.All(IdentityTransforms(), t =>
+ Assert.All(CreateSources(array), source =>
{
- IEnumerable source = t(array);
-
using IEnumerator chunks = source.Chunk(3).GetEnumerator();
chunks.MoveNext();
Assert.Equal(new[] { 9999, 0, 888 }, chunks.Current);
@@ -73,10 +69,8 @@ public void ChunkSourceEvenly(int[] array)
[InlineData(new[] {9999, 0, 888, -1, 66, -777, 1, 2})]
public void ChunkSourceUnevenly(int[] array)
{
- Assert.All(IdentityTransforms(), t =>
+ Assert.All(CreateSources(array), source =>
{
- IEnumerable source = t(array);
-
using IEnumerator chunks = source.Chunk(3).GetEnumerator();
chunks.MoveNext();
Assert.Equal(new[] { 9999, 0, 888 }, chunks.Current);
@@ -92,10 +86,8 @@ public void ChunkSourceUnevenly(int[] array)
[InlineData(new[] {9999, 0})]
public void ChunkSourceSmallerThanMaxSize(int[] array)
{
- Assert.All(IdentityTransforms(), t =>
+ Assert.All(CreateSources(array), source =>
{
- IEnumerable source = t(array);
-
using IEnumerator chunks = source.Chunk(3).GetEnumerator();
chunks.MoveNext();
Assert.Equal(new[] { 9999, 0 }, chunks.Current);
@@ -107,10 +99,8 @@ public void ChunkSourceSmallerThanMaxSize(int[] array)
[InlineData(new int[0])]
public void EmptySourceYieldsNoChunks(int[] array)
{
- Assert.All(IdentityTransforms(), t =>
+ Assert.All(CreateSources(array), source =>
{
- IEnumerable source = t(array);
-
using IEnumerator chunks = source.Chunk(3).GetEnumerator();
Assert.False(chunks.MoveNext());
});
diff --git a/src/libraries/System.Linq/tests/ConcatTests.cs b/src/libraries/System.Linq/tests/ConcatTests.cs
index 544027450d80c2..4069bbdf5de5a4 100644
--- a/src/libraries/System.Linq/tests/ConcatTests.cs
+++ b/src/libraries/System.Linq/tests/ConcatTests.cs
@@ -31,8 +31,8 @@ private static void SameResultsWithQueryAndRepeatCallsWorker(IEnumerable f
first = from item in first select item;
second = from item in second select item;
- VerifyEqualsWorker(first.Concat(second), first.Concat(second));
- VerifyEqualsWorker(second.Concat(first), second.Concat(first));
+ Assert.Equal(first.Concat(second), first.Concat(second));
+ Assert.Equal(second.Concat(first), second.Concat(first));
}
[Theory]
@@ -41,8 +41,8 @@ private static void SameResultsWithQueryAndRepeatCallsWorker(IEnumerable f
[InlineData(new int[] { 2, 3, 5, 9 }, new int[] { 8, 10 }, new int[] { 2, 3, 5, 9, 8, 10 })] // Neither side is empty
public void PossiblyEmptyInputs(IEnumerable first, IEnumerable second, IEnumerable expected)
{
- VerifyEqualsWorker(expected, first.Concat(second));
- VerifyEqualsWorker(expected.Skip(first.Count()).Concat(expected.Take(first.Count())), second.Concat(first)); // Swap the inputs around
+ Assert.Equal(expected, first.Concat(second));
+ Assert.Equal(expected.Skip(first.Count()).Concat(expected.Take(first.Count())), second.Concat(first)); // Swap the inputs around
}
[Fact]
@@ -80,7 +80,7 @@ public void SecondNull()
public void VerifyEquals(IEnumerable expected, IEnumerable actual)
{
// workaround: xUnit type inference doesn't work if the input type is not T (like IEnumerable)
- VerifyEqualsWorker(expected, actual);
+ Assert.Equal(expected, actual);
}
[Theory]
@@ -133,23 +133,6 @@ public void First_Last_ElementAt(IEnumerable _, IEnumerable actual)
}
}
- private static void VerifyEqualsWorker(IEnumerable expected, IEnumerable actual)
- {
- // Returns a list of functions that, when applied to enumerable, should return
- // another one that has equivalent contents.
- var identityTransforms = IdentityTransforms();
-
- // We run the transforms N^2 times, by testing all transforms
- // of expected against all transforms of actual.
- foreach (var outTransform in identityTransforms)
- {
- foreach (var inTransform in identityTransforms)
- {
- Assert.Equal(outTransform(expected), inTransform(actual));
- }
- }
- }
-
public static IEnumerable