Hello,
I have an issue that is not really making much sense to me and am hoping a second set of eyes might spot something I'm not catching. I'm in the key exchange phase of the login sequence and am unable to come to a common shared key despite all shared values matching on both ends. I'm using the Diffie Hellman implementation by CptSky provided on the development wiki (
).I am successfully exchanging keys with the client, as I'm able to correctly decipher the 1052 packet sent from the client to the server. This tells me that the GenerateRequest and the HandleResponse functions are correctly implemented, other wise I would not be able to decipher that packet. (Is this a correct assumption?)
I am not successfully able to decipher that same packet on the server I have setup and I've traced that back to a mis-match in the shared key.
Here is an output from both my Proxy and my Server - This tells me that both the A and the B keys are being transmitted correctly between the proxy and the server.
Keys as seen by Proxy:
Keys as seen by Server:
Here is my code handling the DH Packet From Server to Client
Here is my code handling the DH Packet From Client to Server
Based on everything I've read, the S-Key is supposed to be the same. And from the simple explanation on the wiki about Diffie Hellman, the GenerateReponse is correctly implemented, not sure where else I can be going wrong.
Any help is appreciated.
Edit:
Forget everything I said above. My shared keys are correct, I was accidentally comparing the shared key between the client and proxy to the one generated server side....stupid. Brings me back to trying to figure out why I'm not able to decipher a packet sent from the proxy to the server.. The ciphers were both initialized with the same shared key (verified properly this time) and I've setup the IV's on the server to be all zeros, so I can't get those mixed up.
Not really sure what could be wrong if the cipher between Client and Proxy is functioning properly and my Server and Proxy cipher was instanced with the same Shared key...at a loss.
Edit 2:
Rubber-duckied my way out of this one. I was doing everything correctly except pointing my server facing cipher to my new instance...This took ~15 hours over the last two days...but hey, I'm pretty comfortable with it now.






