Lines Matching refs:auth

29  * $XConsortium: auth.c,v 1.17 89/12/14 09:42:18 rws Exp $
67 static void setAuthNumber(Xauth *auth, const char *name);
68 static void DefineLocal(FILE *file, Xauth *auth);
69 static void DefineSelf(int fd, FILE *file, Xauth *auth);
70 static void writeAuth(FILE *file, Xauth *auth);
71 static void GenerateCryptoKey(char *auth, int len);
139 dumpAuth(Xauth *auth)
141 printf("family: %d\n", auth->family);
143 dumpBytes(auth->address_length, auth->address);
145 dumpBytes(auth->number_length, auth->number);
147 dumpBytes(auth->name_length, auth->name);
149 dumpBytes(auth->data_length, auth->data);
217 writeLocalAuth(FILE *file, Xauth *auth, const char *name)
221 setAuthNumber(auth, name);
223 DefineSelf(fd, file, auth);
226 DefineLocal(file, auth);
230 writeAddr(int family, size_t addr_length, char *addr, FILE *file, Xauth *auth)
232 auth->family = (unsigned short) family;
233 auth->address_length = (unsigned short) addr_length;
234 auth->address = addr;
237 dumpAuth(auth);
239 writeAuth(file, auth);
243 DefineSelf(int fd, FILE *file, Xauth *auth)
298 writeAddr(family, len, addr, file, auth);
303 DefineLocal(FILE *file, Xauth *auth)
308 writeAddr(FamilyLocal, strlen(displayname), displayname, file, auth);
314 setAuthNumber(Xauth *auth, const char *name)
324 auth->number_length = (unsigned short) (dot - colon);
326 auth->number_length = (unsigned short) strlen(colon);
327 number = malloc(auth->number_length + 1);
329 strncpy(number, colon, auth->number_length);
330 number[auth->number_length] = '\0';
334 auth->number_length = 0;
336 auth->number = number;
366 writeAuth(FILE *file, Xauth *auth)
368 saveAddr(auth->family, auth->address_length, auth->address,
369 auth->number_length, auth->number);
370 if (!XauWriteAuth(file, auth)) {
445 GenerateCryptoKey(char *auth, int len)
451 int result = getrandom(auth + received, needed, GRND_RANDOM);
476 auth[i] = (char) (value & 0xff);
482 SaveServerAuthorization(const char *authFile, Xauth *auth)
503 if (!XauWriteAuth(auth_file, auth) || (fflush(auth_file) == EOF)) {
518 Xauth *auth;
524 auth = GenerateAuthorization(d->authName);
525 if (auth == NULL)
531 if (SaveServerAuthorization(d->authFile, auth)) {
532 d->authorization = auth;
535 XauDisposeAuth(auth);
549 Xauth *entry, *auth;
554 if ((auth = d->authorization) != NULL) {
595 writeLocalAuth(new, auth, d->name);
632 fprintf(stderr, "usage: %s Server_auth_file [-auth protocol]\n", str);
666 if (argv[2] && strcmp(argv[2], "-auth") == 0) {
671 fprintf(stderr, "%s: -auth requires an argument\n", argv[0]);
687 fprintf(stderr, "%s: -auth: unrecognized protocol %s\n", argv[0],