FreeRDP
Loading...
Searching...
No Matches
include/winpr/ntlm.h
1
20#ifndef WINPR_UTILS_NTLM_H
21#define WINPR_UTILS_NTLM_H
22
23#include <stdio.h>
24#include <stdlib.h>
25#include <string.h>
26#include <winpr/winpr.h>
27#include <winpr/wtypes.h>
28#include <winpr/sspi.h>
29
30#ifdef __cplusplus
31extern "C"
32{
33#endif
34
35 typedef SECURITY_STATUS (*psPeerComputeNtlmHash)(void* client,
36 const SEC_WINNT_AUTH_IDENTITY* authIdentity,
37 const SecBuffer* ntproofvalue,
38 const BYTE* randkey, const BYTE* mic,
39 const SecBuffer* micvalue, BYTE* ntlmhash);
40
41 WINPR_ATTR_NODISCARD
42 WINPR_API BOOL NTOWFv1W(LPCWSTR Password, UINT32 PasswordLengthInBytes, BYTE* NtHash);
43
44 WINPR_ATTR_NODISCARD
45 WINPR_API BOOL NTOWFv1A(LPCSTR Password, UINT32 PasswordLengthInBytes, BYTE* NtHash);
46
47 WINPR_ATTR_NODISCARD
48 WINPR_API BOOL NTOWFv2W(LPCWSTR Password, UINT32 PasswordLengthInBytes, LPCWSTR User,
49 UINT32 UserLengthInBytes, LPCWSTR Domain, UINT32 DomainLengthInBytes,
50 BYTE* NtHash);
51
52 WINPR_ATTR_NODISCARD
53 WINPR_API BOOL NTOWFv2A(LPCSTR Password, UINT32 PasswordLengthInBytes, LPCSTR User,
54 UINT32 UserLengthInBytes, LPCSTR Domain, UINT32 DomainLengthInBytes,
55 BYTE* NtHash);
56
57 WINPR_ATTR_NODISCARD
58 WINPR_API BOOL NTOWFv2FromHashW(const BYTE* NtHashV1, LPCWSTR User, UINT32 UserLengthInBytes,
59 LPCWSTR Domain, UINT32 DomainLengthInBytes, BYTE* NtHash);
60
61 WINPR_ATTR_NODISCARD
62 WINPR_API BOOL NTOWFv2FromHashA(const BYTE* NtHashV1, LPCSTR User, UINT32 UserLengthInBytes,
63 LPCSTR Domain, UINT32 DomainLengthInBytes, BYTE* NtHash);
64
65#ifdef __cplusplus
66}
67#endif
68
69#ifdef UNICODE
70#define NTOWFv1 NTOWFv1W
71#define NTOWFv2 NTOWFv2W
72#define NTOWFv2FromHash NTOWFv2FromHashW
73#else
74#define NTOWFv1 NTOWFv1A
75#define NTOWFv2 NTOWFv2A
76#define NTOWFv2FromHash NTOWFv2FromHashA
77#endif
78
79#endif /* WINPR_UTILS_NTLM_H */