1 #pragma ident	"%Z%%M%	%I%	%E% SMI"
2 
3 /*
4  * lib/krb5/ccache/ccfns.c
5  *
6  * Copyright 2000 by the Massachusetts Institute of Technology.
7  * All Rights Reserved.
8  *
9  * Export of this software from the United States of America may
10  *   require a specific license from the United States Government.
11  *   It is the responsibility of any person or organization contemplating
12  *   export to obtain such a license before exporting.
13  *
14  * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
15  * distribute this software and its documentation for any purpose and
16  * without fee is hereby granted, provided that the above copyright
17  * notice appear in all copies and that both that copyright notice and
18  * this permission notice appear in supporting documentation, and that
19  * the name of M.I.T. not be used in advertising or publicity pertaining
20  * to distribution of the software without specific, written prior
21  * permission.  Furthermore if you modify this software you must label
22  * your software as modified software and not distribute it in such a
23  * fashion that it might be confused with the original M.I.T. software.
24  * M.I.T. makes no representations about the suitability of
25  * this software for any purpose.  It is provided "as is" without express
26  * or implied warranty.
27  */
28 
29 /*
30  * Dispatch methods for credentials cache code.
31  */
32 
33 #include "k5-int.h"
34 
35 const char * KRB5_CALLCONV
36 krb5_cc_get_name (krb5_context context, krb5_ccache cache)
37 {
38     return cache->ops->get_name(context, cache);
39 }
40 
41 krb5_error_code KRB5_CALLCONV
42 krb5_cc_gen_new (krb5_context context, krb5_ccache *cache)
43 {
44     return (*cache)->ops->gen_new(context, cache);
45 }
46 
47 krb5_error_code KRB5_CALLCONV
48 krb5_cc_initialize(krb5_context context, krb5_ccache cache,
49 		   krb5_principal principal)
50 {
51     return cache->ops->init(context, cache, principal);
52 }
53 
54 krb5_error_code KRB5_CALLCONV
55 krb5_cc_destroy (krb5_context context, krb5_ccache cache)
56 {
57     return cache->ops->destroy(context, cache);
58 }
59 
60 krb5_error_code KRB5_CALLCONV
61 krb5_cc_close (krb5_context context, krb5_ccache cache)
62 {
63     return cache->ops->close(context, cache);
64 }
65 
66 krb5_error_code KRB5_CALLCONV
67 krb5_cc_store_cred (krb5_context context, krb5_ccache cache,
68 		    krb5_creds *creds)
69 {
70     return cache->ops->store(context, cache, creds);
71 }
72 
73 krb5_error_code KRB5_CALLCONV
74 krb5_cc_retrieve_cred (krb5_context context, krb5_ccache cache,
75 		       krb5_flags flags, krb5_creds *mcreds,
76 		       krb5_creds *creds)
77 {
78     return cache->ops->retrieve(context, cache, flags, mcreds, creds);
79 }
80 
81 krb5_error_code KRB5_CALLCONV
82 krb5_cc_get_principal (krb5_context context, krb5_ccache cache,
83 		       krb5_principal *principal)
84 {
85     return cache->ops->get_princ(context, cache, principal);
86 }
87 
88 krb5_error_code KRB5_CALLCONV
89 krb5_cc_start_seq_get (krb5_context context, krb5_ccache cache,
90 		       krb5_cc_cursor *cursor)
91 {
92     return cache->ops->get_first(context, cache, cursor);
93 }
94 
95 krb5_error_code KRB5_CALLCONV
96 krb5_cc_next_cred (krb5_context context, krb5_ccache cache,
97 		   krb5_cc_cursor *cursor, krb5_creds *creds)
98 {
99     return cache->ops->get_next(context, cache, cursor, creds);
100 }
101 
102 krb5_error_code KRB5_CALLCONV
103 krb5_cc_end_seq_get (krb5_context context, krb5_ccache cache,
104 		     krb5_cc_cursor *cursor)
105 {
106     return cache->ops->end_get(context, cache, cursor);
107 }
108 
109 krb5_error_code KRB5_CALLCONV
110 krb5_cc_remove_cred (krb5_context context, krb5_ccache cache, krb5_flags flags,
111 		     krb5_creds *creds)
112 {
113     return cache->ops->remove_cred(context, cache, flags, creds);
114 }
115 
116 krb5_error_code KRB5_CALLCONV
117 krb5_cc_set_flags (krb5_context context, krb5_ccache cache, krb5_flags flags)
118 {
119     return cache->ops->set_flags(context, cache, flags);
120 }
121 
122 const char * KRB5_CALLCONV
123 krb5_cc_get_type (krb5_context context, krb5_ccache cache)
124 {
125     return cache->ops->prefix;
126 }
127