Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
Update everything else to .NET 7
Browse files Browse the repository at this point in the history
  • Loading branch information
Porges authored Nov 11, 2022
1 parent 2fa096f commit 24d1a20
Show file tree
Hide file tree
Showing 16 changed files with 26 additions and 26 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,8 @@ jobs:
run: |
./src/ci/get-version.sh > src/deployment/VERSION
cd src/ApiService/ApiService/
mv az-local.settings.json bin/Release/net6.0/local.settings.json
cd bin/Release/net6.0/
mv az-local.settings.json bin/Release/net*/local.settings.json
cd bin/Release/net*/
zip -r api-service-net.zip .
mkdir -p ${GITHUB_WORKSPACE}/artifacts/service-net
cp api-service-net.zip ${GITHUB_WORKSPACE}/artifacts/service-net
Expand Down Expand Up @@ -563,7 +563,7 @@ jobs:
cp -r libfuzzer-aarch64-crosscompile/fuzz.exe libfuzzer-aarch64-crosscompile/inputs artifacts/linux-libfuzzer-aarch64-crosscompile
# C# target.
sudo apt-get install -y dotnet-sdk-6.0
sudo apt-get install -y dotnet-sdk-7.0
(cd GoodBad; dotnet publish -c Release -o out)
mv GoodBad/out artifacts/GoodBadDotnet
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
if: ${{ matrix.language == 'csharp' }}
uses: actions/setup-dotnet@v2
with:
dotnet-version: "6.0.300"
dotnet-version: "7.0.0"

- name: Install dependencies
if: ${{ matrix.language == 'csharp' }}
Expand Down
2 changes: 1 addition & 1 deletion src/ApiService/ApiService/ApiService.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
<OutputType>Exe</OutputType>
<WarningLevel>5</WarningLevel>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Azure.ResourceManager.Monitor" Version="1.0.0-beta.2" />
Expand Down
4 changes: 2 additions & 2 deletions src/ApiService/ApiService/az-local.settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"IsEncrypted": false,
"Values": {
"FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated",
"linux_fx_version": "DOTNET-ISOLATED|6.0"
"linux_fx_version": "DOTNET-ISOLATED|7.0"
}
}
}
8 changes: 4 additions & 4 deletions src/ApiService/ApiService/onefuzzlib/WebhookOperations.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Net.Http;
using System.Security.Cryptography;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
using ApiService.OneFuzzLib.Orm;
Expand Down Expand Up @@ -106,10 +107,9 @@ public async Task<EventPing> Ping(Webhook webhook) {
}

string? digest = null;
var hmac = HMAC.Create("HMACSHA512");
if (secretToken != null && hmac != null) {
hmac.Key = System.Text.Encoding.UTF8.GetBytes(secretToken);
digest = Convert.ToHexString(hmac.ComputeHash(System.Text.Encoding.UTF8.GetBytes(data)));
if (secretToken is not null) {
using var hmac = new HMACSHA512(Encoding.UTF8.GetBytes(secretToken));
digest = Convert.ToHexString(hmac.ComputeHash(Encoding.UTF8.GetBytes(data)));
}
return new Tuple<string, string?>(data, digest);

Expand Down
2 changes: 1 addition & 1 deletion src/ApiService/ApiService/packages.lock.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 1,
"dependencies": {
"net6.0": {
"net7.0": {
"Azure.Core": {
"type": "Direct",
"requested": "[1.25.0, )",
Expand Down
2 changes: 1 addition & 1 deletion src/ApiService/FunctionalTests/FunctionalTests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand Down
2 changes: 1 addition & 1 deletion src/ApiService/FunctionalTests/packages.lock.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 1,
"dependencies": {
"net6.0": {
"net7.0": {
"coverlet.collector": {
"type": "Direct",
"requested": "[3.1.2, )",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<LangVersion>10.0</LangVersion>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
8 changes: 4 additions & 4 deletions src/agent/LibFuzzerDotnetLoader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,20 +114,20 @@ clang -g -O2 -fsanitize=fuzzer libfuzzer-dotnet-windows.cc -o libfuzzer-dotnet.e

### Build `LibFuzzerDotnetLoader`

Next, using .NET 6, you need to [publish](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-publish) a self-contained
Next, using .NET 7, you need to [publish](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-publish) a self-contained
build of the loader.

Note: this depends on SharpFuzz 2.0.0 or greater.

#### Linux
```
dotnet publish src/SharpFuzz.CommandLine -f net6.0 -c Release --sc -r linux-x64
dotnet publish src/SharpFuzz.CommandLine -f net7.0 -c Release --sc -r linux-x64
```

#### Windows 10
```
dotnet publish src\SharpFuzz.CommandLine -f net6.0 -c Release --sc -r win10-x64
dotnet publish src\SharpFuzz.CommandLine -f net7.0 -c Release --sc -r win10-x64
```

In the end, you should have two binaries for your platform: `libfuzzer-dotnet`(`.exe`) and `LibFuzzerDotnetLoader`(.`exe`).
Together with the `sharpfuzz` CLI tool for instrumentation assemblies, you are now ready to fuzz.
Together with the `sharpfuzz` CLI tool for instrumentation assemblies, you are now ready to fuzz.
2 changes: 1 addition & 1 deletion src/ci/dotnet-fuzzing-tools.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ mkdir $ARTIFACTS/sharpfuzz
git clone $SHARPFUZZ_REPO sharpfuzz
pushd sharpfuzz
git checkout $SHARPFUZZ_COMMIT
dotnet publish src/SharpFuzz.CommandLine -f net6.0 -c Release -o $ARTIFACTS/sharpfuzz --self-contained -r win10-x64
dotnet publish src/SharpFuzz.CommandLine -f net7.0 -c Release -o $ARTIFACTS/sharpfuzz --self-contained -r win10-x64
popd

# Build SharpFuzz and our dynamic loader harness for `libfuzzer-dotnet`.
Expand Down
4 changes: 2 additions & 2 deletions src/ci/dotnet-fuzzing-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ mkdir -p $ARTIFACTS/sharpfuzz
sudo apt-get install -y llvm-10 llvm-10-dev clang-10

# Install `SharpFuzz` and `LibFuzzerDotnetLoader` pre-reqs.
sudo apt-get install -y dotnet-sdk-6.0
sudo apt-get install -y dotnet-sdk-7.0

# Build SharpFuzz instrumentor.
git clone $SHARPFUZZ_REPO sharpfuzz
pushd sharpfuzz
git checkout $SHARPFUZZ_COMMIT
dotnet publish src/SharpFuzz.CommandLine -f net6.0 -c Release -o $ARTIFACTS/sharpfuzz --self-contained -r linux-x64
dotnet publish src/SharpFuzz.CommandLine -f net7.0 -c Release -o $ARTIFACTS/sharpfuzz --self-contained -r linux-x64
popd

# Build SharpFuzz and our dynamic loader harness for `libfuzzer-dotnet`.
Expand Down
2 changes: 1 addition & 1 deletion src/deployment/azuredeploy.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ module pythonFunction 'bicep-templates/function.bicep' = {
module netFunction 'bicep-templates/function.bicep' = {
name: 'netFunction'
params: {
linux_fx_version: 'DOTNET-ISOLATED|6.0'
linux_fx_version: 'DOTNET-ISOLATED|7.0'
name: '${name}-net'

app_logs_sas_url: storage.outputs.FuncSasUrlBlobAppLogs
Expand Down
2 changes: 1 addition & 1 deletion src/deployment/bicep-templates/function.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var commonSiteConfig = {
}

var extraProperties = (use_windows && enable_remote_debugging) ? {
netFrameworkVersion: 'v6.0'
netFrameworkVersion: 'v7.0'
remoteDebuggingEnabled: true
remoteDebuggingVersion: 'VS2022'
} : {}
Expand Down
2 changes: 1 addition & 1 deletion src/integration-tests/GoodBad/GoodBad.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<LangVersion>10.0</LangVersion>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/runtime-tools/linux/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ USER_SETUP="/onefuzz/setup/setup.sh"
TASK_SETUP="/onefuzz/bin/task-setup.sh"
MANAGED_SETUP="/onefuzz/bin/managed.sh"
SCALESET_SETUP="/onefuzz/bin/scaleset-setup.sh"
DOTNET_VERSION="6.0.300"
DOTNET_VERSION="7.0.0"
export DOTNET_ROOT=/onefuzz/tools/dotnet
export DOTNET_CLI_HOME="$DOTNET_ROOT"
export ONEFUZZ_ROOT=/onefuzz
Expand Down

0 comments on commit 24d1a20

Please sign in to comment.