2011-06-30 18:51:46 -04:00
|
|
|
/**
|
2012-02-20 16:17:57 -05:00
|
|
|
* FreeRDP: A Remote Desktop Protocol Implementation
|
2011-06-30 18:51:46 -04:00
|
|
|
* Credential Security Support Provider (CredSSP)
|
|
|
|
*
|
2012-02-20 16:17:57 -05:00
|
|
|
* Copyright 2010-2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
2011-06-30 18:51:46 -04:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2012-03-05 17:23:22 -05:00
|
|
|
#ifndef FREERDP_SSPI_CREDSSP_H
|
|
|
|
#define FREERDP_SSPI_CREDSSP_H
|
2011-06-30 18:51:46 -04:00
|
|
|
|
2011-07-07 13:37:48 -04:00
|
|
|
typedef struct rdp_credssp rdpCredssp;
|
|
|
|
|
2012-02-20 21:56:55 -08:00
|
|
|
#include <freerdp/api.h>
|
2012-02-17 17:12:21 -05:00
|
|
|
#include <freerdp/freerdp.h>
|
2011-07-05 23:18:00 -04:00
|
|
|
#include <freerdp/utils/memory.h>
|
|
|
|
#include <freerdp/utils/stream.h>
|
2011-07-07 11:27:24 -04:00
|
|
|
#include <freerdp/utils/hexdump.h>
|
2011-07-05 23:18:00 -04:00
|
|
|
|
2012-05-04 19:48:53 -04:00
|
|
|
#include <winpr/sspi.h>
|
2012-02-29 10:46:09 -05:00
|
|
|
|
|
|
|
#include <freerdp/crypto/tls.h>
|
|
|
|
#include <freerdp/crypto/ber.h>
|
|
|
|
#include <freerdp/crypto/crypto.h>
|
2011-06-30 18:51:46 -04:00
|
|
|
|
|
|
|
struct rdp_credssp
|
|
|
|
{
|
2012-02-17 17:12:21 -05:00
|
|
|
rdpTls* tls;
|
2012-02-13 22:27:59 -05:00
|
|
|
boolean server;
|
2011-06-30 18:51:46 -04:00
|
|
|
int send_seq_num;
|
2012-03-18 22:02:23 -04:00
|
|
|
int recv_seq_num;
|
2012-02-29 10:46:09 -05:00
|
|
|
UNICONV* uniconv;
|
2012-02-29 11:36:11 -05:00
|
|
|
freerdp* instance;
|
2012-03-15 20:37:38 -04:00
|
|
|
CtxtHandle context;
|
2012-02-29 11:57:43 -05:00
|
|
|
rdpSettings* settings;
|
2012-03-15 20:37:38 -04:00
|
|
|
SecBuffer negoToken;
|
|
|
|
SecBuffer pubKeyAuth;
|
|
|
|
SecBuffer authInfo;
|
|
|
|
SecBuffer PublicKey;
|
|
|
|
SecBuffer ts_credentials;
|
2011-06-30 18:51:46 -04:00
|
|
|
CryptoRc4 rc4_seal_state;
|
2012-03-15 20:37:38 -04:00
|
|
|
SEC_WINNT_AUTH_IDENTITY identity;
|
|
|
|
SecurityFunctionTable* table;
|
|
|
|
SecPkgContext_Sizes ContextSizes;
|
2011-06-30 18:51:46 -04:00
|
|
|
};
|
|
|
|
|
2012-02-20 21:56:55 -08:00
|
|
|
FREERDP_API int credssp_authenticate(rdpCredssp* credssp);
|
2011-06-30 18:51:46 -04:00
|
|
|
|
2012-03-04 21:56:41 -05:00
|
|
|
FREERDP_API void credssp_send(rdpCredssp* credssp);
|
|
|
|
FREERDP_API int credssp_recv(rdpCredssp* credssp);
|
|
|
|
|
2012-03-18 20:08:05 -04:00
|
|
|
FREERDP_API void credssp_buffer_print(rdpCredssp* credssp);
|
2012-03-04 21:56:41 -05:00
|
|
|
FREERDP_API void credssp_buffer_free(rdpCredssp* credssp);
|
2011-06-30 18:51:46 -04:00
|
|
|
|
2012-02-29 11:57:43 -05:00
|
|
|
SECURITY_STATUS credssp_verify_public_key_echo(rdpCredssp* credssp);
|
2012-02-20 21:56:55 -08:00
|
|
|
FREERDP_API void credssp_encode_ts_credentials(rdpCredssp* credssp);
|
2012-02-29 11:57:43 -05:00
|
|
|
SECURITY_STATUS credssp_encrypt_ts_credentials(rdpCredssp* credssp);
|
2011-06-30 18:51:46 -04:00
|
|
|
|
2012-02-20 21:56:55 -08:00
|
|
|
FREERDP_API rdpCredssp* credssp_new(freerdp* instance, rdpTls* tls, rdpSettings* settings);
|
|
|
|
FREERDP_API void credssp_free(rdpCredssp* credssp);
|
2011-06-30 18:51:46 -04:00
|
|
|
|
2012-03-05 17:23:22 -05:00
|
|
|
#endif /* FREERDP_SSPI_CREDSSP_H */
|