Source code of Windows XP (NT5)
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.0 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. typedef struct hsel
  36. {
  37. DWORD fProtocol;
  38. DWORD fDefault;
  39. PSTR szName;
  40. ALG_ID aiHash;
  41. DWORD cbCheckSum; // bytes
  42. } HashInfo, *PHashInfo;
  43. typedef struct sigsel
  44. {
  45. DWORD fProtocol;
  46. DWORD fDefault;
  47. SigSpec Spec;
  48. PSTR szName;
  49. ALG_ID aiHash;
  50. ALG_ID aiSig;
  51. } SigInfo, *PSigInfo;
  52. typedef struct kexch
  53. {
  54. ALG_ID aiExch;
  55. DWORD fProtocol;
  56. DWORD fDefault;
  57. ExchSpec Spec;
  58. PSTR szName;
  59. KeyExchangeSystem * System;
  60. } KeyExchangeInfo, *PKeyExchangeInfo;
  61. typedef struct certsel
  62. {
  63. DWORD fProtocol;
  64. DWORD fDefault;
  65. CertSpec Spec;
  66. PSTR szName;
  67. } CertSysInfo, *PCertSysInfo;
  68. PCipherInfo GetCipherInfo(ALG_ID aiCipher, DWORD dwStrength);
  69. PHashInfo GetHashInfo(ALG_ID aiHash);
  70. PKeyExchangeInfo GetKeyExchangeInfo(ExchSpec Spec);
  71. PKeyExchangeInfo GetKeyExchangeInfoByAlg(ALG_ID aiExch);
  72. PCertSysInfo GetCertSysInfo(CertSpec Spec);
  73. PSigInfo GetSigInfo(SigSpec Spec);
  74. KeyExchangeSystem * KeyExchangeFromSpec(ExchSpec Spec, DWORD fProtocol);
  75. BOOL GetBaseCipherSizes(DWORD *dwMin, DWORD *dwMax);
  76. void
  77. GetDisplayCipherSizes(
  78. PSPCredentialGroup pCredGroup,
  79. DWORD *dwMin,
  80. DWORD *dwMax);
  81. BOOL IsCipherAllowed(
  82. SPContext * pContext,
  83. PCipherInfo pCipher,
  84. DWORD dwProtocol,
  85. DWORD dwFlags);
  86. BOOL
  87. IsCipherSuiteAllowed(
  88. PSPContext pContext,
  89. PCipherInfo pCipher,
  90. DWORD dwProtocol,
  91. DWORD dwFlags,
  92. DWORD dwSuiteFlags);
  93. BOOL IsHashAllowed(
  94. SPContext * pContext,
  95. PHashInfo pHash,
  96. DWORD dwProtocol);
  97. BOOL IsExchAllowed(
  98. SPContext * pContext,
  99. PKeyExchangeInfo pExch,
  100. DWORD dwProtocol);
  101. BOOL IsAlgAllowed(
  102. PSPCredentialGroup pCred,
  103. ALG_ID aiAlg);
  104. BOOL BuildAlgList(PSPCredentialGroup pCred, ALG_ID *aalgRequestedAlgs, DWORD cRequestedAlgs);
  105. BOOL
  106. IsAlgSupportedCapi(
  107. DWORD dwProtocol,
  108. UNICipherMap * pCipherMap,
  109. PROV_ENUMALGS_EX * pCapiAlgs,
  110. DWORD cCapiAlgs);
  111. extern CipherInfo g_AvailableCiphers[];
  112. extern DWORD g_cAvailableCiphers;
  113. extern HashInfo g_AvailableHashes[];
  114. extern DWORD g_cAvailableHashes;
  115. extern CertSysInfo g_AvailableCerts[];
  116. extern DWORD g_cAvailableCerts;
  117. extern SigInfo g_AvailableSigs[];
  118. extern DWORD g_cAvailableSigs;
  119. extern KeyExchangeInfo g_AvailableExch[];
  120. extern DWORD g_cAvailableExch;