Repository navigation
Derive strong name key pairs deterministically from a seed instead of a static .snk - #1
Conversation
Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
…ops, add error for manual key file, simplify Readme Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
…eorder demo imports, Readme tweaks Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
…y type Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
…onstructors/collection expressions, remove unused package, reorder members Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
Key generation can hang, produce undersized moduli, and vary across runtime byte orders.
Review effort: Balanced
Findings: None
What changed in this PR
Replaces Snek’s shared static signing key with keys derived deterministically from a configurable seed.
Changes:
- Adds deterministic RSA key generation and build-time caching.
- Integrates key generation into MSBuild and the demo.
- Documents seed configuration and removes the static-key workflow.
| File | Description |
|---|---|
| Snek/StrongNameTask.cs | Generates and caches key files. |
| Snek/StrongNameKeyPair.cs | Implements seeded RSA key generation. |
| Snek/Snek.targets | Resolves seeds and invokes generation. |
| Snek/Snek.props | Registers the signing task. |
| Snek/Snek.Local.props | Configures local task assembly paths. |
| Snek/Snek.csproj | Packages targets instead of the static key. |
| Snek/SeededRandom.cs | Adds a hash-based deterministic byte generator. |
| Snek.Demo/Snek.Demo.csproj | Imports local signing integration. |
| Readme.md | Documents derived keys and custom seeds. |
| Directory.Packages.props | Updates PolyShim. |
| .github/workflows/snk.yml | Removes manual static-key generation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@copilot is the modulus issue an easy fix? And how likely that it's going to manifest in a real environment? As for endianess, |
Yes, it’s a small fix: for the big-endian input, set |
|
@copilot let's do that. The |
Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Implemented in commit |
Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Previously Snek shipped a single static
Snek.snk, giving every consuming assembly the exact same public key token. This replaces it with a key pair generated deterministically from a seed at build time — same seed always yields the same key, different seeds yield different keys.Usage