Skip to content

fix(credssp): grammar in expect message + guard empty output token in PubKeyInfo path#690

Merged
Benoît Cortier (CBenoit) merged 3 commits into
masterfrom
copilot/fix-comments-review-689
Jun 18, 2026
Merged

fix(credssp): grammar in expect message + guard empty output token in PubKeyInfo path#690
Benoît Cortier (CBenoit) merged 3 commits into
masterfrom
copilot/fix-comments-review-689

Conversation

Copilot AI commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Addresses two review comments from PR #689.

Changes

  • Grammar fix: "an decrypt""a decrypt" in the expect message inside exchange_pub_key_auth

  • Logic fix: The else branch in the Ok/CompleteNeeded acceptor path previously advanced unconditionally to the two-leg PubKeyInfo state whenever pub_key_auth was absent — even when the SSPI output token was empty. An empty token means there is nothing to forward to the client; sending empty negoTokens and advancing state is incorrect. The fix gates the two-leg path on a non-empty token; an empty token falls back to the original single-leg error (requiring pubKeyAuth in the same TSRequest).

} else {
    let output = output_token.remove(0).buffer;
    if !output.is_empty() {
        ts_request.nego_tokens = Some(output);
        self.state = CredSspState::PubKeyInfo;
    } else {
        try_cred_ssp_server!(
            Err(Error::new(
                ErrorKind::InvalidToken,
                String::from("CredSSP server expected an encrypted public key"),
            )),
            ts_request
        );
    }
}

…ken in PubKeyInfo path

- Fix grammar: "an decrypt" → "a decrypt" in exchange_pub_key_auth expect message
- Only advance to PubKeyInfo state when the output token is non-empty;
  if the token is empty and pub_key_auth is absent, return an InvalidToken error
  to match the original single-leg behaviour
Copilot AI changed the title [WIP] Fix code for all comments in review thread fix(credssp): grammar in expect message + guard empty output token in PubKeyInfo path Jun 17, 2026
@CBenoit Benoît Cortier (CBenoit) marked this pull request as ready for review June 17, 2026 15:19
@CBenoit Benoît Cortier (CBenoit) enabled auto-merge (squash) June 17, 2026 15:20
@CBenoit

Copy link
Copy Markdown
Member

Pavlo Myroniuk (@PavloMyroniuk-apriorit) Automatically fixed the Copilot feedback in the last PR merged

Comment thread src/credssp/mod.rs Outdated
@CBenoit Benoît Cortier (CBenoit) merged commit ff1ff85 into master Jun 18, 2026
63 checks passed
@CBenoit Benoît Cortier (CBenoit) deleted the copilot/fix-comments-review-689 branch June 18, 2026 11:08
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