Fix changelog email address
[freerdp-ubuntu-pcb-backport.git] / libfreerdp-core / credssp.h
1 /**
2  * FreeRDP: A Remote Desktop Protocol Client
3  * Credential Security Support Provider (CredSSP)
4  *
5  * Copyright 2010 Marc-Andre Moreau <marcandre.moreau@gmail.com>
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *     http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19
20 #ifndef __CREDSSP_H
21 #define __CREDSSP_H
22
23 typedef struct rdp_credssp rdpCredssp;
24
25 #include "tls.h"
26 #include "ber.h"
27 #include "crypto.h"
28 #include "transport.h"
29 #include <freerdp/settings.h>
30 #include <freerdp/utils/blob.h>
31 #include <freerdp/utils/memory.h>
32 #include <freerdp/utils/stream.h>
33 #include <freerdp/utils/hexdump.h>
34
35 #include "ntlmssp.h"
36
37 struct rdp_credssp
38 {
39         rdpBlob negoToken;
40         rdpBlob pubKeyAuth;
41         rdpBlob authInfo;
42         int send_seq_num;
43         rdpBlob public_key;
44         rdpBlob ts_credentials;
45         rdpSettings* settings;
46         CryptoRc4 rc4_seal_state;
47         struct _NTLMSSP *ntlmssp;
48         struct rdp_transport* transport;
49 };
50
51 int credssp_authenticate(rdpCredssp* credssp);
52
53 void credssp_send(rdpCredssp* credssp, rdpBlob* negoToken, rdpBlob* authInfo, rdpBlob* pubKeyAuth);
54 int credssp_recv(rdpCredssp* credssp, rdpBlob* negoToken, rdpBlob* authInfo, rdpBlob* pubKeyAuth);
55
56 void credssp_encrypt_public_key(rdpCredssp* credssp, rdpBlob* d);
57 void credssp_encrypt_ts_credentials(rdpCredssp* credssp, rdpBlob* d);
58 int credssp_verify_public_key(rdpCredssp* credssp, rdpBlob* d);
59 void credssp_encode_ts_credentials(rdpCredssp* credssp);
60
61 void credssp_current_time(uint8* timestamp);
62 void credssp_rc4k(uint8* key, int length, uint8* plaintext, uint8* ciphertext);
63
64 rdpCredssp* credssp_new(rdpTransport* transport);
65 void credssp_free(rdpCredssp* credssp);
66
67 #endif /* __CREDSSP_H */