Blame winpr/include/winpr/ntlm.h

Packit Service fa4841
/**
Packit Service fa4841
 * WinPR: Windows Portable Runtime
Packit Service fa4841
 * NTLM Utils
Packit Service fa4841
 *
Packit Service fa4841
 * Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
Packit Service fa4841
 *
Packit Service fa4841
 * Licensed under the Apache License, Version 2.0 (the "License");
Packit Service fa4841
 * you may not use this file except in compliance with the License.
Packit Service fa4841
 * You may obtain a copy of the License at
Packit Service fa4841
 *
Packit Service fa4841
 *     http://www.apache.org/licenses/LICENSE-2.0
Packit Service fa4841
 *
Packit Service fa4841
 * Unless required by applicable law or agreed to in writing, software
Packit Service fa4841
 * distributed under the License is distributed on an "AS IS" BASIS,
Packit Service fa4841
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Packit Service fa4841
 * See the License for the specific language governing permissions and
Packit Service fa4841
 * limitations under the License.
Packit Service fa4841
 */
Packit Service fa4841
Packit Service fa4841
#ifndef WINPR_UTILS_NTLM_H
Packit Service fa4841
#define WINPR_UTILS_NTLM_H
Packit Service fa4841
Packit Service fa4841
#include <stdio.h>
Packit Service fa4841
#include <stdlib.h>
Packit Service fa4841
#include <string.h>
Packit Service fa4841
#include <winpr/winpr.h>
Packit Service fa4841
#include <winpr/wtypes.h>
Packit Service fa4841
#include <winpr/sspi.h>
Packit Service fa4841
Packit Service fa4841
#ifdef __cplusplus
Packit Service b1ea74
extern "C"
Packit Service b1ea74
{
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service b1ea74
	typedef SECURITY_STATUS (*psPeerComputeNtlmHash)(void* client,
Packit Service b1ea74
	                                                 const SEC_WINNT_AUTH_IDENTITY* authIdentity,
Packit Service b1ea74
	                                                 const SecBuffer* ntproofvalue,
Packit Service b1ea74
	                                                 const BYTE* randkey, const BYTE* mic,
Packit Service b1ea74
	                                                 const SecBuffer* micvalue, BYTE* ntlmhash);
Packit Service fa4841
Packit Service b1ea74
	WINPR_API BOOL NTOWFv1W(LPWSTR Password, UINT32 PasswordLength, BYTE* NtHash);
Packit Service b1ea74
	WINPR_API BOOL NTOWFv1A(LPSTR Password, UINT32 PasswordLength, BYTE* NtHash);
Packit Service fa4841
Packit Service b1ea74
	WINPR_API BOOL NTOWFv2W(LPWSTR Password, UINT32 PasswordLength, LPWSTR User, UINT32 UserLength,
Packit Service b1ea74
	                        LPWSTR Domain, UINT32 DomainLength, BYTE* NtHash);
Packit Service b1ea74
	WINPR_API BOOL NTOWFv2A(LPSTR Password, UINT32 PasswordLength, LPSTR User, UINT32 UserLength,
Packit Service b1ea74
	                        LPSTR Domain, UINT32 DomainLength, BYTE* NtHash);
Packit Service fa4841
Packit Service b1ea74
	WINPR_API BOOL NTOWFv2FromHashW(BYTE* NtHashV1, LPWSTR User, UINT32 UserLength, LPWSTR Domain,
Packit Service b1ea74
	                                UINT32 DomainLength, BYTE* NtHash);
Packit Service b1ea74
	WINPR_API BOOL NTOWFv2FromHashA(BYTE* NtHashV1, LPSTR User, UINT32 UserLength, LPSTR Domain,
Packit Service b1ea74
	                                UINT32 DomainLength, BYTE* NtHash);
Packit Service fa4841
Packit Service fa4841
#ifdef __cplusplus
Packit Service fa4841
}
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#ifdef UNICODE
Packit Service b1ea74
#define NTOWFv1 NTOWFv1W
Packit Service b1ea74
#define NTOWFv2 NTOWFv2W
Packit Service b1ea74
#define NTOWFv2FromHash NTOWFv2FromHashW
Packit Service fa4841
#else
Packit Service b1ea74
#define NTOWFv1 NTOWFv1A
Packit Service b1ea74
#define NTOWFv2 NTOWFv2A
Packit Service b1ea74
#define NTOWFv2FromHash NTOWFv2FromHashA
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#endif /* WINPR_UTILS_NTLM_H */