MCPcopy Create free account
hub / github.com/cuberite/cuberite / StartEncryption

Method StartEncryption

src/Protocol/Protocol132.cpp:869–884  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

867
868
869void cProtocol132::StartEncryption(const Byte * a_Key)
870{
871 m_Encryptor.Init(a_Key, a_Key);
872 m_Decryptor.Init(a_Key, a_Key);
873 m_IsEncrypted = true;
874
875 // Prepare the m_AuthServerID:
876 cSHA1Checksum Checksum;
877 AString ServerID = cRoot::Get()->GetServer()->GetServerID();
878 Checksum.Update((const Byte *)ServerID.c_str(), ServerID.length());
879 Checksum.Update(a_Key, 16);
880 Checksum.Update((const Byte *)cRoot::Get()->GetServer()->GetPublicKeyDER().data(), cRoot::Get()->GetServer()->GetPublicKeyDER().size());
881 Byte Digest[20];
882 Checksum.Finalize(Digest);
883 cSHA1Checksum::DigestToJava(Digest, m_AuthServerID);
884}
885
886
887

Callers

nothing calls this directly

Calls 6

GetServerMethod · 0.80
c_strMethod · 0.80
sizeMethod · 0.80
FinalizeMethod · 0.80
InitMethod · 0.45
UpdateMethod · 0.45

Tested by

no test coverage detected