Skip to main content

Crate windows_sspi_shim

Crate windows_sspi_shim 

Source
Expand description

windows-sspi-shim — thin client-side wrapper over the Devolutions sspi crate. Given an SPN and (implicit) credentials it produces a SspiClient that can drive the Negotiate token exchange and, once established, a SealedContext with seal/unseal closures suitable for wiring into dcerpc packet_privacy and ldap3 GSS-SPNEGO SASL.

§Status

Pre-alpha, 0.1.0-dev. The API surface is stable in shape but the Negotiate/seal machinery is only partially implemented — see src/negotiate.rs for the exact stub boundaries. Only the current-user Windows Negotiate flow is targeted; non-Windows targets compile but every constructor returns Error::NotSupported.

§Example (target-agnostic)

use windows_sspi_shim::{SspiClient, NegotiateStep};

let mut client = SspiClient::for_spn("HOST/dc.example.com")?;
let mut peer: Option<Vec<u8>> = None;
loop {
    match client.negotiate(peer.as_deref())? {
        NegotiateStep::SendToken(tok) => {
            // send `tok` to the peer, receive next blob into `peer`
        }
        NegotiateStep::Complete => break,
    }
}

Structs§

SealedContext
Established security context. Wraps whatever backend the shim uses to perform per-message confidentiality.
SecPkgSizes
Size hints returned by SSPI’s QueryContextAttributes(SECPKG_ATTR_SIZES). A shim consumer needs these to size RPC packets and SASL buffers.
SspiClient
Client-side Negotiate context bound to a single SPN.

Enums§

Error
Failure modes surfaced by the shim.
NegotiateStep
A single step of the Negotiate exchange.

Constants§

HAS_BACKEND
Whether this build has a real backend wired up. false on non-Windows and on Windows builds where the backend has been feature-disabled.
VERSION
Crate version string, mirrors Cargo.toml.

Type Aliases§

Result
Result alias used across the crate.