Debian Codegraph @

PROTOCOL

raw
1 MyProxyv2 protocol
2
3
4 Section A
5 ------- -
6
7 Basic Tenants:
8
9 1) All communications between MyProxy process will be authenticated
10 via GSSAPI. The MyProxyServer will always be the accepting side and
11 will have an identity of "host/<fully qualified host name>" or
12 "myproxy/<fully qualified host name>".
13
14 2) The transport protocol will be SSL (Kerberos support is planned)
15 Each message will be integrity protected and encrypted via gss_wrap().
16
17 3) Messages will consist of either one or more NULL-terminated ASCII text
18 strings or a single chunk of arbitrary data whose meaning is determined
19 by the context of the current state of the protocol.
20
21 4) All communications will be over TCP.
22
23 5) By default the MyProxy server will listen on port 7512 unless
24 otherwise specified. [NOTE - the port number choice is arbitrary.]
25
26 6) MyProxy server always replies to the requests with either a OK,
27 ERROR, or AUTHORIZATION message:
28
29 An OK message will simply contain:
30
31 VERSION=MYPROXYv2
32 RESPONSE=0
33
34 An ERROR message will contain:
35
36 VERSION=MYPROXYv2
37 RESPONSE=1
38 ERROR=<error text>
39 ERROR=<error text>
40 ...
41
42 There may be one or more lines of error text, with the intent that the
43 client may concatenate them together (separated with carriage returns).
44
45 The line separator is the LF character: '\n'.
46
47 After sending an ERROR response myproxy-server will close the
48 connection and no more data should be sent in either direction.
49
50 If the client sends an empty passphrase, the server can also reply
51 with a MYPROXY_AUTHORIZATION_RESPONSE message:
52
53 VERSION=MYPROXYv2
54 RESPONSE=2
55 AUTHORIZATION_DATA=<method id>:<method data>
56 ...
57
58 There may be more then one line of authorization data. The purpose
59 of this message is to provide the client with available
60 authorization methods along with data needed to use the
61 methods. The client will choose one method, create a response
62 according to server's challenge and send it back to the server.
63 The first four bytes of the response convey a method
64 identifier (see myproxy_authorization.[ch] for supported methods).
65 Currently, the identifier is specified in the first byte only.
66 The remaining three bytes are ignored.
67 The contents of the remaining part of the response depends on the
68 particular authorization method and is not specified here.
69
70 The server will verify the response, check authorization data,
71 check authorization policy and reply with either an OK or an ERROR
72 message. Then the protocol will continue.
73
74 Currently there are two supported methods: the original password
75 based and a new X.509 certificate based. When using the later one,
76 the server will generate a random 32 bytes long challenge, encode
77 it into an ASCII string and send to the client as <method
78 data>. The client will sign the challenge with its private key and
79 send the result back along with the whole certificate chain.
80 Format of the client's response in this case is following:
81 - first four bytes state length of the signature
82 - signature itself
83 - four bytes state number of certificates sent
84 - certificates in the ASN.1 encoding.
85
86 Since the original client never sends an empty password,
87 compatibility is retained (the MYPROXY_AUTHORIZATION_RESPONSE
88 message is sent iff the server receives an empty password).
89
90 7) The delegated credentials are sent over the wire as a chain of
91 certificates in a _single_ message.
92
93 The message contains: A byte that indicates the number of certificates
94 in the message followed by the certificates of the certificate chain.
95 Each certificate is encoded in the stardard X.509 v3 ASN.1 format.
96
97 The first certificate sent is the newly delegated certificate,
98 followed by the first certificate of the certificate chain,
99 and the rest of the chain. The last certificate sent should be the user
100 certificate signed by the CA. The CA certificate does not have to be
101 included.
102
103 8) For protocol extensibility, clients and servers are expected to
104 ignore lines in messages that they don't understand.
105
106 ====
107
108 Section B
109 ------- -
110
111 MyProxyInit <-> MyProxyServer protocol
112
113 The following illustrates a MyProxyInit process connecting to a
114 MyProxyServer process and storing a proxy for later retrieval.
115
116 1) MyProxyInit will make a connection to the MyProxyServer at the
117 host and port as specified by its configuration or the user.
118
119 2) MyProxyInit will initiate the GSSAPI context setup loop, with
120 MyProxyServer accepting. See Section A.1.
121
122 3) MyProxyInit will then send a message to MyProxyServer containing
123 the following strings:
124
125 VERSION=MYPROXYv2
126 COMMAND=1
127 USERNAME=<username>
128 PASSPHRASE=<pass phrase>
129 LIFETIME=<lifetime>
130
131 and optional strings
132
133 RETRIEVER=<retriever_dn>
134 RENEWER=<renewer_dn>
135 CRED_NAME=<credential name>
136 CRED_DESC=<credential description>
137
138 The intent of the VERSION string is to allow the server to know
139 if it is dealing with an outdated or newer client.
140
141 <username> and <pass phrase> are the strings supplied by the
142 user to be used for retrieval by the portal. <lifetime> is the
143 ASCII representation of the lifetime of the proxy to be delegated
144 to the portal, in seconds. <retriever_dn> and <renewer_dn> are strings
145 specifying the retriever and renewer policy regular expressions.
146 <credential name> assigns a name to the credential, allowing
147 multiple credentials to be stored for a given username.
148 <credential description> can provide additional descriptive text
149 to be displayed in MyProxyInfo requests, for example.
150
151 4) MyProxyServer will then respond with either a OK or an ERROR message.
152 See Section A.6 for details.
153
154 5) Next, the server will perform delegation with the client.
155 The MyProxyServer will generate a public/private key pair and send
156 the public key to the MyProxyInit client as a certificate request.
157 MyProxyInit client will sign the request with its proxy private key
158 and send the new certificate and the entire certificate chain back
159 to the server.
160 See section A.8 for details of the certificate chain message.
161
162 6) MyProxyServer will read the individual certificates, chain them back
163 up together into a new delegated credentials and store them. The server
164 also stores the retriever and renewer DN strings if they are specified.
165
166 7) MyProxyServer will then respond with either a OK message if it
167 successfully stored the proxy or an ERROR message if an error occurred.
168 For example, an error might occur when the stored proxy already exists
169 for the same username but belongs to another user.
170 For the reply message details see section A.6.
171
172 8) At this point, both sides should close the connection.
173
174 ====
175
176 Section C
177 ------- -
178
179 MyProxyGet <-> MyProxyServer protocol
180
181 The following illustrates a MyProxyGet process connecting to
182 a MyProxyServer process and retrieving a proxy for use.
183
184 1) MyProxyGet makes a connection to the MyProxyServer as
185 indicated by its configuration or arguments.
186
187 2) MyProxyGet will initiate the GSSAPI context setup loop, with
188 MyProxyServer accepting. See Section A.1.
189
190 3) MyProxyGet will then send a message to MyProxyServer containing
191 the following strings:
192
193 VERSION=MYPROXYv2
194 COMMAND=0
195 USERNAME=<username>
196 PASSPHRASE=<pass phrase>
197 LIFETIME=<requested lifetime>
198
199 The message can also contain an optional string :
200 CRED_NAME=<credential name>
201
202 The intent of the VERSION string is to allow the server to know
203 if it is dealing with an outdated or newer client.
204
205 <username> and <pass phrase> are the strings supplied by the
206 user to the portal to be used for retrieval by the portal.
207
208 4) MyProxyServer will then respond with either a OK, ERROR, or
209 AUTHORIZATION message. See Section A.6 for details.
210
211 5) Next, the server will delegate the user credential to the client.
212 The MyProxyGet will generate a public/private key pair and send
213 the public key to the MyProxyServer as a certificate request.
214 MyProxyServer will sign the request with the private key of the stored
215 user credential and send it as a new certificate back to the client
216 along with the rest of the certificate chain of the stored credential.
217 See section A.7 for details of the certificate chain message.
218 The MyProxyGet will then chain up the certificates together and create
219 the new user credentials.
220
221 6) MyProxyServer will then respond with either a OK message if it
222 successfully completed sending the certificates or an ERROR message
223 if an error occurred. See section A.6 for details.
224
225 7) At this point, both sides should close the connection.
226
227 ====
228
229 Section D
230 ------- -
231
232 MyProxyDestroy <-> MyProxyServer protocol
233
234 The following illustrates a MyProxyDestroy process connecting to
235 a MyProxyServer process and removing a proxy.
236
237 1) MyProxyDestroy makes a connection to the MyProxyServer as
238 indicated by its configuration or arguments.
239
240 2) MyProxyDestroy will initiate the GSSAPI context setup loop, with
241 MyProxyServer accepting. See section A.1.
242
243 3) MyProxyDestroy will then send a message to MyProxyServer containing
244 the following strings:
245
246 VERSION=MYPROXYv2
247 COMMAND=3
248 USERNAME=<username>
249 PASSPHRASE=<pass phrase>
250
251 The message can also contain an optional string :
252 CRED_NAME=<credential name>
253
254 The intent of the VERSION string is to allow the server to know
255 if it is dealing with an outdated or newer client.
256
257 <username> and <pass phrase> are the strings supplied by the
258 user to the portal used for retrieval of a proxy from the portal.
259
260 4) MyProxyServer will then respond with either a OK or an ERROR message.
261 See section A.6 for details.
262
263 5) At this point, both sides should close the connection.
264
265 ====
266
267
268 Section E
269 ------- -
270
271 MyProxyInfo <->MyProxyServer protocol
272
273 The following illustrates a MyProxyInfo process connecting to a
274 MyProxyServer process and queries information about a proxy.
275
276 1) MyProxyInfo makes a connection to the MyProxyServer as indicated by its
277 configuration or arguments.
278
279 2) MyProxyInfo will initiate the GSSAPI context setup loop, with
280 MyProxyServer accepting. See section A.1.
281
282 3) MyProxyInfo will then send a message to MyProxyServer containing the
283 following strings:
284
285 VERSION=MYPROXYv2
286 COMMAND=2
287 USERNAME=<username>
288 PASSPHRASE=<pass phrase>
289
290 The intent of the VERSION string is to allow the server to know if it is
291 dealing with an outdated or newer client.
292
293 <username> and <pass phrase> are the strings supplied by the user.
294
295 4) MyProxyServer will then respond with either a OK or an ERROR message.
296 See section A.6 for details. If the response is OK it will also contain
297 the following strings:
298
299 CRED_NAME=<credential name> // optional
300 CRED_DESC=<credential description> // optional
301 CRED_START_TIME=<start_time> // required
302 CRED_END_TIME=<end_time> // required
303 CRED_OWNER=<subject_name> // required
304 CRED_RETRIEVER=<retriever regex> // optional
305 CRED_RENEWER=<renewer regex> // optional
306
307 ADDL_CREDS=cred1,cred2,....,credn // If multiple creds are stored
308 CRED_cred1_DESC=<credential description> // optional
309 CRED_cred1_START_TIME=<start_time> // required
310 CRED_cred1_END_TIME=<end time> // required
311 CRED_cred1_OWNER=<subject name> // required
312 CRED_cred1_RETRIEVER=<retriever regex> // optional
313 CRED_cred1_RENEWER=<renewer regex> // optional
314 ....
315
316 The time strings carry information on lifetime of the proxy in a
317 repository. Both the times are in unix format, i.e. number seconds since
318 the Epoch (00:00:00 UTC January 1, 1970). The <subject_name> field
319 contains DN of the proxy's owner.
320
321 5) At this point, both sides should close the connection.
322
323 ======
324
325 Section F
326 ------- -
327
328 MyProxyChangePasswd <-> MyProxyServer protocol
329
330 The following illustrates a MyProxyChangePasswd process connecting to a
331 MyProxyServer process and changes password of a proxy.
332
333 1) MyProxyChangePasswd makes a connection to the MyProxyServer as
334 indicated by its configuration or arguments.
335
336 2) MyProxyChangePasswd will initiate the GSSAPI context setup loop, with
337 MyProxyServer accepting. See section A.1.
338
339 3) MyProxyChangePasswd will then send a message to MyProxyServer containing
340 the following strings:
341
342 VERSION=MYPROXYv2
343 COMMAND=4
344 USERNAME=<username>
345 PASSPHRASE=<credential pass phrase>
346 NEW_PHRASE=<new pass phrase>
347
348 The message can also contain an optional string :
349 CRED_NAME=<credential name>
350
351 The intent of the VERSION string is to allow the server to know
352 if it is dealing with an outdated or newer client.
353
354 <username> and <credential pass phrase> are the strings supplied
355 by the user for authentication. <new pass phrase> is the new pass
356 phrase assigned to the credential.
357
358 4) MyProxyServer will then respond with either a OK or an ERROR message.
359 See section A.6 for details.
360
361 5) At this point, both sides should close the connection.
362
363 ======
364
365 Section G
366 ------- -
367
368 MyProxyStoreCertificate <-> MyProxyServer protocol
369
370 The following illustrates a MyProxyStoreCertificate process connecting to a
371 MyProxyServer process and storing a proxy for later retrieval.
372
373 1) MyProxyStoreCertificate will make a connection to the MyProxyServer at the
374 host and port as specified by its configuration or the user.
375
376 2) MyProxyStoreCertificate will initiate the GSSAPI context setup loop, with
377 MyProxyServer accepting. See Section A.1.
378
379 3) MyProxyStoreCertificate will then send a message to MyProxyServer
380 containing the following strings:
381
382 VERSION=MYPROXYv2
383 COMMAND=5
384 USERNAME=<username>
385 LIFETIME=<lifetime>
386
387 and optional strings
388
389 RETRIEVER=<retriever_dn>
390 RENEWER=<renewer_dn>
391 CRED_NAME=<credential name>
392 CRED_DESC=<credential description>
393 KEYRETRIEVER=<retriever_dn>
394
395 The intent of the VERSION string is to allow the server to know
396 if it is dealing with an outdated or newer client.
397
398 <username> is the strings supplied by the user to be used for retrieval
399 by the portal. <lifetime> is the ASCII representation of the lifetime of
400 the proxy to be delegated to the portal, in seconds. <retriever_dn> and
401 <renewer_dn> are strings specifying the retriever and renewer policy
402 regular expressions. <key retriever dns> is a string specifying the key
403 retriever policy regular expression. <credential name> assigns a name to
404 the credential, allowing multiple credentials to be stored for a given
405 username. <credential description> can provide additional descriptive
406 text to be displayed in MyProxyInfo requests, for example.
407
408 4) MyProxyServer will then respond with either a OK or an ERROR message.
409 See Section A.6 for details.
410
411 5) Next, the client will send the users end-entity credentials to the
412 server.
413
414 6) MyProxyServer will read the individual certificates and store it. The
415 server also stores the retriever, renewer, or key retriever DN strings if
416 they are specified.
417
418 7) MyProxyServer will then respond with either a OK message if it
419 successfully stored the proxy or an ERROR message if an error occurred.
420 For example, an error might occur when the stored proxy already exists
421 for the same username but belongs to another user.
422 For the reply message details see section A.6.
423
424 8) At this point, both sides should close the connection.
425
426 ====
427
428 Section H
429 ------- -
430
431 MyProxyRetrieve <-> MyProxyServer protocol
432
433 The following illustrates a MyProxyRetrieve process connecting to
434 a MyProxyServer process and retrieving the end-entity credentials.
435
436 1) MyProxyRetrieve makes a connection to the MyProxyServer as
437 indicated by its configuration or arguments.
438
439 2) MyProxyRetrieve will initiate the GSSAPI context setup loop, with
440 MyProxyServer accepting. See Section A.1.
441
442 3) MyProxyRetrieve will then send a message to MyProxyServer containing
443 the following strings:
444
445 VERSION=MYPROXYv2
446 COMMAND=6
447 USERNAME=<username>
448 PASSPHRASE=<pass phrase>
449 LIFETIME=<requested lifetime>
450
451 The message can also contain an optional string :
452 CRED_NAME=<credential name>
453
454 The intent of the VERSION string is to allow the server to know
455 if it is dealing with an outdated or newer client.
456
457 <username> and <pass phrase> are the strings supplied by the
458 user to the portal to be used for retrieval by the portal.
459
460 4) MyProxyServer will then respond with either a OK, ERROR, or
461 AUTHORIZATION message. See Section A.6 for details.
462
463 5) Next, the server will retrieve the user credential and send it to the
464 client.
465
466 6) At this point, both sides should close the connection.