Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/benchmark-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ jobs:
- uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: |
8.0.x
10.0.x
11.0.x

- uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0
with:
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,8 @@ jobs:
- uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: |
8.0.x
10.0.x
11.0.x
- name: Build .NET binding (x86_64)
env:
TARGET_ARCH: x86_64
Expand All @@ -440,8 +440,8 @@ jobs:
- uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: |
8.0.x
10.0.x
11.0.x
- name: Download rlib artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
Expand Down Expand Up @@ -749,8 +749,8 @@ jobs:
if: matrix.binding == 'dotnet'
with:
dotnet-version: |
8.0.x
10.0.x
11.0.x
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
if: matrix.binding == 'go'
with:
Expand Down Expand Up @@ -830,6 +830,11 @@ jobs:
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 20
- uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: |
10.0.x
11.0.x
- uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0
with:
# canonical com.godaddy.asherah:appencryption@0.4.0 is compiled
Expand Down Expand Up @@ -1253,8 +1258,8 @@ jobs:
apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu wget curl
wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
chmod +x dotnet-install.sh
./dotnet-install.sh --channel 8.0 --install-dir /usr/share/dotnet
./dotnet-install.sh --channel 10.0 --install-dir /usr/share/dotnet
./dotnet-install.sh --channel 11.0 --install-dir /usr/share/dotnet
ln -sf /usr/share/dotnet/dotnet /usr/bin/dotnet
bash "${GITHUB_WORKSPACE:-$(pwd)}/scripts/install-sccache.sh"
- name: Build .NET binding (arm64)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ jobs:
- uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: |
8.0.x
10.0.x
11.0.x

- name: Set version
env:
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ guidelines keep contributions consistent and easy to review.
2. Install language toolchains for the bindings you plan to touch:
- Node.js 18+
- Python 3.8+
- .NET 8.0 or 10.0
- .NET 11 SDK and .NET 10 runtime (for testing both target frameworks)
- Java 11+ (Maven)
- Ruby 3.0+
- Go 1.26+
Expand Down Expand Up @@ -68,7 +68,7 @@ Individual binding tests:
|---------|---------|
| Node.js | `cd asherah-node && npm test` |
| Python | `maturin develop --manifest-path asherah-py/Cargo.toml && pytest asherah-py/tests/` |
| .NET | `dotnet test asherah-dotnet/GoDaddy.Asherah.Encryption.slnx --nologo -p:RestoreLockedMode=true` |
| .NET | `dotnet test --solution asherah-dotnet/GoDaddy.Asherah.Encryption.slnx --nologo -p:RestoreLockedMode=true` |
| Java | `cd asherah-java/java && mvn test` |
| Ruby | `ruby -Iasherah-ruby/lib -Iasherah-ruby/test asherah-ruby/test/round_trip_test.rb` |
| Go | `cd asherah-go && go test ./...` |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ refresh loads the latest version from the metastore.

- **127 Rust unit tests** covering core encryption engine, key management,
metastore adapters, and memory protection
- **64 .NET tests** (34 core + 30 compatibility layer) across net8.0 and net10.0
- **64 .NET tests** (34 core + 30 compatibility layer) across net10.0 and net11.0
- **49 Node.js tests** including async context, unicode, binary edge cases, and
Factory/Session API
- **21 Go tests** covering Factory/Session API and compatibility layer
Expand Down
2 changes: 1 addition & 1 deletion asherah-dotnet/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<TargetFrameworks>net10.0;net8.0</TargetFrameworks>
<TargetFrameworks>net10.0;net11.0</TargetFrameworks>
Comment thread
mmicco-godaddy marked this conversation as resolved.
Resolved
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>latest</LangVersion>
Expand Down
9 changes: 4 additions & 5 deletions asherah-dotnet/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="coverlet.collector" Version="10.0.1" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.9" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.6.0" />
<PackageVersion Include="coverlet.MTP" Version="10.1.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.15" Condition="'$(TargetFramework)' == 'net10.0'" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="11.0.0" Condition="'$(TargetFramework)' == 'net11.0'" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.4" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
<PackageVersion Include="xunit.v3" Version="3.2.2" />
<PackageVersion Include="xunit.v3" Version="4.0.3" />
</ItemGroup>
</Project>
17 changes: 13 additions & 4 deletions asherah-dotnet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ P/Invoke; the native binary ships in NuGet for `linux-x64`, `linux-arm64`,
dotnet add package GoDaddy.Asherah.Encryption
```

Targets `net8.0` and `net10.0`. Namespace: `GoDaddy.Asherah.Encryption`.
Targets `net10.0` and `net11.0`. Namespace: `GoDaddy.Asherah.Encryption`.
The package is currently on the `0.50.x-beta` track; pin the exact beta version
you validate in your application instead of relying on floating prerelease
resolution.
Expand Down Expand Up @@ -592,20 +592,29 @@ parity (those forward to `AsherahHooks` internally).

## Building from Source

From the repository root:
From the repository root, configure the test-only in-memory setup before running either test command:

```bash
export SERVICE_NAME=svc
export PRODUCT_ID=prod
export KMS=test-debug-static
export STATIC_MASTER_KEY_HEX=2222222222222222222222222222222222222222222222222222222222222222
```

The static master key is for tests only; use AWS KMS in production.

**Debug FFI (simplest)** — test projects locate the workspace root and, when `ASHERAH_DOTNET_NATIVE` is unset, point it at `target/debug` automatically:

```bash
cargo build -p asherah-ffi
dotnet test asherah-dotnet/GoDaddy.Asherah.Encryption.slnx --nologo -p:RestoreLockedMode=true
dotnet test --solution asherah-dotnet/GoDaddy.Asherah.Encryption.slnx --nologo -p:RestoreLockedMode=true
```

**Release FFI** — use a **shell-expanded absolute path** for `ASHERAH_DOTNET_NATIVE`. A value like `target/release` alone is wrong: the binding resolves relative paths against the test process working directory, not the repo root.

```bash
cargo build --release -p asherah-ffi
ASHERAH_DOTNET_NATIVE="$(pwd)/target/release" dotnet test asherah-dotnet/GoDaddy.Asherah.Encryption.slnx --nologo -p:RestoreLockedMode=true
ASHERAH_DOTNET_NATIVE="$(pwd)/target/release" dotnet test --solution asherah-dotnet/GoDaddy.Asherah.Encryption.slnx --nologo -p:RestoreLockedMode=true
```

`ASHERAH_DOTNET_NATIVE` must refer to the directory containing `libasherah_ffi.dylib` / `libasherah_ffi.so` / `asherah_ffi.dll`. Without a correct path, the loader can bind a different `asherah_ffi` on `PATH` and tests may fail with missing entry points.
Expand Down
2 changes: 1 addition & 1 deletion asherah-dotnet/docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ encrypt/decrypt. After this guide, see:
dotnet add package GoDaddy.Asherah.Encryption
```

Targets `net8.0` and `net10.0`. Native binaries for Linux x64/arm64
Targets `net10.0` and `net11.0`. Native binaries for Linux x64/arm64
(glibc + musl), macOS x64/arm64, and Windows x64/arm64 ship with the
package.

Expand Down
5 changes: 3 additions & 2 deletions asherah-dotnet/docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,12 @@ tests.
The NuGet package ships native binaries under `runtimes/<rid>/native/`.
Tests run from `bin/Debug/<tfm>/` and the .NET runtime resolves the
binary automatically. If a test fails with "unable to load
asherah_ffi", set `ASHERAH_DOTNET_NATIVE` to an explicit directory:
asherah_ffi", set `ASHERAH_DOTNET_NATIVE` to an explicit directory from
the repository root:

```bash
export ASHERAH_DOTNET_NATIVE="$(pwd)/target/debug"
dotnet test
dotnet test --solution asherah-dotnet/GoDaddy.Asherah.Encryption.slnx
```

Locally during repository development, point this at your `cargo
Expand Down
6 changes: 3 additions & 3 deletions asherah-dotnet/docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,13 @@ If that's failing:
`<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>`.

**For repo development:** the native library is built by `cargo build`
into `target/<profile>/`. Set `ASHERAH_DOTNET_NATIVE` to an absolute
path:
into `target/<profile>/`. From the repository root, set
`ASHERAH_DOTNET_NATIVE` to an absolute path:

```bash
cargo build -p asherah-ffi
export ASHERAH_DOTNET_NATIVE="$(pwd)/target/debug"
dotnet test
dotnet test --solution asherah-dotnet/GoDaddy.Asherah.Encryption.slnx
```

A relative path (`target/debug`) is wrong — the binding resolves
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,57 +10,34 @@
},
"Microsoft.Extensions.DependencyInjection.Abstractions": {
"type": "Transitive",
"resolved": "10.0.9",
"contentHash": "g41l/30G3K4B/d/L8kjux0+30e27c8D0FVQ/PFCpbekgfDpj9mnDhieP67EqXWvl1EWNeZh2rpR4F5B/jcDOHA=="
"resolved": "10.0.15",
"contentHash": "KczR2nV7ooeimtZxAawPht/FJUHnX+uoWy7y4pba+iaRQBwUM2NwtiqZg+/FpZDHUf2RkkzveGkhMTWDNzmDUA=="
},
"godaddy.asherah.encryption": {
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[10.0.9, )"
"Microsoft.Extensions.Logging.Abstractions": "[10.0.15, )"
}
},
"Microsoft.Extensions.Logging.Abstractions": {
"type": "CentralTransitive",
"requested": "[10.0.9, )",
"resolved": "10.0.9",
"contentHash": "9S/DFt4cohlMPpzIxjG6kk0L8MuN2vDm9pbMCulxtJzzk82oJHVLBd8vuQxaPskaYQwKqmFmbannf5eoChgjYg==",
"requested": "[10.0.15, )",
"resolved": "10.0.15",
"contentHash": "s5xzXGWqqlmmThMnQ1rnmL7QLwbluB2JqX9NaK8C9HPuHzN7kfmiddTRbwts5rQssATkh2B18RrofjeUD8g14A==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.9"
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.15"
}
}
},
"net8.0": {
"net11.0": {
"Newtonsoft.Json": {
"type": "Direct",
"requested": "[13.0.4, )",
"resolved": "13.0.4",
"contentHash": "pdgNNMai3zv51W5aq268sujXUyx7SNdE2bj1wZcWjAQrKMFZV260lbqYop1d2GM67JI1huLRwxo9ZqnfF/lC6A=="
},
"Microsoft.Extensions.DependencyInjection.Abstractions": {
"type": "Transitive",
"resolved": "10.0.9",
"contentHash": "g41l/30G3K4B/d/L8kjux0+30e27c8D0FVQ/PFCpbekgfDpj9mnDhieP67EqXWvl1EWNeZh2rpR4F5B/jcDOHA=="
},
"System.Diagnostics.DiagnosticSource": {
"type": "Transitive",
"resolved": "10.0.9",
"contentHash": "VzIU41Sb23Em98hDQc71LPwKTC72xkiG7lpCZaIkf84jBJW+ViaKPa24qqR4FPmj1N4vDWilzs6Dq5Om8aFj+Q=="
},
"godaddy.asherah.encryption": {
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[10.0.9, )"
}
},
"Microsoft.Extensions.Logging.Abstractions": {
"type": "CentralTransitive",
"requested": "[10.0.9, )",
"resolved": "10.0.9",
"contentHash": "9S/DFt4cohlMPpzIxjG6kk0L8MuN2vDm9pbMCulxtJzzk82oJHVLBd8vuQxaPskaYQwKqmFmbannf5eoChgjYg==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.9",
"System.Diagnostics.DiagnosticSource": "10.0.9"
}
"type": "Project"
}
}
}
Expand Down
14 changes: 5 additions & 9 deletions asherah-dotnet/src/GoDaddy.Asherah.Encryption/AsherahSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -396,15 +396,11 @@ private static void AsyncCompletionCallback(
// Wrap the entire callback body in a catch-all because this
// function is invoked from native code (a tokio worker
// thread). An exception that unwinds out of an
// `[UnmanagedCallersOnly]` method into native code is UB on
// .NET 8 — the runtime can't propagate managed exceptions
// through Rust frames, so the process dies with an opaque
// `EXCEPTION_NONCONTINUABLE` or terminates silently. Catch
// everything, surface it through the TaskCompletionSource so
// the awaiting consumer sees a normal AggregateException, and
// never let an exception escape this frame. T-finding
// "[UnmanagedCallersOnly] callback can let SetException
// exception unwind into native code (UB in .NET 8)" in
// `[UnmanagedCallersOnly]` method into native code cannot be
// propagated through Rust frames and may terminate the process.
// Catch everything, surface it through the TaskCompletionSource
// so the awaiting consumer sees the error, and never let an
// exception escape this frame. See the callback finding in
// `docs/review-2026-05-05-findings.md`.
AsyncCallbackState? state = null;
try
Expand Down
50 changes: 18 additions & 32 deletions asherah-dotnet/src/GoDaddy.Asherah.Encryption/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
"net10.0": {
"Microsoft.Extensions.Logging.Abstractions": {
"type": "Direct",
"requested": "[10.0.9, )",
"resolved": "10.0.9",
"contentHash": "9S/DFt4cohlMPpzIxjG6kk0L8MuN2vDm9pbMCulxtJzzk82oJHVLBd8vuQxaPskaYQwKqmFmbannf5eoChgjYg==",
"requested": "[10.0.15, )",
"resolved": "10.0.15",
"contentHash": "s5xzXGWqqlmmThMnQ1rnmL7QLwbluB2JqX9NaK8C9HPuHzN7kfmiddTRbwts5rQssATkh2B18RrofjeUD8g14A==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.9"
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.15"
}
},
"Microsoft.Extensions.DependencyInjection.Abstractions": {
"type": "Transitive",
"resolved": "10.0.9",
"contentHash": "g41l/30G3K4B/d/L8kjux0+30e27c8D0FVQ/PFCpbekgfDpj9mnDhieP67EqXWvl1EWNeZh2rpR4F5B/jcDOHA=="
"resolved": "10.0.15",
"contentHash": "KczR2nV7ooeimtZxAawPht/FJUHnX+uoWy7y4pba+iaRQBwUM2NwtiqZg+/FpZDHUf2RkkzveGkhMTWDNzmDUA=="
}
},
"net10.0/linux-arm64": {},
Expand All @@ -25,35 +25,21 @@
"net10.0/osx-x64": {},
"net10.0/win-arm64": {},
"net10.0/win-x64": {},
"net8.0": {
"net11.0": {
"Microsoft.Extensions.Logging.Abstractions": {
"type": "Direct",
"requested": "[10.0.9, )",
"resolved": "10.0.9",
"contentHash": "9S/DFt4cohlMPpzIxjG6kk0L8MuN2vDm9pbMCulxtJzzk82oJHVLBd8vuQxaPskaYQwKqmFmbannf5eoChgjYg==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.9",
"System.Diagnostics.DiagnosticSource": "10.0.9"
}
},
"Microsoft.Extensions.DependencyInjection.Abstractions": {
"type": "Transitive",
"resolved": "10.0.9",
"contentHash": "g41l/30G3K4B/d/L8kjux0+30e27c8D0FVQ/PFCpbekgfDpj9mnDhieP67EqXWvl1EWNeZh2rpR4F5B/jcDOHA=="
},
"System.Diagnostics.DiagnosticSource": {
"type": "Transitive",
"resolved": "10.0.9",
"contentHash": "VzIU41Sb23Em98hDQc71LPwKTC72xkiG7lpCZaIkf84jBJW+ViaKPa24qqR4FPmj1N4vDWilzs6Dq5Om8aFj+Q=="
"requested": "[11.0.0, )",
"resolved": "11.0.0",
"contentHash": "MTMO2V1eT9Dm5VIpJGLNwIjAjoBErUlfuB+DEaZ0tb8J+Nf/Xlj8he5AztK9p1iOJPIyuBeOrVy2u/CSdsfzPw=="
}
},
"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": {}
"net11.0/linux-arm64": {},
"net11.0/linux-musl-arm64": {},
"net11.0/linux-musl-x64": {},
"net11.0/linux-x64": {},
"net11.0/osx-arm64": {},
"net11.0/osx-x64": {},
"net11.0/win-arm64": {},
"net11.0/win-x64": {}
}
}
14 changes: 4 additions & 10 deletions asherah-dotnet/tests/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,15 @@
<PropertyGroup>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<!-- Ensure apphost is emitted for every TFM (net8.0 was missing it under SDK 10 + xUnit v3, breaking _CopyOutOfDateSourceItemsToOutputDirectory). -->
<OutputType>Exe</OutputType>
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
<!-- Ensure an apphost is emitted for every test target framework. -->
<UseAppHost>true</UseAppHost>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit.v3" />
<PackageReference Include="xunit.runner.visualstudio">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.MTP" PrivateAssets="all" />
</ItemGroup>

</Project>
Loading
Loading