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.

169 lines
4.6 KiB

  1. /*
  2. * $Header: P:\entproj\all\base\sk\skconfig.h_v 1.6 22 Feb 1995 13:56:08 rlock $
  3. * $Log: P:\entproj\all\base\sk\skconfig.h_v $
  4. *
  5. * Rev 1.6 22 Feb 1995 13:56:08 rlock
  6. * Added MGR_GENERAL_EXPORT
  7. *
  8. * Rev 1.5 18 Jan 1995 13:27:14 rlock
  9. * Changed CONTROLLED_EXPORT to FINANCIAL_EXPORT and
  10. * added DOMESTIC #define.
  11. *
  12. * Rev 1.4 26 Oct 1994 10:41:06 rlock
  13. * Commented out SKC_INCLUDE_DSA and SHA.
  14. *
  15. * Rev 1.3 26 Oct 1994 09:48:30 rlock
  16. * Changed CAST max key len #define to specify *encryption* key.
  17. *
  18. * Rev 1.2 03 Oct 1994 14:50:08 rlock
  19. * Added support for BSAFE RSA.
  20. * Added "derived" config #defines
  21. *
  22. * Rev 1.1 06 Sep 1994 14:52:08 rlock
  23. * Update for SK Version 1.0. DSS added. Comments improved.
  24. */
  25. /******************************************************************************
  26. * S K C O N F I G U R A T I O N
  27. * Copyright (c) 1994,95 Northern Telecom Ltd. All rights reserved.
  28. ******************************************************************************
  29. *
  30. * FILE: skconfig.h
  31. *
  32. * AUTHOR(S): R.T.Lockhart, Dept. 9C42, BNR Ltd.
  33. *
  34. * FILE DESCRIPTION: This file controls the compile-time configuration of
  35. * the whole Entrust Cryptographic Kernel. It controls algorithm inclusion and
  36. * strength for export considerations, and algorithm inclusion for specific
  37. * applications. The export rules are:
  38. *
  39. * EXPORT_CONTROL CAST Enc Key Bits CAST Dec Key Bits DES?
  40. * ===================================================================
  41. * GENERAL_EXPORT 40 64 No
  42. * FINANCIAL_EXPORT 40 64 Yes
  43. * DOMESTIC 64 64 Yes
  44. * MGR_GENERAL_EXPORT 64 64 No
  45. *
  46. *****************************************************************************/
  47. #ifndef SKCONFIG_H
  48. #define SKCONFIG_H
  49. /*
  50. * Export control classifications
  51. */
  52. /* Clients */
  53. #define GENERAL_EXPORT 0 /* For general export to anyone */
  54. #define FINANCIAL_EXPORT 1 /* For export to financial institutions only */
  55. #define DOMESTIC 2 /* Domestic. Not to be exported */
  56. #define NON_EXPORT DOMESTIC /* Same as domestic */
  57. /* Managers */
  58. #define MGR_GENERAL_EXPORT 3 /* Exportable Manager */
  59. /*
  60. * Export control macro. This can be defined externally, if desired.
  61. */
  62. #ifndef EXPORT_CONTROL
  63. #error "Must define an export control"
  64. #endif
  65. /* FIPS 140-1 control
  66. * Define this to generate a FIPS 140-1 compliant kernel.
  67. */
  68. /* #define FIPS140_KERNEL */
  69. /*
  70. * CAST encryption key length restrictions, based on export classification
  71. */
  72. // We enforce this else where.
  73. #define SKC_CAST_MAX_ENC_KEY_NBITS 64
  74. /*
  75. * Algorithm Configuration
  76. * #define these to include specific algorithms. Comment them out to exclude
  77. * the algorithm.
  78. */
  79. #if (EXPORT_CONTROL == DOMESTIC) || (EXPORT_CONTROL == FINANCIAL_EXPORT) || \
  80. defined(FIPS140_KERNEL)
  81. #define SKC_INCLUDE_DES // DES is not exported
  82. #define SKC_INCLUDE_TRIPLE_DES
  83. #endif //(EXPORT_CONTROL == DOMESTIC) || (EXPORT_CONTROL == FINANCIAL_EXPORT)||
  84. // defined(FIPS140_KERNEL)
  85. #ifdef RSA_CSP
  86. #define SKC_INCLUDE_CAST3 // lee
  87. #define SKC_CAST3_ENC_AND_MAC // lee
  88. #define SKC_INCLUDE_CAST
  89. #endif // RSA_CSP
  90. #define SKC_INCLUDE_MD2
  91. #define SKC_INCLUDE_MD5
  92. #ifdef RSA_CSP
  93. #define SKC_INCLUDE_RSA
  94. #else // !RSA_CSP
  95. #define SKC_INCLUDE_DH
  96. #define SKC_INCLUDE_DSA
  97. #endif // RSA_CSP
  98. #define SKC_INCLUDE_RC2
  99. //#define SKC_INCLUDE_RC6
  100. #define SKC_INCLUDE_SHA
  101. #define RC2_MAX_KEY_NBYTES (256/8)
  102. #if defined(FIPS140_KERNEL)
  103. #define SKC_INCLUDE_DSA
  104. #define SKC_INCLUDE_SHA
  105. #endif
  106. /*
  107. * DES configuration
  108. * Define DES_64K for fast 64K s-boxes. If not defined, then DES uses slower
  109. * 2K s-boxes.
  110. */
  111. #define DES_64K
  112. #ifdef SKC_INCLUDE_RSA
  113. /* RSA Configuration
  114. * This defines the type of RSA code implementation. RSATYPE can be defined
  115. * externally, if desired.
  116. */
  117. #define RSATYPE_PROPRIETARY 0 /* Native Entrust code */
  118. #define RSATYPE_BSAFE_API 1 /* Using the BSAFE API */
  119. #define RSATYPE_MICROSOFT 2 /* Using the Microsoft RSA derived from BSAFE */
  120. #ifndef RSATYPE
  121. #define RSATYPE RSATYPE_PROPRIETARY
  122. #endif
  123. #endif // SKC_INCLUDE_RSA
  124. /* Other Configuration
  125. * Derived automatically from the above. Don't touch!
  126. */
  127. #if defined SKC_INCLUDE_RSA && (RSATYPE == RSATYPE_PROPRIETARY)
  128. #define SKC_INCLUDE_PROP_RSA /* Proprietary low-level RSA code */
  129. #endif
  130. #if defined SKC_INCLUDE_PROP_RSA || defined SKC_INCLUDE_DSA
  131. #define SKC_INCLUDE_PROP_MATH /* Proprietary low-level math code */
  132. #endif
  133. #define SKC_INCLUDE_HMAC
  134. #define SKC_INCLUDE_MAC
  135. #endif /* SKCONFIG_H */