Skip to content

test(ffi): cover SSPI with more tests - #750

Open
Pavlo Myroniuk (TheBestTvarynka) wants to merge 4 commits into
masterfrom
feat/improve-ffi-test-coverage
Open

Pavlo Myroniuk (TheBestTvarynka) wants to merge 4 commits into
masterfrom
feat/improve-ffi-test-coverage

Conversation

@TheBestTvarynka

@TheBestTvarynka Pavlo Myroniuk (TheBestTvarynka) commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Hi,

I added more tests to the FFI SSPI module. They cover QueryContextAttributesW/A, QuerySecurityPackageInfoW/A functions, and the logon sequence.

I even found a small bug in the query_context_attributes_common function.

@TheBestTvarynka Pavlo Myroniuk (TheBestTvarynka) changed the title test(ffi): more ffi tests test(ffi): cover SSPI with more tests Sep 25, 2026
@TheBestTvarynka
Pavlo Myroniuk (TheBestTvarynka) marked this pull request as ready for review September 25, 2026 15:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The handshake tests omit required CompleteAuthToken calls, and ANSI package-info attribute coverage is missing.

Review effort: Balanced
Findings: 1 Medium severity · 1 Low severity

Open (2)
What changed in this PR

Adds broader FFI SSPI test coverage and fixes in-place server-auth flag output handling.

Changes:

  • Handles unknown security packages without panicking.
  • Adds package-info, context-attribute, and NTLM handshake tests.
  • Refreshes generated .NET handle documentation.
File Description
ffi/​src/​sspi/​sec_pkg_info.rs Adds safe package lookup and tests.
ffi/​src/​sspi/​sec_handle.rs Fixes attribute output and expands FFI tests.
ffi/​dotnet/​Devolutions.Sspi/​Sspi.g.cs Updates generated handle documentation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +2392 to +2397
if client_status == SecurityStatus::Ok.to_u32().unwrap()
&& server_status == SecurityStatus::CompleteNeeded.to_u32().unwrap()
{
// Both security contexts are established: they must be usable.
assert_ntlm_context_sizes(&mut client_sec_context);
assert_ntlm_context_sizes(&mut server_sec_context);
Comment on lines +3337 to +3338
#[test]
fn query_context_attributes_package_info() {

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants