7 This is the mechanism that put entries in /sys/lib/httpd.rewrite
8 and passwords on the authserver in /sys/lib/httppasswords, which
9 was awkward to administer. Instead, use local .httplogin files,
10 which are implemented in sys/src/cmd/ip/httpd/authorize.c */
13 httpauth(char *name, char *password)
21 afd = authdial(nil, nil);
25 /* send ticket request to AS */
26 memset(&tr, 0, sizeof(tr));
30 if(write(afd, buf, TICKREQLEN) != TICKREQLEN){
34 if(_asrdresp(afd, buf, TICKETLEN) < 0){
41 * use password and try to decrypt the
42 * ticket. If it doesn't work we've got a bad password,
45 passtokey(key, password);
46 convM2T(buf, &t, key);
47 if(t.num != AuthHr || strcmp(t.cuid, tr.uid))