Interface ISrpAccountManager<TConnection>
Extended account manager interface for SRP-based authentication on the LoginServer.
Adds SRP-specific connection account creation with SRP data,
and periodic sweep of stale unauthenticated connections.
Auth state machine methods (TryAdvanceAuthState, HasAuthState) live on
the base IAccountManager<TConnection> interface.
public interface ISrpAccountManager<TConnection> : IAccountManager<TConnection>
Type Parameters
TConnectionThe type representing a network connection.
- Inherited Members
Methods
AddConnectionAccount(TConnection, string, string, string, string, AccessLevel, bool)
Populates SRP authentication data on an existing connection's AccountData. The connection must already have AccountData in VerifyPending state (created at handshake time). On success, advances the state to WaitingForProof.
bool AddConnectionAccount(TConnection connection, string accountName, string publicClientEphemeral, string salt, string verifier, AccessLevel accessLevel, bool isUnverified = false)
Parameters
connectionTConnectionThe network connection.
accountNamestringThe account name.
publicClientEphemeralstringThe public ephemeral value from the client.
saltstringThe salt for SRP.
verifierstringThe verifier for SRP.
accessLevelAccessLevelThe access level for the account.
isUnverifiedbool
Returns
- bool
trueif SRP data was set and state advanced;falseif the connection was not in the expected state.
ClearSrpState(TConnection)
Clears SRP state for a connection while preserving account mappings and access level. Calls ServerSrpData.Clear to null sensitive string references, then nulls the SrpData reference itself. Use this after SRP success to remove sensitive SRP material from memory.
void ClearSrpState(TConnection connection)
Parameters
connectionTConnectionThe connection whose SRP state will be cleared.
SweepUnauthenticatedConnections(TimeSpan, Func<TConnection, bool>, int, int)
Sweeps and removes stale unauthenticated connection state to bound SRP/encryption memory growth. Authenticated connections are only untracked from the unauthenticated timer map.
int SweepUnauthenticatedConnections(TimeSpan maxUnauthenticatedAge, Func<TConnection, bool> isAuthenticated, int maxScan, int maxRemovals)
Parameters
maxUnauthenticatedAgeTimeSpanMaximum allowed age for unauthenticated state.
isAuthenticatedFunc<TConnection, bool>Connection authentication predicate.
maxScanintMaximum tracked entries to evaluate this sweep.
maxRemovalsintMaximum stale entries to purge this sweep.
Returns
- int
Number of stale unauthenticated entries purged.