if ( cert || key ) {
if ( glite_gsplugin_init_context(&ctx) ) { perror("init context"); exit(1); }
- ctx->cert_filename = strdup(cert? : key);
- ctx->key_filename = strdup(key? : cert);
+ if (glite_gsplugin_set_credential(ctx, cert, key)) {
+ fprintf (stderr, "Failed to set credentials\n");
+ exit(1);
+ }
}
soap_init(&soap);
if ( soap_accept(&soap) < 0 ) {
fprintf(stderr, "soap_accept() failed!!!\n");
soap_print_fault(&soap, stderr);
-// fprintf(stderr, "plugin err: %s", glite_gsplugin_errdesc(&soap));
+ fprintf(stderr, "plugin err: %s\n", glite_gsplugin_errdesc(&soap));
continue;
}
extern void glite_gsplugin_set_udata(struct soap *, void *);
extern void glite_gsplugin_set_timeout(glite_gsplugin_Context, struct timeval const *);
+extern int glite_gsplugin_set_credential(glite_gsplugin_Context, const char *, const char *);
extern int glite_gsplugin(struct soap *, struct soap_plugin *, void *);
extern char *glite_gsplugin_errdesc(struct soap *);
-module.version=1.2.0
+module.version=1.3.0
module.age=0
else ctx->timeout = NULL;
}
+int
+glite_gsplugin_set_credential(glite_gsplugin_Context ctx,
+ const char *cert,
+ const char *key)
+{
+ edg_wll_GssStatus gss_code;
+ int ret;
+
+ ret = edg_wll_gss_acquire_cred_gsi(cert, key, &ctx->cred, NULL, &gss_code);
+ if (ret) {
+ /* XXX propagate error description */
+ return EINVAL;
+ }
+
+ ctx->cert_filename = cert;
+ ctx->key_filename = key;
+
+ return 0;
+}
int
glite_gsplugin(struct soap *soap, struct soap_plugin *p, void *arg)