Leaked source code of windows server 2003
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.

110 lines
3.4 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1995.
  5. //
  6. // File: spdefs.h
  7. //
  8. // Contents:
  9. //
  10. // Classes:
  11. //
  12. // Functions:
  13. //
  14. // History: 10-23-97 jbanes Added hash lengths.
  15. //
  16. //----------------------------------------------------------------------------
  17. #define CALG_NULLCIPHER (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_ANY | 0)
  18. /* keyexchange algs */
  19. #define SP_EXCH_RSA_PKCS1 0x0001
  20. #define SP_EXCH_RSA_PKCS1_TOKEN_DES 0x0002
  21. #define SP_EXCH_RSA_PKCS1_TOKEN_DES3 0x0003
  22. #define SP_EXCH_RSA_PKCS1_TOKEN_RC2 0x0004
  23. #define SP_EXCH_RSA_PKCS1_TOKEN_RC4 0x0005
  24. #define SP_EXCH_DH_PKCS3 0x0006
  25. #define SP_EXCH_DH_PKCS3_TOKEN_DES 0x0007
  26. #define SP_EXCH_DH_PKCS3_TOKEN_DES3 0x0008
  27. #define SP_EXCH_FORTEZZA_TOKEN 0x0009
  28. #define SP_EXCH_UNKNOWN 0xffff
  29. /* certificate types */
  30. #define PCT1_CERT_NONE 0x0000
  31. #define PCT1_CERT_X509 0x0001
  32. #define PCT1_CERT_PKCS7 0x0002
  33. /* signature algorithms */
  34. #define SP_SIG_NONE 0x0000
  35. #define SP_SIG_RSA_MD5 0x0001
  36. #define SP_SIG_RSA_SHA 0x0002
  37. #define SP_SIG_DSA_SHA 0x0003
  38. /* these are for internal use only */
  39. #define SP_SIG_RSA_MD2 0x0004
  40. #define SP_SIG_RSA 0x0005
  41. #define SP_SIG_RSA_SHAMD5 0x0006
  42. #define SP_SIG_FORTEZZA_TOKEN 0x0007
  43. /* sizing of local structures */
  44. #define SP_MAX_SESSION_ID 32
  45. #define SP_MAX_MASTER_KEY 48
  46. #define SP_MAX_MAC_KEY 48
  47. #define SP_MAX_CACHE_ID 64
  48. #define SP_MAX_CHALLENGE 32
  49. #define SP_MAX_CONNECTION_ID 32
  50. #define SP_MAX_KEY_ARGS 32
  51. #define SP_MAX_BLOCKCIPHER_SIZE 16 // 16 bytes required for SSL3/Fortezza.
  52. #define SP_MAX_DIGEST_LEN 32
  53. #define SP_MAX_CREDS 20
  54. #define SP_OFFSET_OF(t, v) (DWORD)&(((t)NULL)->v)
  55. /* tuning constants */
  56. #define SP_DEF_SERVER_CACHE_SIZE 100
  57. #define SP_DEF_CLIENT_CACHE_SIZE 10
  58. #define SP_MIN_PRIVATE_KEY_FILE_SIZE 80
  59. typedef LONG SP_STATUS;
  60. #define CB_MD5_DIGEST_LEN 16
  61. #define CB_SHA_DIGEST_LEN 20
  62. #define SP_MAX_CAPI_ALGS 40
  63. /* internal representations of algorithm specs */
  64. typedef DWORD CipherSpec, *PCipherSpec;
  65. typedef DWORD KeyExchangeSpec, *PKeyExchangeSpec;
  66. typedef DWORD HashSpec, *PHashSpec;
  67. typedef DWORD CertSpec, *PCertSpec;
  68. typedef DWORD ExchSpec, *PExchSpec;
  69. typedef DWORD SigSpec, *PSigSpec;
  70. typedef struct _KeyTypeMap
  71. {
  72. ALG_ID aiKeyAlg; // CAPI2 Key type
  73. DWORD Spec; // Protocol Specific Type
  74. } KeyTypeMap, *PKeyTypeMap;
  75. typedef struct _CertTypeMap
  76. {
  77. DWORD dwCertEncodingType; // CAPI2 Cert Encoding Type
  78. DWORD Spec; // Protocol Specific Type
  79. } CertTypeMap, *PCertTypeMap;
  80. typedef struct _SPBuffer {
  81. unsigned long cbBuffer; /* Size of the buffer, in bytes */
  82. unsigned long cbData; /* size of the actual data in the
  83. * buffer, in bytes */
  84. void * pvBuffer; /* Pointer to the buffer */
  85. } SPBuffer, * PSPBuffer;
  86. #define SGC_KEY_SALT "SGCKEYSALT"