6 #ifndef __MYPROXY_PROTOCOL_H
7 #define __MYPROXY_PROTOCOL_H
15 MYPROXY_DESTROY_PROXY,
16 MYPROXY_CHANGE_CRED_PASSPHRASE,
18 MYPROXY_RETRIEVE_CERT,
19 MYPROXY_GET_TRUSTROOTS
20 } myproxy_proto_request_type_t;
26 MYPROXY_ERROR_RESPONSE,
27 MYPROXY_AUTHORIZATION_RESPONSE
28 } myproxy_proto_response_type_t;
31 typedef struct myproxy_socket_attrs_s
36 struct _gsi_socket *gsi_socket;
37 } myproxy_socket_attrs_t;
41 #define MATCH_CN_ONLY 0
47 char passphrase[MAX_PASS_LEN+1];
48 char new_passphrase[MAX_PASS_LEN+1];
49 myproxy_proto_request_type_t command_type;
57 char *trusted_retrievers;
58 int want_trusted_certs;
68 myproxy_proto_response_type_t response_type;
69 authorization_data_t **authorization_data;
71 myproxy_creds_t *info_creds;
72 myproxy_certs_t *trusted_certs;
84 int myproxy_init_client(myproxy_socket_attrs_t *attrs);
93 int myproxy_authenticate_init(myproxy_socket_attrs_t *attr,
94 const char *proxyfile);
103 int myproxy_authenticate_accept(myproxy_socket_attrs_t *attr,
104 char *client_name,
const int namelen);
113 int myproxy_authenticate_accept_fqans(myproxy_socket_attrs_t *attr,
114 char *client_name,
const int namelen,
125 int myproxy_serialize_request(
const myproxy_request_t *request,
126 char *data,
const int datalen);
136 int myproxy_serialize_request_ex(
const myproxy_request_t *request,
147 int myproxy_deserialize_request(
const char *data,
const int datalen,
148 myproxy_request_t *request);
160 myproxy_serialize_response(
const myproxy_response_t *response,
161 char *data,
const int datalen);
173 myproxy_serialize_response_ex(
const myproxy_response_t *response,
184 int myproxy_deserialize_response(myproxy_response_t *response,
185 const char *data,
const int datalen);
194 int myproxy_send(myproxy_socket_attrs_t *attrs,
195 const char *data,
const int datalen);
206 int myproxy_recv(myproxy_socket_attrs_t *attrs,
207 char *data,
const int datalen);
218 int myproxy_recv_ex(myproxy_socket_attrs_t *attrs,
char **data);
228 int myproxy_init_delegation(myproxy_socket_attrs_t *attrs,
229 const char *delegfile,
230 const int lifetime_seconds,
241 int myproxy_accept_delegation(myproxy_socket_attrs_t *attrs,
char *delegfile,
242 const int delegfile_len,
char *passphrase);
253 int myproxy_accept_delegation_ex(myproxy_socket_attrs_t *attrs,
255 int *credential_len,
char *passphrase);
269 myproxy_request_cert(myproxy_socket_attrs_t *attrs,
char *certreq,
270 char **credentials,
int *credential_len);
280 myproxy_accept_credentials(myproxy_socket_attrs_t *attrs,
290 myproxy_init_credentials(myproxy_socket_attrs_t *attrs,
291 const char *delegfile);
294 myproxy_get_credentials(myproxy_socket_attrs_t *attrs,
295 const char *delegfile);
302 void myproxy_free(myproxy_socket_attrs_t *attrs, myproxy_request_t *request,
303 myproxy_response_t *response);
312 int myproxy_recv_response(myproxy_socket_attrs_t *attrs,
313 myproxy_response_t *response);
322 int myproxy_handle_response(
const char *response_buffer,
324 myproxy_response_t *response);
334 int myproxy_recv_response_ex(myproxy_socket_attrs_t *attrs,
335 myproxy_response_t *response,
336 myproxy_request_t *client_request);
345 int myproxy_handle_authorization(myproxy_socket_attrs_t *attrs,
346 myproxy_response_t *server_response,
347 myproxy_request_t *client_request);
356 int myproxy_bootstrap_trust(myproxy_socket_attrs_t *attrs);
367 int myproxy_bootstrap_client(myproxy_socket_attrs_t *attrs,
368 int bootstrap_if_no_cert_dir,
369 int bootstrap_even_if_cert_dir_exists);
378 int myproxy_request_add_voname(myproxy_request_t *client_request,
388 int myproxy_request_add_vomses(myproxy_request_t *client_request,