Module wow_srp::client [−][src]
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 accidental incorrect use for every type except for SrpClient
.
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 the result of SrpClient::calculate_reconnect_values
that contains the necessary reconnect values.
When reaching SrpClient
the client has fully connected to the server and should be
send the ‘Send Realmlist’ 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 this is made possible because of the fact that even the oldest emulators are using 32 byte values.
- Only accepting valid
NormalizedString
values. This is done to unify the server and client implementations. - GENERATOR can be maximum 1 byte. This is done because occurrences of multi byte generators is extremely low.
Structs
SrpClient | Represents a connection with the server. |
SrpClientChallenge | Second step of the client connection. First is |
SrpClientReconnection | Contains the challenge data and proof for reconnection. |
SrpClientUser | Starting point of the client. |