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

Method HandleServerLoginEncryptionKeyRequest

Tools/ProtoProxy/Connection.cpp:1285–1310  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1283
1284
1285bool cConnection::HandleServerLoginEncryptionKeyRequest(void)
1286{
1287 // Read the packet from the server:
1288 HANDLE_SERVER_PACKET_READ(ReadVarUTF8String, AString, ServerID);
1289 HANDLE_SERVER_PACKET_READ(ReadBEShort, short, PublicKeyLength);
1290 AString PublicKey;
1291 if (!m_ServerBuffer.ReadString(PublicKey, PublicKeyLength))
1292 {
1293 return false;
1294 }
1295 HANDLE_SERVER_PACKET_READ(ReadBEShort, short, NonceLength);
1296 AString Nonce;
1297 if (!m_ServerBuffer.ReadString(Nonce, NonceLength))
1298 {
1299 return false;
1300 }
1301 Log("Got PACKET_ENCRYPTION_KEY_REQUEST from the SERVER:");
1302 Log(" ServerID = %s", ServerID.c_str());
1303 DataLog(PublicKey.data(), PublicKey.size(), " Public key (%u bytes)", (unsigned)PublicKey.size());
1304
1305 // Reply to the server:
1306 SendEncryptionKeyResponse(PublicKey, Nonce);
1307
1308 // Do not send to client - we want the client connection open
1309 return true;
1310}
1311
1312
1313

Callers

nothing calls this directly

Calls 3

c_strMethod · 0.80
sizeMethod · 0.80
ReadStringMethod · 0.45

Tested by

no test coverage detected