#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
+#include <assert.h>
#include "glite/jp/types.h"
#include "glite/jp/context.h"
static time_t cert_mtime;
char *server_cert, *server_key, *cadir;
-gss_cred_id_t mycred = GSS_C_NO_CREDENTIAL;
+edg_wll_GssCred mycred = NULL;
static char *mysubj;
static char *port = "8901";
FILE *fpid;
glite_jp_init_context(&ctx);
- globus_libc_gethostname(buf,sizeof buf);
+ edg_wll_gss_gethostname(buf,sizeof buf);
buf[999] = 0;
ctx->myURL = buf;
struct soap *soap = (struct soap *) data;
glite_gsplugin_Context plugin_ctx;
- gss_cred_id_t newcred = GSS_C_NO_CREDENTIAL;
+ edg_wll_GssCred newcred = NULL;
edg_wll_GssStatus gss_code;
- gss_name_t client_name = GSS_C_NO_NAME;
- gss_buffer_desc token = GSS_C_EMPTY_BUFFER;
- OM_uint32 maj_stat,min_stat;
+ edg_wll_GssPrincipal client = NULL;
edg_wll_GssConnection connection;
int ret = 0;
{
printf("[%d] reloading credentials\n",getpid()); /* XXX: log */
- gss_release_cred(&min_stat,&mycred);
+ edg_wll_gss_release_cred(&mycred, NULL);
mycred = newcred;
/* drop it too, it is recreated and reloads creds when necessary */
goto cleanup;
}
- maj_stat = gss_inquire_context(&min_stat,connection.context,
- &client_name, NULL, NULL, NULL, NULL, NULL, NULL);
-
- if (!GSS_ERROR(maj_stat))
- maj_stat = gss_display_name(&min_stat,client_name,&token,NULL);
+ ret = edg_wll_gss_get_client_conn(&connection, &client, NULL);
if (ctx->peer) free(ctx->peer);
- if (!GSS_ERROR(maj_stat)) {
- printf("[%d] client DN: %s\n",getpid(),(char *) token.value); /* XXX: log */
-
- ctx->peer = strdup(token.value);
- memset(&token, 0, sizeof(token));
- }
- else {
+ if (ret || client->flags & EDG_WLL_GSS_FLAG_ANON) {
printf("[%d] annonymous client\n",getpid());
ctx->peer = NULL;
}
+ else {
+ printf("[%d] client DN: %s\n",getpid(),client->name); /* XXX: log */
- if (client_name != GSS_C_NO_NAME) gss_release_name(&min_stat, &client_name);
- if (token.value) gss_release_buffer(&min_stat, &token);
+ ctx->peer = strdup(client->name);
+ edg_wll_gss_free_princ(client);
+ }
glite_gsplugin_init_context(&plugin_ctx);
glite_gsplugin_set_connection(plugin_ctx, &connection);