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.

155 lines
4.2 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1995.
  5. //
  6. // File: specmap.h
  7. //
  8. // Contents:
  9. //
  10. // Classes:
  11. //
  12. // Functions:
  13. //
  14. // History: 09-23-97 jbanes Ported over SGC stuff from NT 4 tree.
  15. //
  16. //----------------------------------------------------------------------------
  17. struct _SPContext;
  18. typedef struct csel
  19. {
  20. DWORD fProtocol;
  21. DWORD fDefault;
  22. PSTR szName;
  23. ALG_ID aiCipher;
  24. DWORD dwBlockSize; // bytes
  25. DWORD dwStrength; // key strength in bits
  26. DWORD cbKey; // required key material
  27. DWORD cbSecret; // bytes of secret key material
  28. DWORD dwFlags; // See flags field
  29. } CipherInfo, *PCipherInfo;
  30. #define CF_EXPORT 0x00000001 // This cipher is allowed for export use
  31. #define CF_DOMESTIC 0x00000002 // This cipher is for domestic use only
  32. #define CF_SGC 0x00000004 // This cipher is allowed with Server Gated Crypto
  33. #define CF_FINANCE 0x00000008 // This cipher is allowed with SELECTIVE CRYPTO
  34. #define CF_FASTSGC 0x00000010 // This indicates that the SGC type is fast
  35. #define CF_RENEWED 0x00000020
  36. typedef struct hsel
  37. {
  38. DWORD fProtocol;
  39. DWORD fDefault;
  40. PSTR szName;
  41. ALG_ID aiHash;
  42. DWORD cbCheckSum; // bytes
  43. } HashInfo, *PHashInfo;
  44. typedef struct sigsel
  45. {
  46. DWORD fProtocol;
  47. DWORD fDefault;
  48. SigSpec Spec;
  49. PSTR szName;
  50. ALG_ID aiHash;
  51. ALG_ID aiSig;
  52. } SigInfo, *PSigInfo;
  53. typedef struct kexch
  54. {
  55. ALG_ID aiExch;
  56. DWORD fProtocol;
  57. DWORD fDefault;
  58. ExchSpec Spec;
  59. PSTR szName;
  60. KeyExchangeSystem * System;
  61. } KeyExchangeInfo, *PKeyExchangeInfo;
  62. typedef struct certsel
  63. {
  64. DWORD fProtocol;
  65. DWORD fDefault;
  66. CertSpec Spec;
  67. PSTR szName;
  68. } CertSysInfo, *PCertSysInfo;
  69. PCipherInfo GetCipherInfo(ALG_ID aiCipher, DWORD dwStrength);
  70. PHashInfo GetHashInfo(ALG_ID aiHash);
  71. PKeyExchangeInfo GetKeyExchangeInfo(ExchSpec Spec);
  72. PKeyExchangeInfo GetKeyExchangeInfoByAlg(ALG_ID aiExch);
  73. PCertSysInfo GetCertSysInfo(CertSpec Spec);
  74. PSigInfo GetSigInfo(SigSpec Spec);
  75. KeyExchangeSystem * KeyExchangeFromSpec(ExchSpec Spec, DWORD fProtocol);
  76. BOOL GetBaseCipherSizes(DWORD *dwMin, DWORD *dwMax);
  77. void
  78. GetDisplayCipherSizes(
  79. PSPCredentialGroup pCredGroup,
  80. DWORD *dwMin,
  81. DWORD *dwMax);
  82. BOOL IsCipherAllowed(
  83. SPContext * pContext,
  84. PCipherInfo pCipher,
  85. DWORD dwProtocol,
  86. DWORD dwFlags);
  87. BOOL
  88. IsCipherSuiteAllowed(
  89. PSPContext pContext,
  90. PCipherInfo pCipher,
  91. DWORD dwProtocol,
  92. DWORD dwFlags,
  93. DWORD dwSuiteFlags);
  94. BOOL IsHashAllowed(
  95. SPContext * pContext,
  96. PHashInfo pHash,
  97. DWORD dwProtocol);
  98. BOOL IsExchAllowed(
  99. SPContext * pContext,
  100. PKeyExchangeInfo pExch,
  101. DWORD dwProtocol);
  102. BOOL IsAlgAllowed(
  103. PSPCredentialGroup pCred,
  104. ALG_ID aiAlg);
  105. BOOL BuildAlgList(PSPCredentialGroup pCred, ALG_ID *aalgRequestedAlgs, DWORD cRequestedAlgs);
  106. BOOL
  107. IsAlgSupportedCapi(
  108. DWORD dwProtocol,
  109. UNICipherMap * pCipherMap,
  110. PROV_ENUMALGS_EX * pCapiAlgs,
  111. DWORD cCapiAlgs);
  112. extern CipherInfo g_AvailableCiphers[];
  113. extern DWORD g_cAvailableCiphers;
  114. extern HashInfo g_AvailableHashes[];
  115. extern DWORD g_cAvailableHashes;
  116. extern CertSysInfo g_AvailableCerts[];
  117. extern DWORD g_cAvailableCerts;
  118. extern SigInfo g_AvailableSigs[];
  119. extern DWORD g_cAvailableSigs;
  120. extern KeyExchangeInfo g_AvailableExch[];
  121. extern DWORD g_cAvailableExch;