Skip to main content

sasl_scram/
lib.rs

1//! Strict, sans-I/O SCRAM protocol engine.
2//!
3//! This scaffold provides bounded transcript-preserving message parsers,
4//! canonical encoders, exact transcript assembly, explicit credential,
5//! channel-binding, policy, and secret types, and consuming SCRAM-SHA-256 client
6//! and server roles, including SHA-256-PLUS. The opt-in `sha512` feature adds
7//! the widely deployed, unregistered SHA-512 extension profile. Both profiles
8//! retain explicit derivation and application continuations.
9
10#![cfg_attr(not(feature = "std"), no_std)]
11#![forbid(unsafe_code)]
12
13extern crate alloc;
14
15mod algorithm;
16mod attribute_name;
17mod authentication;
18mod channel_binding;
19#[cfg(any(feature = "sha256", feature = "sha512"))]
20mod client;
21mod credentials;
22#[cfg(any(feature = "sha256", feature = "sha512"))]
23mod crypto;
24mod error;
25mod identity;
26mod limits;
27mod nonce;
28mod outbound;
29mod policy;
30mod policy_error;
31mod preparation;
32mod salt;
33#[cfg(feature = "saslprep")]
34mod saslprep;
35mod secret;
36#[cfg(any(feature = "sha256", feature = "sha512"))]
37mod server;
38
39pub mod message;
40
41pub use algorithm::Algorithm;
42pub use attribute_name::AttributeName;
43pub use authentication::{AuthenticationProperties, ChannelBindingOutcome};
44pub use channel_binding::{
45    ChannelBinding, ChannelBindingData, ChannelBindingMode, ChannelBindingName,
46};
47#[cfg(any(feature = "sha256", feature = "sha512"))]
48pub use client::{
49    AwaitingServerFinal, AwaitingServerFirst, Client, ClientAuthenticated, ClientConfig,
50    ClientConfigBuilder, PendingDerivation,
51};
52pub use credentials::{PreparedCredentials, PreparedPassword};
53pub use error::{
54    AuthenticationError, CryptoError, Error, PeerError, PreparationError, ProtocolError, StateError,
55};
56pub use identity::{
57    PreparedAuthenticationIdentity, PreparedAuthorizationIdentity, ReceivedAuthenticationIdentity,
58    ReceivedAuthorizationIdentity,
59};
60pub use limits::{IterationCount, IterationPolicy, ResourceLimits, ResourceLimitsBuilder};
61pub use nonce::{NonceError, NonceSource};
62pub use outbound::OutboundMessage;
63pub use policy::{ClientPolicy, ServerPolicy};
64pub use policy_error::PolicyError;
65pub use preparation::AsciiProfile;
66#[cfg(feature = "saslprep")]
67pub use preparation::Rfc5802Profile;
68pub use salt::{Salt, SaltPolicy};
69pub use secret::{SecretBytes, SecretString};
70#[cfg(any(feature = "sha256", feature = "sha512"))]
71pub use server::{
72    AuthorizationOutcome, AuthorizationRequest, AwaitingClientFinal, ConcealmentKey,
73    ConcealmentProfile, CredentialRequest, CredentialResponse, NeedCredential,
74    NeedIdentityPreparation, PendingAuthorization, PendingServerCredential, ProofResult, Server,
75    ServerAuthenticated, ServerConfig, ServerConfigBuilder, ServerCredential,
76};