summaryrefslogtreecommitdiffstats
path: root/proxy/src/gp_conv.h
blob: 3a8f9527d0e2bd1ae7ff823f4ab2f5864dcf198e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*
   GSS-PROXY

   Copyright (C) 2011 Red Hat, Inc.
   Copyright (C) 2011 Simo Sorce <simo.sorce@redhat.com>

   Permission is hereby granted, free of charge, to any person obtaining a
   copy of this software and associated documentation files (the "Software"),
   to deal in the Software without restriction, including without limitation
   the rights to use, copy, modify, merge, publish, distribute, sublicense,
   and/or sell copies of the Software, and to permit persons to whom the
   Software is furnished to do so, subject to the following conditions:

   The above copyright notice and this permission notice shall be included in
   all copies or substantial portions of the Software.

   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
   THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
   DEALINGS IN THE SOFTWARE.
*/

#ifndef _GSS_CONV_H_
#define _GSS_CONV_H_

#include <gssapi/gssapi.h>
#include "rpcgen/gss_proxy.h"

void *gp_memdup(void *in, size_t len);
int gp_conv_octet_string(size_t length, void *value, octet_string *out);
int gp_conv_octet_string_alloc(size_t length, void *value,
                               octet_string **out);

void gp_conv_gssx_to_oid(gssx_OID *in, gss_OID out);
int gp_conv_gssx_to_oid_alloc(gssx_OID *in, gss_OID *out);
int gp_conv_oid_to_gssx(gss_OID in, gssx_OID *out);
int gp_conv_oid_to_gssx_alloc(gss_OID in, gssx_OID **out);

void gp_conv_gssx_to_buffer(gssx_buffer *in, gss_buffer_t out);
int gp_conv_gssx_to_buffer_alloc(gssx_buffer *in, gss_buffer_t *out);
int gp_copy_gssx_to_buffer(gssx_buffer *in, gss_buffer_t out);
int gp_conv_buffer_to_gssx(gss_buffer_t in, gssx_buffer *out);
int gp_conv_buffer_to_gssx_alloc(gss_buffer_t in, gssx_buffer **out);

void gp_conv_gssx_to_cb(gssx_cb *in, gss_channel_bindings_t out);
int gp_conv_cb_to_gssx(gss_channel_bindings_t in, gssx_cb *out);
int gp_conv_cb_to_gssx_alloc(gss_channel_bindings_t in, gssx_cb **out);

gssx_cred_usage gp_conv_cred_usage_to_gssx(gss_cred_usage_t in);
gss_cred_usage_t gp_conv_gssx_to_cred_usage(gssx_cred_usage in);

int gp_conv_err_to_gssx_string(uint32_t status, int type, gss_OID oid,
                               utf8string *ret_str);

int gp_conv_name_to_gssx(gss_name_t in, gssx_name *out);
int gp_conv_name_to_gssx_alloc(gss_name_t in, gssx_name **out);
int gp_conv_gssx_to_name(gssx_name *in, gss_name_t *out);

int gp_conv_ctx_id_to_gssx(gss_ctx_id_t *in, gssx_ctx *out);
int gp_conv_gssx_to_ctx_id(gssx_ctx *in, gss_ctx_id_t *out);

int gp_conv_status_to_gssx(struct gssx_call_ctx *call_ctx,
                           uint32_t ret_maj, uint32_t ret_min,
                           gss_OID mech, struct gssx_status *status);

int gp_copy_utf8string(utf8string *in, utf8string *out);
int gp_copy_gssx_status_alloc(gssx_status *in, gssx_status **out);

int gp_conv_gssx_to_oid_set(gssx_OID_set *in, gss_OID_set *out);
int gp_conv_oid_set_to_gssx(gss_OID_set in, gssx_OID_set *out);

int gp_copy_gssx_name(gssx_name *in, gssx_name *out);
int gp_copy_gssx_name_alloc(gssx_name *in, gssx_name **out);

#endif /* _GSS_CONV_H_ */