summaryrefslogtreecommitdiff
path: root/source4/heimdal/lib/gssapi/spnego/cred_stubs.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/heimdal/lib/gssapi/spnego/cred_stubs.c')
-rw-r--r--source4/heimdal/lib/gssapi/spnego/cred_stubs.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/source4/heimdal/lib/gssapi/spnego/cred_stubs.c b/source4/heimdal/lib/gssapi/spnego/cred_stubs.c
index a3a984e22c..a10a10f1ef 100644
--- a/source4/heimdal/lib/gssapi/spnego/cred_stubs.c
+++ b/source4/heimdal/lib/gssapi/spnego/cred_stubs.c
@@ -354,3 +354,39 @@ _gss_spnego_set_cred_option (OM_uint32 *minor_status,
value);
}
+
+OM_uint32
+_gss_spnego_export_cred (OM_uint32 *minor_status,
+ gss_cred_id_t cred_handle,
+ gss_buffer_t value)
+{
+ gssspnego_cred cred = (gssspnego_cred)cred_handle;
+
+ return gss_export_cred(minor_status, cred->negotiated_cred_id, value);
+}
+
+OM_uint32
+_gss_spnego_import_cred (OM_uint32 *minor_status,
+ gss_buffer_t value,
+ gss_cred_id_t *cred_handle)
+{
+ gssspnego_cred cred;
+ OM_uint32 major;
+
+ *cred_handle = GSS_C_NO_CREDENTIAL;
+
+ cred = calloc(1, sizeof(*cred));
+ if (cred == NULL) {
+ *minor_status = ENOMEM;
+ return GSS_S_FAILURE;
+ }
+
+ major = gss_import_cred(minor_status, value, &cred->negotiated_cred_id);
+ if (major == GSS_S_COMPLETE)
+ *cred_handle = (gss_cred_id_t)cred;
+ else
+ free(cred);
+
+ return major;
+}
+