Repository navigation
refactor(ffi): annotate Diplomat getters and setters - #538
Merged
irvingouj@Devolutions (irvingoujAtDevolution) merged 1 commit intoOct 16, 2026
Merged
irvingouj@Devolutions (irvingoujAtDevolution) merged 1 commit into
irvingouj@Devolutions (irvingoujAtDevolution) merged 1 commit into
Conversation
irvingouj@Devolutions (irvingoujAtDevolution)
added this pull request to stack #540
September 29, 2026 18:56
irvingouj@Devolutions (irvingoujAtDevolution)
marked this pull request as ready for review
September 29, 2026 19:24
irvingouj@Devolutions (irvingoujAtDevolution)
force-pushed
the
ffi/diplomat-bridge-attrs
branch
from
October 8, 2026 00:10
d0669ec to
fae1d56
Compare
irvingouj@Devolutions (irvingoujAtDevolution)
force-pushed
the
ffi/diplomat-bridge-attrs
branch
from
October 13, 2026 12:58
fae1d56 to
d027405
Compare
irvingouj@Devolutions (irvingoujAtDevolution)
removed this pull request from stack #540
October 13, 2026 13:02
irvingouj@Devolutions (irvingoujAtDevolution)
added this pull request to stack #562
October 13, 2026 13:02
irvingouj@Devolutions (irvingoujAtDevolution)
removed this pull request from stack #562
October 14, 2026 14:44
irvingouj@Devolutions (irvingoujAtDevolution)
added this pull request to stack #567
October 14, 2026 14:45
irvingouj@Devolutions (irvingoujAtDevolution)
force-pushed
the
ffi/diplomat-bridge-attrs
branch
from
October 14, 2026 14:52
d027405 to
a25a86a
Compare
irvingouj@Devolutions (irvingoujAtDevolution)
force-pushed
the
ffi/diplomat-bridge-attrs
branch
from
October 14, 2026 15:46
a25a86a to
f67916d
Compare
irvingouj@Devolutions (irvingoujAtDevolution)
removed this pull request from stack #567
October 14, 2026 15:46
irvingouj@Devolutions (irvingoujAtDevolution)
added this pull request to stack #570
October 14, 2026 15:46
irvingouj@Devolutions (irvingoujAtDevolution)
force-pushed
the
ffi/diplomat-bridge-attrs
branch
from
October 14, 2026 20:03
f67916d to
08e497d
Compare
Base automatically changed from
ffi/authenticode-borrow-program-name
to
master
October 14, 2026 20:03
Adds the `#[diplomat::attr(auto, getter/setter)]` markers the next Diplomat needs: 174 getter/setter names, since it no longer turns `get_`/`set_` prefixes into C# properties. The Diplomat pinned today drops these attributes, so the generated C# doesn't change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
irvingouj@Devolutions (irvingoujAtDevolution)
force-pushed
the
ffi/diplomat-bridge-attrs
branch
from
October 14, 2026 20:03
08e497d to
83a36c9
Compare
irvingouj@Devolutions (irvingoujAtDevolution)
requested a review
from Benoît Cortier (CBenoit)
October 14, 2026 21:09
irvingouj@Devolutions (irvingoujAtDevolution)
merged commit Oct 16, 2026
fb0300d
into
master
15 checks passed
irvingouj@Devolutions (irvingoujAtDevolution)
deleted the
ffi/diplomat-bridge-attrs
branch
October 16, 2026 23:40
irvingouj@Devolutions (irvingoujAtDevolution)
added a commit
that referenced
this pull request
Oct 17, 2026
Moves the .NET bindings off the old [CBenoit/diplomat@f4d93d57](CBenoit/diplomat@f4d93d5) fork onto Diplomat's HIR .NET backend, pinned to the protected tag [`0.16.1-devo.2`](https://github.com/Devolutions/diplomat/tree/0.16.1-devo.2) (same commit as upstream main, [002db80c](rust-diplomat/diplomat@002db80)). crates.io 0.16.1 predates the .NET lifetime rework, so it's a tag until upstream publishes. Supersedes #518. Split into a stack so this one is just the migration: 1. #561 drops .NET Framework, targets net8.0 2. #537 `program_name` double free fix 3. #538 getter/setter attrs, no generated diff 4. #569 `manually_disposable` on the 14 types that need it, no generated diff 5. this PR 6. #541 fixes a use-after-free in `AuthenticodeValidator` 7. #542 wipes key bytes and passphrases on free The bridge diff here is only what HIR needs: `opaque_mut`, named lifetimes, `DiplomatWrite`, and no `#[derive(Clone, Copy)]` on enums (the macro adds it now). The rest is `Generated/`, the addons and test renames. C# properties stay the same (176 before, 176 after). ### Breaking (C#) - `GetX()`/`SetX()` methods that duplicated properties are gone; the properties stay - `HashAlgorithm`/`ShaVariant`/`JwsAlg`/`SshCertKeyType` members are re-cased (`SHA2_256` → `Sha2256`), same numeric values - `DiplomatWriteable`, `AsFFI()`, the raw ctors and `Raw.*` aren't public anymore; `PickyError.ToDisplay()` returns `string` - only the 14 types from #569 stay `IDisposable`, the other 84 lose it, so `using`/`Dispose()` on them won't compile anymore I grepped the RDM monorepo (RDM, DVLS, Hub, PowerShell): none of the removed methods or enum names are used. They do dispose `Cert` and `using` `Pkcs12ParsingParams`/`Pkcs12Attribute`, those lines have to go when they bump. That's a text search, not a compile. ### Where to look hardest - the addons take a shared lease for the whole native call, same as the generated code: [Pem](https://github.com/Devolutions/picky-rs/blob/d44f8bf021013f285fbd360defe1fb1f964d64b4/ffi/dotnet/Devolutions.Picky/src/Pem.Addons.cs), [Pfx](https://github.com/Devolutions/picky-rs/blob/d44f8bf021013f285fbd360defe1fb1f964d64b4/ffi/dotnet/Devolutions.Picky/src/Pfx.Addons.cs), [PublicKey](https://github.com/Devolutions/picky-rs/blob/d44f8bf021013f285fbd360defe1fb1f964d64b4/ffi/dotnet/Devolutions.Picky/src/PublicKey.Addons.cs) - the test renames in `JwtTests`/`Pkcs7Tests`/`SshTests`, that's what consumers will have to change ### Tests - clippy/fmt clean, regenerating the bindings is a no-op (267/267 files) - `Devolutions.Picky.Tests` 26/26 ### Needs a call - NuGet is date-versioned with no changelog. How do we want to announce the breaks? ### Not from this PR, spotted while here - `PuttyPpkEncryptionConfigBuilder` setters call `self.0.clone().x(..)` and throw the result away, so they do nothing - `get_argon2_flavour` is a setter with a getter name Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the 174 getter/setter names the new Diplomat in #536 needs, so that PR only has the actual migration. The HIR backend doesn't turn
get_/set_prefixes into properties anymore, so each name here should match the property already inGenerated/.The
IDisposableopt-ins are in #569, right above this one.The Diplomat we pin today drops these attrs, so there's no generated diff. I checked by regenerating with the pinned tool. Heads up, that tool can't regenerate master as-is: its syn chokes on
#[unsafe(no_mangle)], so I swapped in#[no_mangle]locally for the check.Tested: clippy clean,
Devolutions.Picky.Tests26/26 locally.