2011-07-12 04:46:03 +04:00
|
|
|
/**
|
2012-10-09 07:02:04 +04:00
|
|
|
* FreeRDP: A Remote Desktop Protocol Implementation
|
2011-07-12 04:46:03 +04:00
|
|
|
* RDP Licensing
|
|
|
|
*
|
|
|
|
* Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
2022-10-06 12:32:08 +03:00
|
|
|
* Copyright 2022 Armin Novak <armin.novak@thincast.com>
|
|
|
|
* Copyright 2022 Thincast Technologies GmbH
|
2011-07-12 04:46:03 +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.
|
|
|
|
*/
|
|
|
|
|
2017-06-06 15:01:41 +03:00
|
|
|
#ifndef FREERDP_LIB_CORE_LICENSE_H
|
|
|
|
#define FREERDP_LIB_CORE_LICENSE_H
|
2011-07-12 04:46:03 +04:00
|
|
|
|
|
|
|
#include "rdp.h"
|
2022-11-11 14:26:28 +03:00
|
|
|
#include "state.h"
|
2013-03-22 00:45:25 +04:00
|
|
|
|
2012-02-17 09:58:30 +04:00
|
|
|
#include <freerdp/crypto/crypto.h>
|
2011-07-12 04:46:03 +04:00
|
|
|
|
2014-09-12 16:36:29 +04:00
|
|
|
#include <freerdp/log.h>
|
2018-11-01 13:02:54 +03:00
|
|
|
#include <freerdp/license.h>
|
2013-03-22 00:45:25 +04:00
|
|
|
|
|
|
|
#include <winpr/stream.h>
|
2011-07-12 04:46:03 +04:00
|
|
|
|
2022-10-06 12:32:08 +03:00
|
|
|
#define CLIENT_RANDOM_LENGTH 32
|
|
|
|
|
2011-07-12 04:46:03 +04:00
|
|
|
typedef struct
|
|
|
|
{
|
2012-10-09 11:26:39 +04:00
|
|
|
UINT32 dwVersion;
|
|
|
|
UINT32 cbCompanyName;
|
2012-10-09 11:01:37 +04:00
|
|
|
BYTE* pbCompanyName;
|
2012-10-09 11:26:39 +04:00
|
|
|
UINT32 cbProductId;
|
2012-10-09 11:01:37 +04:00
|
|
|
BYTE* pbProductId;
|
2014-02-17 03:02:50 +04:00
|
|
|
} LICENSE_PRODUCT_INFO;
|
2011-07-12 04:46:03 +04:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2012-10-09 11:01:37 +04:00
|
|
|
UINT16 type;
|
|
|
|
UINT16 length;
|
|
|
|
BYTE* data;
|
2011-07-12 04:46:03 +04:00
|
|
|
} LICENSE_BLOB;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2012-10-09 11:26:39 +04:00
|
|
|
UINT32 count;
|
2022-10-06 12:32:08 +03:00
|
|
|
LICENSE_BLOB** array;
|
2011-07-12 04:46:03 +04:00
|
|
|
} SCOPE_LIST;
|
|
|
|
|
2022-10-06 12:32:08 +03:00
|
|
|
FREERDP_LOCAL BOOL license_send_valid_client_error_packet(rdpRdp* rdp);
|
2011-07-12 04:46:03 +04:00
|
|
|
|
2022-11-11 14:26:28 +03:00
|
|
|
FREERDP_LOCAL state_run_t license_recv(rdpLicense* license, wStream* s);
|
2016-08-10 10:12:55 +03:00
|
|
|
|
2022-10-06 12:32:08 +03:00
|
|
|
/* the configuration is applied from settings. Set FreeRDP_ServerLicense* settings */
|
|
|
|
FREERDP_LOCAL BOOL license_server_configure(rdpLicense* license);
|
|
|
|
FREERDP_LOCAL BOOL license_server_send_request(rdpLicense* license);
|
|
|
|
|
2016-08-10 10:12:55 +03:00
|
|
|
FREERDP_LOCAL void license_free(rdpLicense* license);
|
2011-07-12 04:46:03 +04:00
|
|
|
|
2024-01-26 15:09:00 +03:00
|
|
|
WINPR_ATTR_MALLOC(license_free, 1)
|
|
|
|
FREERDP_LOCAL rdpLicense* license_new(rdpRdp* rdp);
|
|
|
|
|
2014-09-12 16:36:29 +04:00
|
|
|
#define LICENSE_TAG FREERDP_TAG("core.license")
|
2011-07-12 09:57:09 +04:00
|
|
|
#ifdef WITH_DEBUG_LICENSE
|
2022-10-06 12:32:08 +03:00
|
|
|
#define DEBUG_LICENSE(...) WLog_INFO(LICENSE_TAG, __VA_ARGS__)
|
2011-07-12 09:57:09 +04:00
|
|
|
#else
|
2019-11-06 17:24:51 +03:00
|
|
|
#define DEBUG_LICENSE(...) \
|
|
|
|
do \
|
|
|
|
{ \
|
|
|
|
} while (0)
|
2011-07-12 09:57:09 +04:00
|
|
|
#endif
|
|
|
|
|
2017-06-06 15:01:41 +03:00
|
|
|
#endif /* FREERDP_LIB_CORE_LICENSE_H */
|