2021-04-20 13:56:48 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2017 Dmitry Timoshkov
|
|
|
|
* Copyright 2017 George Popoff
|
|
|
|
* Copyright 2008 Robert Shearman for CodeWeavers
|
|
|
|
* Copyright 2017,2021 Hans Leidekker for CodeWeavers
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2021-11-04 19:50:53 +00:00
|
|
|
#include "wine/unixlib.h"
|
|
|
|
|
2021-04-21 07:47:27 +00:00
|
|
|
#define KERBEROS_MAX_BUF 12000
|
|
|
|
|
2021-11-04 19:50:53 +00:00
|
|
|
struct accept_context_params
|
|
|
|
{
|
2022-05-27 21:51:48 +00:00
|
|
|
UINT64 credential;
|
2022-05-28 07:43:12 +00:00
|
|
|
UINT64 context;
|
2022-05-28 18:15:10 +00:00
|
|
|
BYTE *input_token;
|
|
|
|
ULONG input_token_length;
|
2022-05-28 07:43:12 +00:00
|
|
|
UINT64 *new_context;
|
2022-05-28 18:15:10 +00:00
|
|
|
BYTE *output_token;
|
|
|
|
ULONG *output_token_length;
|
2021-11-04 19:50:53 +00:00
|
|
|
ULONG *context_attr;
|
|
|
|
ULONG *expiry;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct acquire_credentials_handle_params
|
|
|
|
{
|
|
|
|
const char *principal;
|
|
|
|
ULONG credential_use;
|
|
|
|
const char *username;
|
|
|
|
const char *password;
|
2022-05-27 21:51:48 +00:00
|
|
|
UINT64 *credential;
|
2021-11-04 19:50:53 +00:00
|
|
|
ULONG *expiry;
|
|
|
|
};
|
|
|
|
|
2022-05-28 07:43:12 +00:00
|
|
|
struct delete_context_params
|
|
|
|
{
|
|
|
|
UINT64 context;
|
|
|
|
};
|
|
|
|
|
2022-05-27 21:51:48 +00:00
|
|
|
struct free_credentials_handle_params
|
|
|
|
{
|
|
|
|
UINT64 credential;
|
|
|
|
};
|
|
|
|
|
2021-11-04 19:50:53 +00:00
|
|
|
struct initialize_context_params
|
|
|
|
{
|
2022-05-27 21:51:48 +00:00
|
|
|
UINT64 credential;
|
2022-05-28 07:43:12 +00:00
|
|
|
UINT64 context;
|
2021-11-04 19:50:53 +00:00
|
|
|
const char *target_name;
|
|
|
|
ULONG context_req;
|
2022-05-28 18:23:22 +00:00
|
|
|
BYTE *input_token;
|
|
|
|
ULONG input_token_length;
|
|
|
|
BYTE *output_token;
|
|
|
|
ULONG *output_token_length;
|
2022-05-28 07:43:12 +00:00
|
|
|
UINT64 *new_context;
|
2021-11-04 19:50:53 +00:00
|
|
|
ULONG *context_attr;
|
|
|
|
ULONG *expiry;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct make_signature_params
|
|
|
|
{
|
2022-05-28 07:43:12 +00:00
|
|
|
UINT64 context;
|
2022-05-28 10:39:55 +00:00
|
|
|
BYTE *data;
|
|
|
|
ULONG data_length;
|
|
|
|
BYTE *token;
|
|
|
|
ULONG *token_length;
|
2021-11-04 19:50:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct query_context_attributes_params
|
|
|
|
{
|
2022-05-28 07:43:12 +00:00
|
|
|
UINT64 context;
|
2022-02-01 13:06:21 +00:00
|
|
|
unsigned attr;
|
2021-11-04 19:50:53 +00:00
|
|
|
void *buf;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct query_ticket_cache_params
|
|
|
|
{
|
|
|
|
KERB_QUERY_TKT_CACHE_RESPONSE *resp;
|
|
|
|
ULONG *out_size;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct seal_message_params
|
|
|
|
{
|
2022-05-28 07:43:12 +00:00
|
|
|
UINT64 context;
|
2022-05-28 11:54:22 +00:00
|
|
|
BYTE *data;
|
|
|
|
ULONG data_length;
|
|
|
|
BYTE *token;
|
|
|
|
ULONG *token_length;
|
2022-02-01 13:06:21 +00:00
|
|
|
unsigned qop;
|
2021-11-04 19:50:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct unseal_message_params
|
|
|
|
{
|
2022-05-28 07:43:12 +00:00
|
|
|
UINT64 context;
|
2022-05-28 12:04:28 +00:00
|
|
|
BYTE *data;
|
|
|
|
ULONG data_length;
|
|
|
|
BYTE *token;
|
|
|
|
ULONG token_length;
|
2021-11-04 19:50:53 +00:00
|
|
|
ULONG *qop;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct verify_signature_params
|
|
|
|
{
|
2022-05-28 07:43:12 +00:00
|
|
|
UINT64 context;
|
2022-05-28 11:17:46 +00:00
|
|
|
BYTE *data;
|
|
|
|
ULONG data_length;
|
|
|
|
BYTE *token;
|
|
|
|
ULONG token_length;
|
2021-11-04 19:50:53 +00:00
|
|
|
ULONG *qop;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum unix_funcs
|
|
|
|
{
|
|
|
|
unix_process_attach,
|
|
|
|
unix_accept_context,
|
|
|
|
unix_acquire_credentials_handle,
|
|
|
|
unix_delete_context,
|
|
|
|
unix_free_credentials_handle,
|
|
|
|
unix_initialize_context,
|
|
|
|
unix_make_signature,
|
|
|
|
unix_query_context_attributes,
|
|
|
|
unix_query_ticket_cache,
|
|
|
|
unix_seal_message,
|
|
|
|
unix_unseal_message,
|
|
|
|
unix_verify_signature,
|
|
|
|
};
|
|
|
|
|
2022-11-25 09:12:17 +00:00
|
|
|
#define KRB5_CALL( func, params ) WINE_UNIX_CALL( unix_ ## func, params )
|