summaryrefslogtreecommitdiff
path: root/common/ValidateNewValveCDKeyClient.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /common/ValidateNewValveCDKeyClient.h
downloadarchived-source-engine-2018-hl2-src-3bf9df6b2785fa6d951086978a3e66f49427166a.tar.xz
archived-source-engine-2018-hl2-src-3bf9df6b2785fa6d951086978a3e66f49427166a.zip
Diffstat (limited to 'common/ValidateNewValveCDKeyClient.h')
-rw-r--r--common/ValidateNewValveCDKeyClient.h95
1 files changed, 95 insertions, 0 deletions
diff --git a/common/ValidateNewValveCDKeyClient.h b/common/ValidateNewValveCDKeyClient.h
new file mode 100644
index 0000000..d0a279e
--- /dev/null
+++ b/common/ValidateNewValveCDKeyClient.h
@@ -0,0 +1,95 @@
+
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//
+//=============================================================================//
+/*******************************************************************************
+**
+** Contents:
+**
+** This file provides the public interface to the Steam service. This
+** interface is described in the SDK documentation.
+**
+******************************************************************************/
+
+
+#ifndef INCLUDED_VALIDATENEWVALVECDKEYCLIENT_H
+#define INCLUDED_VALIDATENEWVALVECDKEYCLIENT_H
+
+
+#if defined(_MSC_VER) && (_MSC_VER > 1000)
+#pragma once
+#endif
+
+
+#ifndef INCLUDED_STEAM_COMMON_STEAMCOMMON_H
+ #include "steamcommon.h"
+#endif
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+
+ // Note: this function expects the CDkey to contain dashes to split it into groups of 5 characters.
+ //
+ // e.g. 5WV2E-CDL82-89AQ4-ZZKH8-L27IB (note: this example is not a valid key)
+ //
+ ESteamError SteamWeakVerifyNewValveCDKey
+ (
+ const char * pszCDKeyFormattedForCDLabel,
+ uint * pReceiveGameCode,
+ uint * pReceiveSalesTerritoryCode,
+ uint * pReceiveUniqueSerialNumber
+ );
+
+ // This returns data ready to send to the validation server.
+ // If you want to store a CDKey in the registry, consider passing the
+ // output of this function through one of the functions below,
+ // to make life harder for registry-harvesting trojans.
+ //
+ // This also does a WeakVerify.
+ ESteamError SteamGetEncryptedNewValveCDKey
+ (
+ const char * pszCDKeyFormattedForCDLabel,
+ unsigned int ClientLocalIPAddr,
+ const void * pEncryptionKeyReceivedFromAppServer,
+ unsigned int uEncryptionKeyLength,
+ void * pOutputBuffer,
+ unsigned int uSizeOfOutputBuffer,
+ unsigned int * pReceiveSizeOfEncryptedNewValveCDKey
+ );
+
+
+ // This pair of functions encrypt and decrypt data using a key based on unique
+ // properties of this machine. The resulting encrypted data can only be (easily)
+ // decrypted on the same machine. Note: it is NOT impossible to decrypt the data
+ // elsewhere, just inconvenient.
+ ESteamError SteamEncryptDataForThisMachine
+ (
+ const char * pDataToEncrypt,
+ unsigned int uSizeOfDataToEncrypt,
+ void * pOutputBuffer,
+ unsigned int uSizeOfOutputBuffer,
+ unsigned int * pReceiveSizeOfEncryptedData
+ );
+
+ ESteamError SteamDecryptDataForThisMachine
+ (
+ const char * pDataToDecrypt,
+ unsigned int uSizeOfDataToDecrypt,
+ void * pOutputBuffer,
+ unsigned int uSizeOfOutputBuffer,
+ unsigned int * pReceiveSizeOfDecryptedData
+ );
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* #ifndef INCLUDED_STEAM_COMMON_STEAMCOMMON_H */