public bool OnPrtc_KeyExchange(OctetsStream os) { KeyExchange prtc = new KeyExchange(); prtc.unmarshal(os); Debug.Log(string.Format("On protocol using C#: {0}", (NetProtocolType)KeyExchange.PROTOCOL_TYPE)); //Octets outKey = new Octets(); //ECGameSession GameSession = ECGameSession.Instance(); //outKey = GenerateKey(Nonce, prtc.nonce, outKey); //NetMan.SetOSecurity(NetMan.GetSession(), "ARCFOURSECURITY", outKey); GNET.Common.Security.Security random = GNET.Common.Security.Security.Create("RANDOM"); random.Update(prtc.nonce.resize(16)); Octets inKey = new Octets(); inKey = GenerateKey(Nonce, prtc.nonce, inKey); NetMan.SetISecurity(NetMan.GetSession(), "DECOMPRESSSECURITY", inKey); SendNetData(prtc); return true; }
public override Object Clone() { KeyExchange obj = new KeyExchange(); obj.nonce = (Octets)nonce.Clone(); return obj; }