2011-07-01 02:51:46 +04:00
|
|
|
/**
|
|
|
|
* FreeRDP: A Remote Desktop Protocol Client
|
|
|
|
* Credential Security Support Provider (CredSSP)
|
|
|
|
*
|
|
|
|
* Copyright 2010 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 __CREDSSP_H
|
|
|
|
#define __CREDSSP_H
|
|
|
|
|
2011-07-07 21:37:48 +04:00
|
|
|
typedef struct rdp_credssp rdpCredssp;
|
|
|
|
|
2011-07-06 07:18:00 +04:00
|
|
|
#include "tls.h"
|
2011-07-18 10:34:28 +04:00
|
|
|
#include "ber.h"
|
2011-07-06 07:18:00 +04:00
|
|
|
#include "crypto.h"
|
|
|
|
#include "transport.h"
|
|
|
|
#include <freerdp/settings.h>
|
2011-07-07 19:49:57 +04:00
|
|
|
#include <freerdp/utils/blob.h>
|
2011-07-06 07:18:00 +04:00
|
|
|
#include <freerdp/utils/memory.h>
|
|
|
|
#include <freerdp/utils/stream.h>
|
2011-07-07 19:27:24 +04:00
|
|
|
#include <freerdp/utils/hexdump.h>
|
2011-07-06 07:18:00 +04:00
|
|
|
|
2011-07-01 02:51:46 +04:00
|
|
|
#include "ntlmssp.h"
|
|
|
|
|
|
|
|
struct rdp_credssp
|
|
|
|
{
|
2011-08-16 01:05:48 +04:00
|
|
|
rdpBlob negoToken;
|
|
|
|
rdpBlob pubKeyAuth;
|
|
|
|
rdpBlob authInfo;
|
2011-07-01 02:51:46 +04:00
|
|
|
int send_seq_num;
|
2011-08-16 01:05:48 +04:00
|
|
|
rdpBlob public_key;
|
|
|
|
rdpBlob ts_credentials;
|
2011-09-27 06:58:49 +04:00
|
|
|
rdpSettings* settings;
|
2011-07-01 02:51:46 +04:00
|
|
|
CryptoRc4 rc4_seal_state;
|
|
|
|
struct _NTLMSSP *ntlmssp;
|
2011-07-07 21:37:48 +04:00
|
|
|
struct rdp_transport* transport;
|
2011-07-01 02:51:46 +04:00
|
|
|
};
|
|
|
|
|
2011-07-07 19:49:57 +04:00
|
|
|
int credssp_authenticate(rdpCredssp* credssp);
|
2011-07-01 02:51:46 +04:00
|
|
|
|
2011-08-16 01:19:59 +04:00
|
|
|
void credssp_send(rdpCredssp* credssp, rdpBlob* negoToken, rdpBlob* authInfo, rdpBlob* pubKeyAuth);
|
2011-08-16 01:05:48 +04:00
|
|
|
int credssp_recv(rdpCredssp* credssp, rdpBlob* negoToken, rdpBlob* authInfo, rdpBlob* pubKeyAuth);
|
2011-07-01 02:51:46 +04:00
|
|
|
|
2011-08-16 01:05:48 +04:00
|
|
|
void credssp_encrypt_public_key(rdpCredssp* credssp, rdpBlob* d);
|
|
|
|
void credssp_encrypt_ts_credentials(rdpCredssp* credssp, rdpBlob* d);
|
|
|
|
int credssp_verify_public_key(rdpCredssp* credssp, rdpBlob* d);
|
2011-07-07 19:49:57 +04:00
|
|
|
void credssp_encode_ts_credentials(rdpCredssp* credssp);
|
2011-07-01 02:51:46 +04:00
|
|
|
|
|
|
|
void credssp_current_time(uint8* timestamp);
|
|
|
|
void credssp_rc4k(uint8* key, int length, uint8* plaintext, uint8* ciphertext);
|
|
|
|
|
2011-07-07 19:49:57 +04:00
|
|
|
rdpCredssp* credssp_new(rdpTransport* transport);
|
|
|
|
void credssp_free(rdpCredssp* credssp);
|
2011-07-01 02:51:46 +04:00
|
|
|
|
|
|
|
#endif /* __CREDSSP_H */
|