Skip to content

Commit

Permalink
fix rust chain issues OWASP/wrongsecrets#1243
Browse files Browse the repository at this point in the history
  • Loading branch information
commjoen committed Feb 29, 2024
1 parent c97b7b9 commit f128b3a
Show file tree
Hide file tree
Showing 6 changed files with 170 additions and 18 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,7 @@ target/
# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb
dotnet/dotnetproject/bin/
dotnet/dotnetproject/obj/Release/
dotnet/dotnetproject/obj/Release/

#MACOS
.DS_Store
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"dependencies": {
"Microsoft.NET.ILLink.Tasks": {
"suppressParent": "All",
"target": "Package",
"version": "[8.0.1, )",
"autoReferenced": true
}
},
"imports": [
"net461",
"net462",
Expand Down
6 changes: 6 additions & 0 deletions dotnet/dotnetproject/obj/dotnetproject.csproj.nuget.g.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,10 @@
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="/Users/razr/.nuget/packages/" />
</ItemGroup>
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)microsoft.net.illink.tasks/8.0.1/build/Microsoft.NET.ILLink.Tasks.props" Condition="Exists('$(NuGetPackageRoot)microsoft.net.illink.tasks/8.0.1/build/Microsoft.NET.ILLink.Tasks.props')" />
</ImportGroup>
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<PkgMicrosoft_NET_ILLink_Tasks Condition=" '$(PkgMicrosoft_NET_ILLink_Tasks)' == '' ">/Users/razr/.nuget/packages/microsoft.net.illink.tasks/8.0.1</PkgMicrosoft_NET_ILLink_Tasks>
</PropertyGroup>
</Project>
147 changes: 136 additions & 11 deletions dotnet/dotnetproject/obj/project.assets.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,136 @@
{
"version": 3,
"targets": {
"net8.0": {},
"net8.0/linux-arm64": {},
"net8.0/linux-musl-arm64": {},
"net8.0/linux-musl-x64": {},
"net8.0/linux-x64": {},
"net8.0/osx-arm64": {},
"net8.0/osx-x64": {},
"net8.0/win-arm64": {},
"net8.0/win-x64": {}
"net8.0": {
"Microsoft.NET.ILLink.Tasks/8.0.1": {
"type": "package",
"build": {
"build/Microsoft.NET.ILLink.Tasks.props": {}
}
}
},
"net8.0/linux-arm64": {
"Microsoft.NET.ILLink.Tasks/8.0.1": {
"type": "package",
"build": {
"build/Microsoft.NET.ILLink.Tasks.props": {}
}
}
},
"net8.0/linux-musl-arm64": {
"Microsoft.NET.ILLink.Tasks/8.0.1": {
"type": "package",
"build": {
"build/Microsoft.NET.ILLink.Tasks.props": {}
}
}
},
"net8.0/linux-musl-x64": {
"Microsoft.NET.ILLink.Tasks/8.0.1": {
"type": "package",
"build": {
"build/Microsoft.NET.ILLink.Tasks.props": {}
}
}
},
"net8.0/linux-x64": {
"Microsoft.NET.ILLink.Tasks/8.0.1": {
"type": "package",
"build": {
"build/Microsoft.NET.ILLink.Tasks.props": {}
}
}
},
"net8.0/osx-arm64": {
"Microsoft.NET.ILLink.Tasks/8.0.1": {
"type": "package",
"build": {
"build/Microsoft.NET.ILLink.Tasks.props": {}
}
}
},
"net8.0/osx-x64": {
"Microsoft.NET.ILLink.Tasks/8.0.1": {
"type": "package",
"build": {
"build/Microsoft.NET.ILLink.Tasks.props": {}
}
}
},
"net8.0/win-arm64": {
"Microsoft.NET.ILLink.Tasks/8.0.1": {
"type": "package",
"build": {
"build/Microsoft.NET.ILLink.Tasks.props": {}
}
}
},
"net8.0/win-x64": {
"Microsoft.NET.ILLink.Tasks/8.0.1": {
"type": "package",
"build": {
"build/Microsoft.NET.ILLink.Tasks.props": {}
}
}
}
},
"libraries": {
"Microsoft.NET.ILLink.Tasks/8.0.1": {
"sha512": "ADdJXuKNjwZDfBmybMnpvwd5CK3gp92WkWqqeQhW4W+q4MO3Qaa9QyW2DcFLAvCDMcCWxT5hRXqGdv13oon7nA==",
"type": "package",
"path": "microsoft.net.illink.tasks/8.0.1",
"hasTools": true,
"files": [
".nupkg.metadata",
".signature.p7s",
"Icon.png",
"LICENSE.TXT",
"Sdk/Sdk.props",
"THIRD-PARTY-NOTICES.TXT",
"analyzers/dotnet/cs/ILLink.CodeFixProvider.dll",
"analyzers/dotnet/cs/ILLink.RoslynAnalyzer.dll",
"build/Microsoft.NET.ILLink.Analyzers.props",
"build/Microsoft.NET.ILLink.Tasks.props",
"build/Microsoft.NET.ILLink.targets",
"microsoft.net.illink.tasks.8.0.1.nupkg.sha512",
"microsoft.net.illink.tasks.nuspec",
"tools/net472/ILLink.Tasks.dll",
"tools/net472/ILLink.Tasks.dll.config",
"tools/net472/Mono.Cecil.Mdb.dll",
"tools/net472/Mono.Cecil.Pdb.dll",
"tools/net472/Mono.Cecil.Rocks.dll",
"tools/net472/Mono.Cecil.dll",
"tools/net472/Sdk/Sdk.props",
"tools/net472/System.Buffers.dll",
"tools/net472/System.Collections.Immutable.dll",
"tools/net472/System.Memory.dll",
"tools/net472/System.Numerics.Vectors.dll",
"tools/net472/System.Reflection.Metadata.dll",
"tools/net472/System.Runtime.CompilerServices.Unsafe.dll",
"tools/net472/build/Microsoft.NET.ILLink.Analyzers.props",
"tools/net472/build/Microsoft.NET.ILLink.Tasks.props",
"tools/net472/build/Microsoft.NET.ILLink.targets",
"tools/net8.0/ILLink.Tasks.deps.json",
"tools/net8.0/ILLink.Tasks.dll",
"tools/net8.0/Mono.Cecil.Mdb.dll",
"tools/net8.0/Mono.Cecil.Pdb.dll",
"tools/net8.0/Mono.Cecil.Rocks.dll",
"tools/net8.0/Mono.Cecil.dll",
"tools/net8.0/Sdk/Sdk.props",
"tools/net8.0/build/Microsoft.NET.ILLink.Analyzers.props",
"tools/net8.0/build/Microsoft.NET.ILLink.Tasks.props",
"tools/net8.0/build/Microsoft.NET.ILLink.targets",
"tools/net8.0/illink.deps.json",
"tools/net8.0/illink.dll",
"tools/net8.0/illink.runtimeconfig.json",
"useSharedDesignerContext.txt"
]
}
},
"libraries": {},
"projectFileDependencyGroups": {
"net8.0": []
"net8.0": [
"Microsoft.NET.ILLink.Tasks >= 8.0.1"
]
},
"packageFolders": {
"/Users/razr/.nuget/packages/": {}
Expand Down Expand Up @@ -51,6 +168,14 @@
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"dependencies": {
"Microsoft.NET.ILLink.Tasks": {
"suppressParent": "All",
"target": "Package",
"version": "[8.0.1, )",
"autoReferenced": true
}
},
"imports": [
"net461",
"net462",
Expand Down
11 changes: 6 additions & 5 deletions dotnet/dotnetproject/obj/project.nuget.cache
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
{
"version": 2,
"dgSpecHash": "IOJduASDn1lomXmrl+zyr/UVvNs5YH5go9hR8aKy8suOqBNIZwkauUgBNvR4rmvzVJUFGn7unM7FJ3WkFiuFLg==",
"dgSpecHash": "5AGjbV3PWUJHWnAJGIZfp44rrZGd7E92mp2St/kx4u5mQfvXxJ/OqrQFFSVqfL/cPvSpiNt37QpYTmne5R/zpA==",
"success": true,
"projectFilePath": "/Users/razr/workspace/owasp/wrongsecrets-binaries/dotnet/dotnetproject/dotnetproject.csproj",
"expectedPackageFiles": [
"/Users/razr/.nuget/packages/microsoft.net.illink.tasks/8.0.1/microsoft.net.illink.tasks.8.0.1.nupkg.sha512",
"/Users/razr/.nuget/packages/microsoft.netcore.app.runtime.linux-musl-arm64/8.0.1/microsoft.netcore.app.runtime.linux-musl-arm64.8.0.1.nupkg.sha512",
"/Users/razr/.nuget/packages/microsoft.netcore.app.runtime.osx-arm64/8.0.1/microsoft.netcore.app.runtime.osx-arm64.8.0.1.nupkg.sha512",
"/Users/razr/.nuget/packages/microsoft.netcore.app.runtime.win-x64/8.0.1/microsoft.netcore.app.runtime.win-x64.8.0.1.nupkg.sha512",
"/Users/razr/.nuget/packages/microsoft.netcore.app.runtime.win-arm64/8.0.1/microsoft.netcore.app.runtime.win-arm64.8.0.1.nupkg.sha512",
"/Users/razr/.nuget/packages/microsoft.netcore.app.runtime.linux-x64/8.0.1/microsoft.netcore.app.runtime.linux-x64.8.0.1.nupkg.sha512",
"/Users/razr/.nuget/packages/microsoft.netcore.app.runtime.linux-arm64/8.0.1/microsoft.netcore.app.runtime.linux-arm64.8.0.1.nupkg.sha512",
"/Users/razr/.nuget/packages/microsoft.netcore.app.runtime.linux-musl-x64/8.0.1/microsoft.netcore.app.runtime.linux-musl-x64.8.0.1.nupkg.sha512",
"/Users/razr/.nuget/packages/microsoft.netcore.app.runtime.linux-musl-arm64/8.0.1/microsoft.netcore.app.runtime.linux-musl-arm64.8.0.1.nupkg.sha512",
"/Users/razr/.nuget/packages/microsoft.aspnetcore.app.runtime.linux-musl-arm64/8.0.1/microsoft.aspnetcore.app.runtime.linux-musl-arm64.8.0.1.nupkg.sha512",
"/Users/razr/.nuget/packages/microsoft.aspnetcore.app.runtime.osx-arm64/8.0.1/microsoft.aspnetcore.app.runtime.osx-arm64.8.0.1.nupkg.sha512",
"/Users/razr/.nuget/packages/microsoft.aspnetcore.app.runtime.win-x64/8.0.1/microsoft.aspnetcore.app.runtime.win-x64.8.0.1.nupkg.sha512",
"/Users/razr/.nuget/packages/microsoft.aspnetcore.app.runtime.win-arm64/8.0.1/microsoft.aspnetcore.app.runtime.win-arm64.8.0.1.nupkg.sha512",
"/Users/razr/.nuget/packages/microsoft.aspnetcore.app.runtime.linux-x64/8.0.1/microsoft.aspnetcore.app.runtime.linux-x64.8.0.1.nupkg.sha512",
"/Users/razr/.nuget/packages/microsoft.aspnetcore.app.runtime.linux-arm64/8.0.1/microsoft.aspnetcore.app.runtime.linux-arm64.8.0.1.nupkg.sha512",
"/Users/razr/.nuget/packages/microsoft.aspnetcore.app.runtime.linux-musl-x64/8.0.1/microsoft.aspnetcore.app.runtime.linux-musl-x64.8.0.1.nupkg.sha512",
"/Users/razr/.nuget/packages/microsoft.aspnetcore.app.runtime.linux-musl-arm64/8.0.1/microsoft.aspnetcore.app.runtime.linux-musl-arm64.8.0.1.nupkg.sha512",
"/Users/razr/.nuget/packages/microsoft.netcore.app.host.linux-musl-arm64/8.0.1/microsoft.netcore.app.host.linux-musl-arm64.8.0.1.nupkg.sha512",
"/Users/razr/.nuget/packages/microsoft.netcore.app.host.osx-arm64/8.0.1/microsoft.netcore.app.host.osx-arm64.8.0.1.nupkg.sha512",
"/Users/razr/.nuget/packages/microsoft.netcore.app.host.win-x64/8.0.1/microsoft.netcore.app.host.win-x64.8.0.1.nupkg.sha512",
"/Users/razr/.nuget/packages/microsoft.netcore.app.host.win-arm64/8.0.1/microsoft.netcore.app.host.win-arm64.8.0.1.nupkg.sha512",
"/Users/razr/.nuget/packages/microsoft.netcore.app.host.linux-x64/8.0.1/microsoft.netcore.app.host.linux-x64.8.0.1.nupkg.sha512",
"/Users/razr/.nuget/packages/microsoft.netcore.app.host.linux-arm64/8.0.1/microsoft.netcore.app.host.linux-arm64.8.0.1.nupkg.sha512",
"/Users/razr/.nuget/packages/microsoft.netcore.app.host.linux-musl-x64/8.0.1/microsoft.netcore.app.host.linux-musl-x64.8.0.1.nupkg.sha512",
"/Users/razr/.nuget/packages/microsoft.netcore.app.host.linux-musl-arm64/8.0.1/microsoft.netcore.app.host.linux-musl-arm64.8.0.1.nupkg.sha512"
"/Users/razr/.nuget/packages/microsoft.netcore.app.host.linux-musl-x64/8.0.1/microsoft.netcore.app.host.linux-musl-x64.8.0.1.nupkg.sha512"
],
"logs": []
}
11 changes: 10 additions & 1 deletion quickbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ echo "prerequired: chmod +x ./dockcross-linux-arm64-musl && mv ./dockcross-linux
echo "Compiling C for Musl on X86"
echo "prerequired: brew install FiloSottile/musl-cross/musl-cross"
echo "prerequired: ln -s /usr/local/opt/musl-cross/bin/x86_64-linux-musl-gcc /usr/local/bin/musl-gcc"
x86_64-linux-musl-gcc c/main.c -o wrongsecrets-c-linux-musl
x86_64-linux-musl-gcc c/main.c -o wrongsecrets-c-linux-musl -Wno-attributes
x86_64-linux-musl-gcc c/advanced/advanced.c -o wrongsecrets-advanced-c-linux-musl

echo "stripping"
Expand Down Expand Up @@ -90,6 +90,14 @@ cd ..
echo "compiling rust, requires 'cargo install -f cross'"
cd rust
rm ~/.cargo/config.toml
cargo install -f cross
rustup target add x86_64-apple-darwin
rustup target add aarch64-apple-darwin
rustup target add x86_64-pc-windows-gnu
rustup target add x86_64-unknown-linux-musl
rustup target add aarch64-unknown-linux-musl
rustup component add rust-std
rustup update
echo "compiling rust for amd64 linux"
cross build --target x86_64-unknown-linux-gnu --release
cp target/x86_64-unknown-linux-gnu/release/rust ../wrongsecrets-rust-linux
Expand Down Expand Up @@ -119,6 +127,7 @@ echo "compiling for musl linux (ARM)"
rustup target add aarch64-unknown-linux-musl
cargo build --target aarch64-unknown-linux-musl --release
cp target/aarch64-unknown-linux-musl/release/rust ../wrongsecrets-rust-linux-musl-arm
cd ..

echo "compiling for .net: requires 'brew install dotnet' on MacOS"
cd dotnet/dotnetproject
Expand Down

0 comments on commit f128b3a

Please sign in to comment.