2012-11-15 19:00:07 +04:00
|
|
|
/**
|
|
|
|
* FreeRDP: A Remote Desktop Protocol Implementation
|
|
|
|
* NTLM over HTTP
|
|
|
|
*
|
|
|
|
* Copyright 2012 Fujitsu Technology Solutions GmbH
|
|
|
|
* Copyright 2012 Dmitrij Jasnov <dmitrij.jasnov@ts.fujitsu.com>
|
|
|
|
* Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef FREERDP_CORE_NTLM_H
|
|
|
|
#define FREERDP_CORE_NTLM_H
|
|
|
|
|
|
|
|
typedef struct rdp_ntlm rdpNtlm;
|
|
|
|
|
2012-12-13 08:18:20 +04:00
|
|
|
#include "../tcp.h"
|
|
|
|
#include "../transport.h"
|
|
|
|
|
2012-11-15 19:00:07 +04:00
|
|
|
#include "rts.h"
|
|
|
|
#include "http.h"
|
|
|
|
|
|
|
|
#include <freerdp/types.h>
|
|
|
|
#include <freerdp/settings.h>
|
|
|
|
#include <freerdp/crypto/tls.h>
|
|
|
|
#include <freerdp/crypto/crypto.h>
|
2014-09-12 16:36:29 +04:00
|
|
|
|
2013-03-22 00:45:25 +04:00
|
|
|
#include <winpr/sspi.h>
|
2012-12-14 08:54:54 +04:00
|
|
|
#include <winpr/print.h>
|
2013-03-22 00:45:25 +04:00
|
|
|
#include <winpr/stream.h>
|
2012-11-15 19:00:07 +04:00
|
|
|
|
|
|
|
struct rdp_ntlm
|
|
|
|
{
|
2013-01-09 09:20:08 +04:00
|
|
|
BOOL http;
|
2012-11-15 19:00:07 +04:00
|
|
|
CtxtHandle context;
|
|
|
|
ULONG cbMaxToken;
|
|
|
|
ULONG fContextReq;
|
|
|
|
ULONG pfContextAttr;
|
|
|
|
TimeStamp expiration;
|
|
|
|
PSecBuffer pBuffer;
|
2013-01-09 09:20:08 +04:00
|
|
|
SecBuffer inputBuffer[2];
|
|
|
|
SecBuffer outputBuffer[2];
|
2012-11-15 19:00:07 +04:00
|
|
|
BOOL haveContext;
|
|
|
|
BOOL haveInputBuffer;
|
|
|
|
LPTSTR ServicePrincipalName;
|
|
|
|
SecBufferDesc inputBufferDesc;
|
|
|
|
SecBufferDesc outputBufferDesc;
|
|
|
|
CredHandle credentials;
|
|
|
|
BOOL confidentiality;
|
|
|
|
SecPkgInfo* pPackageInfo;
|
|
|
|
SecurityFunctionTable* table;
|
|
|
|
SEC_WINNT_AUTH_IDENTITY identity;
|
|
|
|
SecPkgContext_Sizes ContextSizes;
|
2013-01-09 09:20:08 +04:00
|
|
|
SecPkgContext_Bindings* Bindings;
|
2012-11-15 19:00:07 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
BOOL ntlm_authenticate(rdpNtlm* ntlm);
|
|
|
|
|
2013-01-09 09:20:08 +04:00
|
|
|
BOOL ntlm_client_init(rdpNtlm* ntlm, BOOL confidentiality, char* user,
|
|
|
|
char* domain, char* password, SecPkgContext_Bindings* Bindings);
|
2012-11-15 19:00:07 +04:00
|
|
|
void ntlm_client_uninit(rdpNtlm* ntlm);
|
|
|
|
|
2012-11-16 01:25:22 +04:00
|
|
|
BOOL ntlm_client_make_spn(rdpNtlm* ntlm, LPCTSTR ServiceClass, char* hostname);
|
|
|
|
|
2013-02-15 01:20:43 +04:00
|
|
|
rdpNtlm* ntlm_new(void);
|
2012-11-15 19:00:07 +04:00
|
|
|
void ntlm_free(rdpNtlm* ntlm);
|
|
|
|
|
|
|
|
#endif /* FREERDP_CORE_NTLM_H */
|