Add.
[shishi.git] / gss / cred.c
blob84e502f65add61d0872987ddfb464d24b95f03da
1 /* cred.c Implementation of GSS-API Credential Management functions.
2 * Copyright (C) 2003 Simon Josefsson
4 * This file is part of Shishi.
6 * Shishi is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * Shishi is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with Shishi; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include "internal.h"
24 OM_uint32
25 gss_acquire_cred (OM_uint32 * minor_status,
26 const gss_name_t desired_name,
27 OM_uint32 time_req,
28 const gss_OID_set desired_mechs,
29 gss_cred_usage_t cred_usage,
30 gss_cred_id_t * output_cred_handle,
31 gss_OID_set * actual_mechs, OM_uint32 * time_rec)
33 return GSS_S_FAILURE;
36 OM_uint32
37 gss_add_cred (OM_uint32 * minor_status,
38 const gss_cred_id_t input_cred_handle,
39 const gss_name_t desired_name,
40 const gss_OID desired_mech,
41 gss_cred_usage_t cred_usage,
42 OM_uint32 initiator_time_req,
43 OM_uint32 acceptor_time_req,
44 gss_cred_id_t * output_cred_handle,
45 gss_OID_set * actual_mechs,
46 OM_uint32 * initiator_time_rec, OM_uint32 * acceptor_time_rec)
48 return GSS_S_FAILURE;
51 OM_uint32
52 gss_inquire_cred (OM_uint32 * minor_status,
53 const gss_cred_id_t cred_handle,
54 gss_name_t * name,
55 OM_uint32 * lifetime,
56 gss_cred_usage_t * cred_usage, gss_OID_set * mechanisms)
58 return GSS_S_FAILURE;
61 OM_uint32
62 gss_inquire_cred_by_mech (OM_uint32 * minor_status,
63 const gss_cred_id_t cred_handle,
64 const gss_OID mech_type,
65 gss_name_t * name,
66 OM_uint32 * initiator_lifetime,
67 OM_uint32 * acceptor_lifetime,
68 gss_cred_usage_t * cred_usage)
70 return GSS_S_FAILURE;
73 /**
74 * gss_release_cred:
75 * @minor_status: Mechanism specific status code.
76 * @cred_handle: Optional opaque handle identifying credential to be
77 * released. If GSS_C_NO_CREDENTIAL is supplied, the routine will
78 * complete successfully, but will do nothing.
80 * Informs GSS-API that the specified credential handle is no longer
81 * required by the application, and frees associated resources.
82 * Implementations are encouraged to set the cred_handle to
83 * GSS_C_NO_CREDENTIAL on successful completion of this call.
85 * Return value: Returns GSS_S_COMPLETE for successful completion, and
86 * GSS_S_NO_CRED for credentials could not be accessed.
87 **/
88 OM_uint32
89 gss_release_cred (OM_uint32 * minor_status, gss_cred_id_t * cred_handle)
91 if (cred_handle && *cred_handle)
92 free (*cred_handle);
94 *cred_handle = GSS_C_NO_CREDENTIAL;
96 if (minor_status)
97 minor_status = 0;
98 return GSS_S_COMPLETE;