Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
2.7 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. /*******************************************************************************
  9. **
  10. ** Contents:
  11. **
  12. ** This file provides the public interface to the Steam service. This
  13. ** interface is described in the SDK documentation.
  14. **
  15. ******************************************************************************/
  16. #ifndef INCLUDED_VALIDATENEWVALVECDKEYCLIENT_H
  17. #define INCLUDED_VALIDATENEWVALVECDKEYCLIENT_H
  18. #if defined(_MSC_VER) && (_MSC_VER > 1000)
  19. #pragma once
  20. #endif
  21. #ifndef INCLUDED_STEAM_COMMON_STEAMCOMMON_H
  22. #include "steamcommon.h"
  23. #endif
  24. #ifdef __cplusplus
  25. extern "C"
  26. {
  27. #endif
  28. // Note: this function expects the CDkey to contain dashes to split it into groups of 5 characters.
  29. //
  30. // e.g. 5WV2E-CDL82-89AQ4-ZZKH8-L27IB (note: this example is not a valid key)
  31. //
  32. ESteamError SteamWeakVerifyNewValveCDKey
  33. (
  34. const char * pszCDKeyFormattedForCDLabel,
  35. uint * pReceiveGameCode,
  36. uint * pReceiveSalesTerritoryCode,
  37. uint * pReceiveUniqueSerialNumber
  38. );
  39. // This returns data ready to send to the validation server.
  40. // If you want to store a CDKey in the registry, consider passing the
  41. // output of this function through one of the functions below,
  42. // to make life harder for registry-harvesting trojans.
  43. //
  44. // This also does a WeakVerify.
  45. ESteamError SteamGetEncryptedNewValveCDKey
  46. (
  47. const char * pszCDKeyFormattedForCDLabel,
  48. unsigned int ClientLocalIPAddr,
  49. const void * pEncryptionKeyReceivedFromAppServer,
  50. unsigned int uEncryptionKeyLength,
  51. void * pOutputBuffer,
  52. unsigned int uSizeOfOutputBuffer,
  53. unsigned int * pReceiveSizeOfEncryptedNewValveCDKey
  54. );
  55. // This pair of functions encrypt and decrypt data using a key based on unique
  56. // properties of this machine. The resulting encrypted data can only be (easily)
  57. // decrypted on the same machine. Note: it is NOT impossible to decrypt the data
  58. // elsewhere, just inconvenient.
  59. ESteamError SteamEncryptDataForThisMachine
  60. (
  61. const char * pDataToEncrypt,
  62. unsigned int uSizeOfDataToEncrypt,
  63. void * pOutputBuffer,
  64. unsigned int uSizeOfOutputBuffer,
  65. unsigned int * pReceiveSizeOfEncryptedData
  66. );
  67. ESteamError SteamDecryptDataForThisMachine
  68. (
  69. const char * pDataToDecrypt,
  70. unsigned int uSizeOfDataToDecrypt,
  71. void * pOutputBuffer,
  72. unsigned int uSizeOfOutputBuffer,
  73. unsigned int * pReceiveSizeOfDecryptedData
  74. );
  75. #ifdef __cplusplus
  76. }
  77. #endif
  78. #endif /* #ifndef INCLUDED_STEAM_COMMON_STEAMCOMMON_H */