From bbc4660ed9fcb3888846e26b7c74b5b834343e5d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Kou=C5=99il?= Date: Mon, 6 Aug 2007 15:01:03 +0000 Subject: [PATCH] Switched to the updated glite_gss API to remove dependency on Globus --- .../interface/glite_gsplugin-int.h | 2 +- .../interface/glite_gsplugin.h | 2 +- org.glite.security.gsoap-plugin/src/glite_gsplugin.c | 20 +++++++++----------- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/org.glite.security.gsoap-plugin/interface/glite_gsplugin-int.h b/org.glite.security.gsoap-plugin/interface/glite_gsplugin-int.h index 6a48cde..4fa7234 100644 --- a/org.glite.security.gsoap-plugin/interface/glite_gsplugin-int.h +++ b/org.glite.security.gsoap-plugin/interface/glite_gsplugin-int.h @@ -13,7 +13,7 @@ struct _glite_gsplugin_ctx { char *error_msg; edg_wll_GssConnection *connection; - gss_cred_id_t cred; + edg_wll_GssCred cred; int internal_connection; int internal_credentials; diff --git a/org.glite.security.gsoap-plugin/interface/glite_gsplugin.h b/org.glite.security.gsoap-plugin/interface/glite_gsplugin.h index dce770a..ac501b1 100644 --- a/org.glite.security.gsoap-plugin/interface/glite_gsplugin.h +++ b/org.glite.security.gsoap-plugin/interface/glite_gsplugin.h @@ -20,7 +20,7 @@ extern void *glite_gsplugin_get_udata(struct soap *); extern void glite_gsplugin_set_udata(struct soap *, void *); extern void glite_gsplugin_set_timeout(glite_gsplugin_Context, struct timeval const *); -extern void glite_gsplugin_set_credential(glite_gsplugin_Context, gss_cred_id_t); +extern void glite_gsplugin_set_credential(glite_gsplugin_Context, edg_wll_GssCred); extern int glite_gsplugin_set_connection(glite_gsplugin_Context, edg_wll_GssConnection *); extern int glite_gsplugin(struct soap *, struct soap_plugin *, void *); diff --git a/org.glite.security.gsoap-plugin/src/glite_gsplugin.c b/org.glite.security.gsoap-plugin/src/glite_gsplugin.c index 5112ca8..59acc09 100644 --- a/org.glite.security.gsoap-plugin/src/glite_gsplugin.c +++ b/org.glite.security.gsoap-plugin/src/glite_gsplugin.c @@ -38,7 +38,7 @@ glite_gsplugin_init_context(glite_gsplugin_Context *ctx) if (!out) return ENOMEM; memset(out, 0, sizeof(*out)); - out->cred = GSS_C_NO_CREDENTIAL; + out->cred = NULL; /* XXX: some troubles with glite_gss and blocking calls! out->timeout.tv_sec = 10000; @@ -53,15 +53,13 @@ glite_gsplugin_init_context(glite_gsplugin_Context *ctx) int glite_gsplugin_free_context(glite_gsplugin_Context ctx) { - OM_uint32 ms; - if (ctx == NULL) return 0; - if ( ctx->internal_credentials && ctx->cred != GSS_C_NO_CREDENTIAL ) - gss_release_cred(&ms, &ctx->cred); + if ( ctx->internal_credentials && ctx->cred != NULL ) + edg_wll_gss_release_cred(&ctx->cred, NULL); if ( ctx->connection ) { - if ( ctx->connection->context != GSS_C_NO_CONTEXT ) + if ( ctx->connection->context != NULL ) edg_wll_gss_close(ctx->connection, NULL); free(ctx->connection); } @@ -131,7 +129,7 @@ glite_gsplugin_set_credential(glite_gsplugin_Context ctx, void glite_gsplugin_set_credential(glite_gsplugin_Context ctx, - gss_cred_id_t cred) + edg_wll_GssCred cred) { ctx->cred = cred; ctx->internal_credentials = 0; @@ -143,7 +141,7 @@ glite_gsplugin_set_connection(glite_gsplugin_Context ctx, edg_wll_GssConnection int ret = SOAP_OK; if ( ctx->connection ) { - if ( ctx->internal_connection && ctx->connection->context != GSS_C_NO_CONTEXT) { + if ( ctx->internal_connection && ctx->connection->context != NULL) { pdprintf(("GSLITE_GSPLUGIN: closing gss connection\n")); ret = edg_wll_gss_close(ctx->connection, ctx->timeout); } @@ -270,7 +268,7 @@ glite_gsplugin_connect( ctx = ((int_plugin_data_t *)soap_lookup_plugin(soap, plugin_id))->ctx; - if ( ctx->cred == GSS_C_NO_CREDENTIAL ) { + if ( ctx->cred == NULL ) { pdprintf(("GSLITE_GSPLUGIN: loading default credentials\n")); ret = edg_wll_gss_acquire_cred_gsi(NULL, NULL, &ctx->cred, NULL, &gss_stat); @@ -364,7 +362,7 @@ glite_gsplugin_recv(struct soap *soap, char *buf, size_t bufsz) ctx = ((int_plugin_data_t *)soap_lookup_plugin(soap, plugin_id))->ctx; if ( ctx->error_msg ) { free(ctx->error_msg); ctx->error_msg = NULL; } - if ( ctx->connection->context == GSS_C_NO_CONTEXT ) { + if ( ctx->connection->context == NULL ) { soap->errnum = ENOTCONN; /* XXX: glite_gsplugin_send() returns SOAP_EOF on errors */ @@ -420,7 +418,7 @@ glite_gsplugin_send(struct soap *soap, const char *buf, size_t bufsz) * i.e. ctx->connection != NULL */ if ( ctx->error_msg ) { free(ctx->error_msg); ctx->error_msg = NULL; } - if ( ctx->connection->context == GSS_C_NO_CONTEXT ) { + if ( ctx->connection->context == NULL ) { soap->errnum = ENOTCONN; return SOAP_EOF; } -- 1.8.2.3