2011-07-01 02:51:46 +04:00
|
|
|
/**
|
2012-02-21 01:17:57 +04:00
|
|
|
* FreeRDP: A Remote Desktop Protocol Implementation
|
2017-05-11 19:51:45 +03:00
|
|
|
* Network Level Authentication (NLA)
|
2011-07-01 02:51:46 +04:00
|
|
|
*
|
2012-02-21 01:17:57 +04:00
|
|
|
* Copyright 2010-2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
2011-07-01 02: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.
|
|
|
|
*/
|
|
|
|
|
2017-06-06 15:01:41 +03:00
|
|
|
#ifndef FREERDP_LIB_CORE_NLA_H
|
|
|
|
#define FREERDP_LIB_CORE_NLA_H
|
2011-07-01 02:51:46 +04:00
|
|
|
|
2015-02-15 19:10:14 +03:00
|
|
|
typedef struct rdp_nla rdpNla;
|
2011-07-07 21:37:48 +04:00
|
|
|
|
2012-02-21 09:56:55 +04:00
|
|
|
#include <freerdp/api.h>
|
2012-02-18 02:12:21 +04:00
|
|
|
#include <freerdp/freerdp.h>
|
2011-07-06 07:18:00 +04:00
|
|
|
|
2012-05-05 03:48:53 +04:00
|
|
|
#include <winpr/sspi.h>
|
2013-03-22 00:45:25 +04:00
|
|
|
#include <winpr/stream.h>
|
2016-02-24 19:04:03 +03:00
|
|
|
#include <winpr/crypto.h>
|
2012-02-29 19:46:09 +04:00
|
|
|
|
|
|
|
#include <freerdp/crypto/ber.h>
|
2012-06-18 23:56:40 +04:00
|
|
|
#include <freerdp/crypto/der.h>
|
2012-02-29 19:46:09 +04:00
|
|
|
#include <freerdp/crypto/crypto.h>
|
2011-07-01 02:51:46 +04:00
|
|
|
|
2012-11-15 06:30:21 +04:00
|
|
|
#include "transport.h"
|
|
|
|
|
2022-02-14 16:59:22 +03:00
|
|
|
typedef enum
|
2015-02-15 22:54:10 +03:00
|
|
|
{
|
2018-02-13 13:00:56 +03:00
|
|
|
NLA_STATE_INITIAL,
|
|
|
|
NLA_STATE_NEGO_TOKEN,
|
|
|
|
NLA_STATE_PUB_KEY_AUTH,
|
2023-06-23 01:49:27 +03:00
|
|
|
NLA_STATE_EARLY_USER_AUTH,
|
2018-02-13 13:00:56 +03:00
|
|
|
NLA_STATE_AUTH_INFO,
|
|
|
|
NLA_STATE_POST_NEGO,
|
|
|
|
NLA_STATE_FINAL
|
2022-02-14 16:59:22 +03:00
|
|
|
} NLA_STATE;
|
2015-02-15 22:54:10 +03:00
|
|
|
|
2016-08-10 10:12:55 +03:00
|
|
|
FREERDP_LOCAL int nla_authenticate(rdpNla* nla);
|
2011-07-01 02:51:46 +04:00
|
|
|
|
2016-08-10 10:12:55 +03:00
|
|
|
FREERDP_LOCAL int nla_client_begin(rdpNla* nla);
|
|
|
|
FREERDP_LOCAL int nla_recv_pdu(rdpNla* nla, wStream* s);
|
2015-02-16 00:04:59 +03:00
|
|
|
|
2018-11-20 18:48:59 +03:00
|
|
|
FREERDP_LOCAL SEC_WINNT_AUTH_IDENTITY* nla_get_identity(rdpNla* nla);
|
|
|
|
|
|
|
|
FREERDP_LOCAL NLA_STATE nla_get_state(rdpNla* nla);
|
|
|
|
FREERDP_LOCAL BOOL nla_set_state(rdpNla* nla, NLA_STATE state);
|
2021-04-16 16:48:09 +03:00
|
|
|
FREERDP_LOCAL const char* nla_get_state_str(NLA_STATE state);
|
|
|
|
|
|
|
|
FREERDP_LOCAL DWORD nla_get_error(rdpNla* nla);
|
2023-02-24 19:34:14 +03:00
|
|
|
FREERDP_LOCAL UINT32 nla_get_sspi_error(rdpNla* nla);
|
2018-11-20 18:48:59 +03:00
|
|
|
|
2022-09-06 06:16:21 +03:00
|
|
|
FREERDP_LOCAL BOOL nla_set_service_principal(rdpNla* nla, const char* service,
|
|
|
|
const char* hostname);
|
2018-11-20 18:48:59 +03:00
|
|
|
|
2022-05-26 18:42:28 +03:00
|
|
|
FREERDP_LOCAL BOOL nla_set_sspi_module(rdpNla* nla, const char* sspiModule);
|
|
|
|
FREERDP_LOCAL BOOL nla_sspi_module_init(rdpNla* nla);
|
|
|
|
|
2019-03-08 12:10:43 +03:00
|
|
|
FREERDP_LOCAL BOOL nla_impersonate(rdpNla* nla);
|
|
|
|
FREERDP_LOCAL BOOL nla_revert_to_self(rdpNla* nla);
|
|
|
|
|
2016-08-10 10:12:55 +03:00
|
|
|
FREERDP_LOCAL void nla_free(rdpNla* nla);
|
2024-01-26 15:09:00 +03:00
|
|
|
|
|
|
|
WINPR_ATTR_MALLOC(nla_free, 1)
|
|
|
|
FREERDP_LOCAL rdpNla* nla_new(rdpContext* context, rdpTransport* transport);
|
|
|
|
|
2023-06-23 01:49:27 +03:00
|
|
|
FREERDP_LOCAL void nla_set_early_user_auth(rdpNla* nla, BOOL earlyUserAuth);
|
2011-07-01 02:51:46 +04:00
|
|
|
|
2017-06-06 15:01:41 +03:00
|
|
|
#endif /* FREERDP_LIB_CORE_NLA_H */
|