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.
|
|
/*****************************************************************/
/** Microsoft Windows **/
/** Copyright (C) Microsoft Corp., 1991-1995 **/
/*****************************************************************/
#pragma once
#ifdef UAM_TARGET_CARBON
#include <Carbon/Carbon.h>
#endif
#include "crypto.h"
#include "descrypt.h"
#include "rc4.h"
#define __RPC_FAR
//
// From ntsam.h
//
#define SAM_MAX_PASSWORD_LENGTH 256
#define ERROR_SUCCESS 0
#define ERROR_INVALID_FUNCTION -1070
#define ntoh(a) ((((a) << 24) & 0xFF000000) | (((a) << 8) & 0x00FF0000) | (((a) >> 8) & 0x0000FF00) | (((a) >> 24) & 0x000000FF))
//
// From sampass.h
//
typedef struct //_SAMPR_USER_PASSWORD
{
UInt16 Buffer[256];
DWORD Length;
}SAMPR_USER_PASSWORD, *PSAMPR_USER_PASSWORD;
//typedef struct _SAMPR_USER_PASSWORD __RPC_FAR *PSAMPR_USER_PASSWORD;
typedef struct _SAMPR_ENCRYPTED_USER_PASSWORD
{
UCHAR Buffer[516];
}SAMPR_ENCRYPTED_USER_PASSWORD;
typedef struct _SAMPR_ENCRYPTED_USER_PASSWORD __RPC_FAR *PSAMPR_ENCRYPTED_USER_PASSWORD;
Boolean EncryptStdBlock(
IN PBLOCK_KEY BlockKey,
OUT PCYPHER_BLOCK CypherBlock
);
Boolean CalculateLmOwfPassword(
IN PLM_PASSWORD LmPassword,
OUT PLM_OWF_PASSWORD LmOwfPassword
);
Boolean EncryptBlock(
IN PCLEAR_BLOCK ClearBlock,
IN PBLOCK_KEY BlockKey,
OUT PCYPHER_BLOCK CypherBlock
);
Boolean EncryptLmOwfPwdWithLmOwfPwd(
IN PLM_OWF_PASSWORD DataLmOwfPassword,
IN PLM_OWF_PASSWORD KeyLmOwfPassword,
OUT PENCRYPTED_LM_OWF_PASSWORD EncryptedLmOwfPassword
);
OSStatus SampEncryptLmPasswords(
LPSTR OldUpcasePassword,
LPSTR NewUpcasePassword,
LPSTR NewPassword,
PSAMPR_ENCRYPTED_USER_PASSWORD NewEncryptedWithOldLm,
PENCRYPTED_NT_OWF_PASSWORD OldLmOwfEncryptedWithNewLm
);
|