myproxy_request_t *client_request;
myproxy_response_t *server_response;
char *renewed_proxy;
- /* XXX */
- int voms_exts = 1;
+ int voms_exts;
socket_attrs = malloc(sizeof(*socket_attrs));
memset(socket_attrs, 0, sizeof(*socket_attrs));
if (ret)
goto end;
+ voms_exts = check_voms_attrs(ctx, current_proxy);
+
client_request->proxy_lifetime = 60 * 60 * DGPR_RETRIEVE_DEFAULT_HOURS;
server = (myproxy_server) ? myproxy_server : socket_attrs->pshost;
ret = create_voms_command(ctx, vd, voms_cert, &command);
+ /* XXX the lifetime should be taken from the older proxy */
+ ret = VOMS_SetLifetime(60*60*12, vd, &voms_error);
+
/* XXX iterate over all servers on the list on errors */
ret = VOMS_ContactRaw(voms_contacts[0]->host, voms_contacts[0]->port,
voms_contacts[0]->contact, command,
return renew_voms_certs(ctx, cur_file, renewed_file, new_file);
}
+int
+check_voms_attrs(glite_renewal_core_context ctx, const char *proxy)
+{
+ int ret, voms_err, present;
+ X509 *cert = NULL;
+ STACK_OF(X509) *chain = NULL;
+ struct vomsdata *vd = NULL;
+
+ ret = load_proxy(ctx, proxy, &cert, NULL, &chain, NULL);
+ if (ret)
+ return 0;
+
+ vd = VOMS_Init(NULL, NULL);
+ if (vd == NULL) {
+ present = 0;
+ goto end;
+ }
+
+ ret = VOMS_Retrieve(cert, chain, RECURSE_CHAIN, vd, &voms_err);
+ if (ret == 0) {
+ present = 0;
+ goto end;
+ }
+
+ present = 1;
+
+end:
+ if (cert)
+ X509_free(cert);
+ if (chain)
+ sk_X509_pop_free(chain, X509_free);
+ if (vd)
+ VOMS_Destroy(vd);
+
+ return present;
+}
+
#if 0
int
main(int argc, char *argv[])