FreeRDP
libfreerdp/core/security.h
1 
20 #ifndef FREERDP_LIB_CORE_SECURITY_H
21 #define FREERDP_LIB_CORE_SECURITY_H
22 
23 #include "rdp.h"
24 #include <freerdp/crypto/crypto.h>
25 
26 #include <freerdp/freerdp.h>
27 #include <freerdp/api.h>
28 
29 #include <winpr/stream.h>
30 
31 FREERDP_LOCAL BOOL security_master_secret(const BYTE* premaster_secret, size_t pre_len,
32  const BYTE* client_random, size_t client_len,
33  const BYTE* server_random, size_t server_len,
34  BYTE* output, size_t out_len);
35 FREERDP_LOCAL BOOL security_session_key_blob(const BYTE* master_secret, size_t master_len,
36  const BYTE* client_random, size_t client_len,
37  const BYTE* server_random, size_t server_len,
38  BYTE* output, size_t out_len);
39 FREERDP_LOCAL void security_mac_salt_key(const BYTE* session_key_blob, size_t session_len,
40  const BYTE* client_random, size_t client_len,
41  const BYTE* server_random, size_t server_len, BYTE* output,
42  size_t out_len);
43 FREERDP_LOCAL BOOL security_licensing_encryption_key(const BYTE* session_key_blob,
44  size_t session_len, const BYTE* client_random,
45  size_t client_len, const BYTE* server_random,
46  size_t server_len, BYTE* output,
47  size_t out_len);
48 FREERDP_LOCAL BOOL security_mac_data(const BYTE* mac_salt_key, size_t mac_salt_key_length,
49  const BYTE* data, size_t length, BYTE* output,
50  size_t output_length);
51 FREERDP_LOCAL BOOL security_mac_signature(rdpRdp* rdp, const BYTE* data, UINT32 length,
52  BYTE* output, size_t out_len);
53 FREERDP_LOCAL BOOL security_salted_mac_signature(rdpRdp* rdp, const BYTE* data, UINT32 length,
54  BOOL encryption, BYTE* output, size_t out_len);
55 FREERDP_LOCAL BOOL security_establish_keys(rdpRdp* rdp);
56 
57 FREERDP_LOCAL BOOL security_lock(rdpRdp* rdp);
58 FREERDP_LOCAL BOOL security_unlock(rdpRdp* rdp);
59 
60 FREERDP_LOCAL BOOL security_encrypt(BYTE* data, size_t length, rdpRdp* rdp);
61 FREERDP_LOCAL BOOL security_decrypt(BYTE* data, size_t length, rdpRdp* rdp);
62 FREERDP_LOCAL BOOL security_hmac_signature(const BYTE* data, size_t length, BYTE* output,
63  size_t out_len, rdpRdp* rdp);
64 FREERDP_LOCAL BOOL security_fips_encrypt(BYTE* data, size_t length, rdpRdp* rdp);
65 FREERDP_LOCAL BOOL security_fips_decrypt(BYTE* data, size_t length, rdpRdp* rdp);
66 FREERDP_LOCAL BOOL security_fips_check_signature(const BYTE* data, size_t length, const BYTE* sig,
67  size_t sig_len, rdpRdp* rdp);
68 
69 #endif /* FREERDP_LIB_CORE_SECURITY_H */