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.

128 lines
3.4 KiB

  1. //+-----------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (c) Microsoft Corporation 1992 - 1996
  6. //
  7. // File: userapi.h
  8. //
  9. // Contents: Structures and prototypes for user mode Kerberos functions
  10. //
  11. //
  12. // History: 3-May-1996 Created MikeSw
  13. //
  14. //------------------------------------------------------------------------
  15. #ifndef __USERAPI_H__
  16. #define __USERAPI_H__
  17. #include "krbprgma.h"
  18. #include <gssapiP.h>
  19. #ifdef EXTERN
  20. #undef EXTERN
  21. #endif
  22. #ifdef USERAPI_ALLOCATE
  23. #define EXTERN
  24. #else
  25. #define EXTERN extern
  26. #endif // USERAPI_ALLOCATE
  27. #ifndef WIN32_CHICAGO
  28. EXTERN PSID KerbGlobalLocalSystemSid;
  29. EXTERN PSID KerbGlobalAliasAdminsSid;
  30. #endif // WIN32_CHICAGO
  31. extern gss_OID_desc * gss_mech_krb5;
  32. extern gss_OID_desc * gss_mech_krb5_new;
  33. extern gss_OID_desc * gss_mech_krb5_u2u;
  34. extern gss_OID_desc * gss_mech_krb5_spnego;
  35. typedef struct _KERB_GSS_SIGNATURE {
  36. BYTE SignatureAlgorithm[2]; // see below table for values
  37. union {
  38. BYTE SignFiller[4]; // filler, must be ff ff ff ff
  39. struct {
  40. BYTE SealAlgorithm[2];
  41. BYTE SealFiller[2];
  42. };
  43. };
  44. BYTE SequenceNumber[8];
  45. BYTE Checksum[8];
  46. } KERB_GSS_SIGNATURE, *PKERB_GSS_SIGNATURE;
  47. #define KERB_GSS_SIG_CONFOUNDER_SIZE 8
  48. typedef struct _KERB_GSS_SEAL_SIGNATURE {
  49. KERB_GSS_SIGNATURE Signature;
  50. BYTE Confounder[KERB_GSS_SIG_CONFOUNDER_SIZE];
  51. } KERB_GSS_SEAL_SIGNATURE, *PKERB_GSS_SEAL_SIGNATURE;
  52. typedef ULONG KERB_NULL_SIGNATURE, *PKERB_NULL_SIGNATURE;
  53. //
  54. // This value goes in the second bye of the signature algorithm
  55. //
  56. #define KERB_GSS_SIG_SECOND 0x00
  57. //
  58. // These values go in the first byte
  59. //
  60. #define KERB_GSS_SIG_DES_MAC_MD5 0x00
  61. #define KERB_GSS_SIG_MD25 0x01
  62. #define KERB_GSS_SIG_DES_MAC 0x02
  63. #define KERB_GSS_SIG_HMAC 0x11
  64. //
  65. // These are sealing algorithm values
  66. //
  67. #define KERB_GSS_SEAL_DES_CBC 0x00
  68. #define KERB_GSS_SEAL_RC4_OLD 0x11
  69. #define KERB_GSS_SEAL_RC4 0x10
  70. #define KERB_GSS_NO_SEAL 0xff
  71. #define KERB_GSS_NO_SEAL_SECOND 0xff
  72. //
  73. // These are the flags passed in to MakeSignature and VerifySignature
  74. // corresponding to the above flags, taken from RFC 1964
  75. //
  76. #define GSS_KRB5_INTEG_C_QOP_DEFAULT 0x0
  77. #define GSS_KRB5_INTEG_C_QOP_MD5 0x1
  78. #define GSS_KRB5_INTEG_C_QOP_DES_MD5 0x2
  79. #define GSS_KRB5_INTEG_C_QOP_DES_MAC 0x3
  80. /** constants **/
  81. #define CKSUMTYPE_KG_CB 0x8003
  82. #define KG_TOK_CTX_AP_REQ 0x0100
  83. #define KG_TOK_CTX_AP_REP 0x0200
  84. #define KG_TOK_CTX_ERROR 0x0300
  85. #define KG_TOK_SIGN_MSG 0x0101
  86. #define KG_TOK_SEAL_MSG 0x0201
  87. #define KG_TOK_MIC_MSG 0x0101
  88. #define KG_TOK_WRAP_MSG 0x0201
  89. #define KG_TOK_DEL_CTX 0x0102
  90. #define KG_TOK_CTX_TGT_REQ 0x0400
  91. #define KG_TOK_CTX_TGT_REP 0x0401
  92. #define KRB5_GSS_FOR_CREDS_OPTION 1
  93. #define KERB_SIGN_FLAGS (ISC_RET_INTEGRITY | ISC_RET_SEQUENCE_DETECT | ISC_RET_REPLAY_DETECT)
  94. #define KERB_IS_DES_ENCRYPTION(_x_) ((((_x_) >= KERB_ETYPE_DES_CBC_CRC) && \
  95. ((_x_) <= KERB_ETYPE_DES_CBC_MD5)) || \
  96. ((_x_) == KERB_ETYPE_DES_PLAIN))
  97. #endif // __USERAPI_H__