Module wow_srp::client [−][src]
Expand description
Contains all functionality related to the client part.
All arrays are little endian.
See examples/client.rs
for how to authenticate with a server.
Usage
The Typestate pattern is used
in order to prevent incorrect use.
This means that whenever the next step of computation takes place, you call a function
taking self
, consuming the old object, and returning the new object.
The state machine goes like this:
SrpClientUser -> SrpClientChallenge -> SrpClient -| -> SrpClientReconnection
^ |
|------|
Where an SrpClientReconnection
object is a temporary data struct from
SrpClient::calculate_reconnect_values
that contains only the necessary reconnect values.
When reaching SrpClient
the client has fully authenticated with the server and should be able to
send the CMD_REALM_LIST_Client
packet.
Example
The chain starts with an SrpClientUser
, then goes to an SrpClientChallenge
and ends
with the SrpClient
which returns SrpClientReconnection
s for reconnecting challenges.
The full example including network code can be found in examples/client.rs
.
Limitations
The client has some limitations that enable a simpler overall design:
- Fixed 32 byte large safe prime length. Despite the field in the packet being variable the client is unable to use values greater than 32 bytes.
- Only accepting valid
NormalizedString
values. This is done to unify the server and client implementations. - GENERATOR can be only be a u8 despite the
CMD_AUTH_LOGON_CHALLENGE_Server
packet having a variable sized generator field. This is done because there are no generator values larger than 255.
Structs
Represents a connection with the server. The final part of the state machine, previous was
SrpClientChallenge
.
Second step of the client connection. First is SrpClientUser
. Next is SrpClient
.
Contains the challenge data and proof for reconnection.
Starting point of the client. Next step is SrpClientChallenge
.