7 static char *rcsid_client2_c = "$Header$";
11 * MODULE IDENTIFICATION:
13 * Copyright 1987, 1988 by the Massachusetts Institute of Technology.
14 * For copying and distribution information, please see the file
17 * This code handles the actual distribution of data files
18 * to servers in the MOIRA server-update program.
20 * Ken Raeburn (spook@athena.MIT.EDU),
21 * MIT Project Athena/MIT Information Systems.
27 #include <mit-copyright.h>
32 #include <sys/param.h>
34 #include <sys/socket.h>
38 #include <moira_site.h>
41 extern int errno, dbg;
42 extern C_Block session;
44 static char buf[BUFSIZ];
54 * Insures that various libraries have a chance to get
61 * Initializes GDB library.
68 static int initialized = 0;
80 KTEXT ticket = &ticket_st;
86 code = get_mr_update_ticket(host_name, ticket);
90 STRING_DATA(data) = "AUTH_002";
91 MAX_STRING_SIZE(data) = 9;
92 code = send_object(conn, (char *)&data, STRING_T);
94 return(connection_errno(conn));
96 code = receive_object(conn, (char *)&response, INTEGER_T);
98 return(connection_errno(conn));
101 STRING_DATA(data) = "AUTH_001";
102 MAX_STRING_SIZE(data) = 9;
103 code = send_object(conn, (char *)&data, STRING_T);
105 return(connection_errno(conn));
107 code = receive_object(conn, (char *)&response, INTEGER_T);
109 return(connection_errno(conn));
116 STRING_DATA(data) = (char *)ticket->dat;
117 MAX_STRING_SIZE(data) = ticket->length;
118 code = send_object(conn, (char *)&data, STRING_T);
120 return(connection_errno(conn));
122 code = receive_object(conn, (char *)&response, INTEGER_T);
124 return(connection_errno(conn));
130 if (auth_version == 2) {
131 des_key_schedule sched;
134 code = receive_object(conn, (char *)&data, STRING_T);
136 return(connection_errno(conn));
138 des_key_sched(session, sched);
139 des_ecb_encrypt(STRING_DATA(data), enonce, sched, 1);
140 STRING_DATA(data) = enonce;
141 code = send_object(conn, (char *)&data, STRING_T);
143 return(connection_errno(conn));
145 code = receive_object(conn, (char *)&response, INTEGER_T);
147 return(connection_errno(conn));
164 string_alloc(&data, BUFSIZ);
165 sprintf(STRING_DATA(data), "EXEC_002 %s", path);
166 code = send_object(conn, (char *)&data, STRING_T);
168 return(connection_errno(conn));
169 code = receive_object(conn, (char *)&response, INTEGER_T);
171 return(connection_errno(conn));
182 string_alloc(&str, 5);
183 (void) strcpy(STRING_DATA(str), "quit");
184 (void) send_object(conn, (char *)&str, STRING_T);