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
1.9 KiB

  1. /*++
  2. Copyright (c) 1993 Microsoft Corporation
  3. Module Name:
  4. context.h
  5. Abstract:
  6. SSP Context.
  7. Author:
  8. Cliff Van Dyke (CliffV) 17-Sep-1993
  9. Revision History:
  10. --*/
  11. #ifndef _NTLMSSP_CONTEXT_INCLUDED_
  12. #define _NTLMSSP_CONTEXT_INCLUDED_
  13. #include <rc4.h>
  14. #include "ntlmsspv2.h"
  15. typedef struct _SSP_CONTEXT {
  16. //
  17. // Global list of all Contexts
  18. // (Serialized by SspContextCritSect)
  19. //
  20. LIST_ENTRY Next;
  21. //
  22. // Timeout the context after awhile.
  23. //
  24. DWORD StartTime;
  25. DWORD Interval;
  26. //
  27. // Used to prevent this Context from being deleted prematurely.
  28. //
  29. WORD References;
  30. //
  31. // Maintain the Negotiated protocol
  32. //
  33. ULONG NegotiateFlags;
  34. //
  35. // State of the context
  36. //
  37. enum {
  38. IdleState,
  39. NegotiateSentState, // Outbound context only
  40. ChallengeSentState, // Inbound context only
  41. AuthenticateSentState, // Outbound context only
  42. AuthenticatedState // Inbound context only
  43. } State;
  44. //
  45. // The challenge passed to the client.
  46. // Only valid when in ChallengeSentState.
  47. //
  48. UCHAR Challenge[MSV1_0_CHALLENGE_LENGTH];
  49. PSSP_CREDENTIAL Credential;
  50. ULONG Nonce;
  51. struct RC4_KEYSTRUCT SEC_FAR * Rc4Key;
  52. //
  53. // NTLMv2 session keys
  54. //
  55. USER_SESSION_KEY UserSessionKey;
  56. NTLMV2_DERIVED_SKEYS Ntlmv2SKeys;
  57. } SSP_CONTEXT, *PSSP_CONTEXT;
  58. PSSP_CONTEXT
  59. SspContextReferenceContext(
  60. IN PCtxtHandle ContextHandle,
  61. IN BOOLEAN RemoveContext
  62. );
  63. void
  64. SspContextDereferenceContext(
  65. PSSP_CONTEXT Context
  66. );
  67. PSSP_CONTEXT
  68. SspContextAllocateContext(
  69. );
  70. TimeStamp
  71. SspContextGetTimeStamp(
  72. IN PSSP_CONTEXT Context,
  73. IN BOOLEAN GetExpirationTime
  74. );
  75. #endif // ifndef _NTLMSSP_CONTEXT_INCLUDED_