-
-
Save azuisleet/e2859ac9f88e1c6dee028e591ed0dc72 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
STEAMNETWORKINGSOCKETS_INTERFACE bool GameNetworkingSockets_InitWithCert(int appId, const SteamNetworkingIdentity* pIdentity, void* privateKey, void *cert, int certLen, SteamNetworkingErrMsg& errMsg) | |
{ | |
SteamDatagramTransportLock lock; | |
// Init basic functionality | |
if (!g_SteamNetworkingSocketsUser.BInitGameNetworkingSockets(pIdentity, errMsg)) | |
{ | |
g_SteamNetworkingSocketsUser.Kill(); | |
return false; | |
} | |
g_SteamNetworkingSocketsUser.m_nAppID = appId; | |
g_SteamNetworkingSocketsUser.m_keyPrivateKey.SetRawDataAndWipeInput(privateKey, 32); | |
g_SteamNetworkingSocketsUser.m_msgSignedCert.ParseFromArray(cert, certLen); | |
g_SteamNetworkingSocketsUser.m_msgCert.ParseFromString(g_SteamNetworkingSocketsUser.m_msgSignedCert.cert()); | |
// Sanity check: | |
CECSigningPublicKey pubKey; | |
if (!pubKey.SetRawDataWithoutWipingInput(g_SteamNetworkingSocketsUser.m_msgCert.key_data().c_str(), g_SteamNetworkingSocketsUser.m_msgCert.key_data().length())) | |
{ | |
return false; | |
} | |
if (!g_SteamNetworkingSocketsUser.m_keyPrivateKey.MatchesPublicKey(pubKey)) | |
{ | |
return false; | |
} | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment