| 867 | |
| 868 | |
| 869 | void 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 | |