Package eu.getmangos.controllers
Class SRPServerController
java.lang.Object
eu.getmangos.controllers.SRPServerController
public class SRPServerController extends Object
SRPServer is an helper class to handle SRP6 calculation and hashing methods
for WoW client since it deviates from the original SRP6 specification..
- Version:
- v0.1 BETA.
- Author:
- Warkdev
-
Constructor Summary
Constructors Constructor Description SRPServerController(String hashpass, String account)Constructor of SRPServer -
Method Summary
Modifier and Type Method Description byte[]generateHashLogonProof(BigNumber A)Generates the hash logon proof from A and M1.byte[]generateHashReconnectProof(BigNumber R1, BigNumber challenge, BigNumber sessionKey)BigNumbergenerateS()Generates a new random 32-bytes Salt.BigNumbergenerateV()Generates a new Password Verifier based on known parameters as in SRP6 implementation.BigNumbergetB()static BigNumbergetG()BigNumbergetGmod()byte[]getHashpass()byte[]getI()static BigNumbergetK()BigNumbergetM2()MessageDigestgetMd()static BigNumbergetN()BigNumbergetS()BigNumbergetSalt()BigNumbergetSessionKey()BigNumbergetV()BigNumbergetX()voidsetB(BigNumber B)voidsetGmod(BigNumber gmod)voidsetHashpass(byte[] hashpass)voidsetI(byte[] I)voidsetK(BigNumber K)voidsetM2(BigNumber M2)voidsetMd(MessageDigest md)voidsetS(BigNumber S)voidsetSalt(BigNumber salt)voidsetV(BigNumber v)voidsetX(BigNumber x)voidstep1()Performs the first step of the authentication challenge, generating the server public value.booleanstep2(BigNumber A, BigNumber M1)Performs the second step of the authentication challenge, verifying that the server knows the information the client has generated.StringtoString()
-
Constructor Details
-
SRPServerController
Constructor of SRPServer- Parameters:
hashpass- hashpass of the accountaccount- account name
-
-
Method Details
-
getN
-
getG
-
getK
-
getSessionKey
-
getS
-
getX
-
getHashpass
public byte[] getHashpass() -
getV
-
setV
-
getGmod
-
setX
-
setHashpass
public void setHashpass(byte[] hashpass) -
setS
-
setK
-
setGmod
-
getB
-
getSalt
-
setSalt
-
setB
-
getI
public byte[] getI() -
setI
public void setI(byte[] I) -
getM2
-
setM2
-
getMd
-
setMd
-
generateS
Generates a new random 32-bytes Salt.- Returns:
- The BigNumber generated Salt.
-
generateV
Generates a new Password Verifier based on known parameters as in SRP6 implementation.- Returns:
- The BigNumber generated Verifier.
-
step1
public void step1()Performs the first step of the authentication challenge, generating the server public value. -
step2
Performs the second step of the authentication challenge, verifying that the server knows the information the client has generated.- Parameters:
A- The A sent by the client.M1- The proof sent by the client.- Returns:
- True if the server recognize the proof, false otherwise.
-
generateHashLogonProof
Generates the hash logon proof from A and M1.- Parameters:
A- The Big Number A to be used.- Returns:
- The Hash Logon Proof.
-
generateHashReconnectProof
-
toString
-