FreeRDP
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
31 extern "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_API BOOL NTOWFv1W(LPWSTR Password, UINT32 PasswordLength, BYTE* NtHash);
42  WINPR_API BOOL NTOWFv1A(LPSTR Password, UINT32 PasswordLength, BYTE* NtHash);
43 
44  WINPR_API BOOL NTOWFv2W(LPWSTR Password, UINT32 PasswordLength, LPWSTR User, UINT32 UserLength,
45  LPWSTR Domain, UINT32 DomainLength, BYTE* NtHash);
46  WINPR_API BOOL NTOWFv2A(LPSTR Password, UINT32 PasswordLength, LPSTR User, UINT32 UserLength,
47  LPSTR Domain, UINT32 DomainLength, BYTE* NtHash);
48 
49  WINPR_API BOOL NTOWFv2FromHashW(BYTE* NtHashV1, LPWSTR User, UINT32 UserLength, LPWSTR Domain,
50  UINT32 DomainLength, BYTE* NtHash);
51  WINPR_API BOOL NTOWFv2FromHashA(BYTE* NtHashV1, LPSTR User, UINT32 UserLength, LPSTR Domain,
52  UINT32 DomainLength, BYTE* NtHash);
53 
54 #ifdef __cplusplus
55 }
56 #endif
57 
58 #ifdef UNICODE
59 #define NTOWFv1 NTOWFv1W
60 #define NTOWFv2 NTOWFv2W
61 #define NTOWFv2FromHash NTOWFv2FromHashW
62 #else
63 #define NTOWFv1 NTOWFv1A
64 #define NTOWFv2 NTOWFv2A
65 #define NTOWFv2FromHash NTOWFv2FromHashA
66 #endif
67 
68 #endif /* WINPR_UTILS_NTLM_H */