unixlib.h 3.08 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
/*
 * 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
 */

22 23
#include "wine/unixlib.h"

24 25
#define KERBEROS_MAX_BUF 12000

26 27
struct accept_context_params
{
28
    UINT64 credential;
29
    UINT64 context;
30 31
    BYTE *input_token;
    ULONG input_token_length;
32
    UINT64 *new_context;
33 34
    BYTE *output_token;
    ULONG *output_token_length;
35 36 37 38 39 40 41 42 43 44
    ULONG *context_attr;
    ULONG *expiry;
};

struct acquire_credentials_handle_params
{
    const char *principal;
    ULONG credential_use;
    const char *username;
    const char *password;
45
    UINT64 *credential;
46 47 48
    ULONG *expiry;
};

49 50 51 52 53
struct delete_context_params
{
    UINT64 context;
};

54 55 56 57 58
struct free_credentials_handle_params
{
    UINT64 credential;
};

59 60
struct initialize_context_params
{
61
    UINT64 credential;
62
    UINT64 context;
63 64
    const char *target_name;
    ULONG context_req;
65 66 67 68
    BYTE *input_token;
    ULONG input_token_length;
    BYTE *output_token;
    ULONG *output_token_length;
69
    UINT64 *new_context;
70 71 72 73 74 75
    ULONG *context_attr;
    ULONG *expiry;
};

struct make_signature_params
{
76
    UINT64 context;
77 78 79 80
    BYTE *data;
    ULONG data_length;
    BYTE *token;
    ULONG *token_length;
81 82 83 84
};

struct query_context_attributes_params
{
85
    UINT64 context;
86
    unsigned attr;
87 88 89 90 91 92 93 94 95 96 97
    void *buf;
};

struct query_ticket_cache_params
{
    KERB_QUERY_TKT_CACHE_RESPONSE *resp;
    ULONG *out_size;
};

struct seal_message_params
{
98
    UINT64 context;
99 100 101 102
    BYTE *data;
    ULONG data_length;
    BYTE *token;
    ULONG *token_length;
103
    unsigned qop;
104 105 106 107
};

struct unseal_message_params
{
108
    UINT64 context;
109 110 111 112
    BYTE *data;
    ULONG data_length;
    BYTE *token;
    ULONG token_length;
113 114 115 116 117
    ULONG *qop;
};

struct verify_signature_params
{
118
    UINT64 context;
119 120 121 122
    BYTE *data;
    ULONG data_length;
    BYTE *token;
    ULONG token_length;
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
    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,
};

extern unixlib_handle_t krb5_handle DECLSPEC_HIDDEN;

#define KRB5_CALL( func, params ) __wine_unix_call( krb5_handle, unix_ ## func, params )