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.

0 lines
9.5 KiB

  1. /*++ BUILD Version: 0001 // Increment this if a change has global effects Copyright (c) 1989 Microsoft Corporation Module Name: crypto.h Abstract: This module contains the public data structures and API definitions needed to utilize the encryption library Author: David Chalmers (Davidc) 21-October-1991 Revision History: --*/ #ifndef _NTCRYPT_ #define _NTCRYPT_ #ifdef __MACUAM__ #include "MWERKSCrypto.h" #endif #ifdef __MACSSP__ #include "bootdefs.h" #endif ///////////////////////////////////////////////////////////////////////// // // // Core encryption types // // // ///////////////////////////////////////////////////////////////////////// #define CLEAR_BLOCK_LENGTH 8 typedef struct _CLEAR_BLOCK { char data[CLEAR_BLOCK_LENGTH]; } CLEAR_BLOCK; typedef CLEAR_BLOCK * PCLEAR_BLOCK; #define CYPHER_BLOCK_LENGTH 8 typedef struct _CYPHER_BLOCK { char data[CYPHER_BLOCK_LENGTH]; } CYPHER_BLOCK; typedef CYPHER_BLOCK * PCYPHER_BLOCK; #define BLOCK_KEY_LENGTH 7 typedef struct _BLOCK_KEY { char data[BLOCK_KEY_LENGTH]; } BLOCK_KEY; typedef BLOCK_KEY * PBLOCK_KEY; ///////////////////////////////////////////////////////////////////////// // // // Arbitrary length data encryption types // // // ///////////////////////////////////////////////////////////////////////// typedef struct _CRYPT_BUFFER { DWORD Length; // Number of valid bytes in buffer DWORD MaximumLength; // Number of bytes pointed to by Buffer PVOID Buffer; } CRYPT_BUFFER; typedef CRYPT_BUFFER * PCRYPT_BUFFER; typedef CRYPT_BUFFER CLEAR_DATA; typedef CLEAR_DATA * PCLEAR_DATA; typedef CRYPT_BUFFER DATA_KEY; typedef DATA_KEY * PDATA_KEY; typedef CRYPT_BUFFER CYPHER_DATA; typedef CYPHER_DATA * PCYPHER_DATA; ///////////////////////////////////////////////////////////////////////// // // // Lan Manager data types // // // ///////////////////////////////////////////////////////////////////////// // // Define a LanManager compatible password // // A LanManager password is a null-terminated ansi string consisting of a // maximum of 14 characters (not including terminator) // typedef char * PLM_PASSWORD; // // Define the result of the 'One Way Function' (OWF) on a LM password // #define LM_OWF_PASSWORD_LENGTH (CYPHER_BLOCK_LENGTH * 2) typedef struct _LM_OWF_PASSWORD { CYPHER_BLOCK data[2]; } LM_OWF_PASSWORD; typedef LM_OWF_PASSWORD * PLM_OWF_PASSWORD; // // Define the challenge sent by the Lanman server during logon // #define LM_CHALLENGE_LENGTH CLEAR_BLOCK_LENGTH typedef CLEAR_BLOCK LM_CHALLENGE; typedef LM_CHALLENGE * PLM_CHALLENGE; // // Define the response sent by redirector in response to challenge from server // #define LM_RESPONSE_LENGTH (CYPHER_BLOCK_LENGTH * 3) typedef struct _LM_RESPONSE { CYPHER_BLOCK data[3]; } LM_RESPONSE; typedef LM_RESPONSE * PLM_RESPONSE; // // Define the result of the reversible encryption of an OWF'ed password. // #define ENCRYPTED_LM_OWF_PASSWORD_LENGTH (CYPHER_BLOCK_LENGTH * 2) typedef struct _ENCRYPTED_LM_OWF_PASSWORD { CYPHER_BLOCK data[2]; } ENCRYPTED_LM_OWF_PASSWORD; typedef ENCRYPTED_LM_OWF_PASSWORD * PE