9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] dist updates from sources.cs.bell-labs.com
@ 2002-10-26 18:20 Russ Cox
  2002-10-28 20:01 ` Chris Silva
  0 siblings, 1 reply; 16+ messages in thread
From: Russ Cox @ 2002-10-26 18:20 UTC (permalink / raw)
  To: 9fans

you're not even trying to authenticate:
there's nothing in our logs.

after you run a failed attempt at pulling,
try running auth/debug to see what it
thinks about your auth setup.  (the failed
pull attempt will store the key you used,
which is important.)

everything you posted looks reasonable to me.
if you only just edited /lib/ndb/local
(and haven't rebooted since then)
you'll have to

	echo -n refresh >/net/cs

to get it to reread the file.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] dist updates from sources.cs.bell-labs.com
  2002-10-26 18:20 [9fans] dist updates from sources.cs.bell-labs.com Russ Cox
@ 2002-10-28 20:01 ` Chris Silva
  0 siblings, 0 replies; 16+ messages in thread
From: Chris Silva @ 2002-10-28 20:01 UTC (permalink / raw)
  To: 9fans

term%
auth/debug: '/bin/auth/debug' does not exit
term%

Where is auth/debug located?

On Saturday, October 26, 2002, at 12:20 PM, Russ Cox wrote:

> you're not even trying to authenticate:
> there's nothing in our logs.
>
> after you run a failed attempt at pulling,
> try running auth/debug to see what it
> thinks about your auth setup.  (the failed
> pull attempt will store the key you used,
> which is important.)
>
> everything you posted looks reasonable to me.
> if you only just edited /lib/ndb/local
> (and haven't rebooted since then)
> you'll have to
>
> 	echo -n refresh >/net/cs
>
> to get it to reread the file.
>
>
>
>



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] dist updates from sources.cs.bell-labs.com
@ 2002-10-29  1:57 YAMANASHI Takeshi
  0 siblings, 0 replies; 16+ messages in thread
From: YAMANASHI Takeshi @ 2002-10-29  1:57 UTC (permalink / raw)
  To: 9fans

> etc. I've removed the auth line from /lib/ndb/local and i'm doing it the
> manual cat >> /net/ndb << '!'  It seems that it is working. :)

Did the auth line have a new line character at the end of it?
--



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] dist updates from sources.cs.bell-labs.com
  2002-10-28 23:21 Russ Cox
@ 2002-10-29  1:48 ` Chris Silva
  0 siblings, 0 replies; 16+ messages in thread
From: Chris Silva @ 2002-10-29  1:48 UTC (permalink / raw)
  To: 9fans

Didn't have much luck with ndb/csquery kept saying "cs: can't translate
address".  /net/cs and /net/dns is working i'm tracerouting, ssh'ing,
etc. I've removed the auth line from /lib/ndb/local and i'm doing it the
manual cat >> /net/ndb << '!'  It seems that it is working. :) A big
thanks to Russ, Dan, Steve, and Andrey.

Thanks again,

Chris

On Monday, October 28, 2002, at 04:21 PM, Russ Cox wrote:

> You should be able to do this:
>
> g% ndb/csquery
>> !authdom=outside.plan9.bell-labs.com auth=*
> auth=sources.cs.bell-labs.com authdom=outside.plan9.bell-labs.com
>>
>
> If not, that entry in /lib/ndb/local isn't working.
> Does /net/cs exist?  Does /net/dns exist?
>
> Russ
>



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] dist updates from sources.cs.bell-labs.com
@ 2002-10-28 23:21 Russ Cox
  2002-10-29  1:48 ` Chris Silva
  0 siblings, 1 reply; 16+ messages in thread
From: Russ Cox @ 2002-10-28 23:21 UTC (permalink / raw)
  To: 9fans

You should be able to do this:

g% ndb/csquery
> !authdom=outside.plan9.bell-labs.com auth=*
auth=sources.cs.bell-labs.com authdom=outside.plan9.bell-labs.com
>

If not, that entry in /lib/ndb/local isn't working.
Does /net/cs exist?  Does /net/dns exist?

Russ


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] dist updates from sources.cs.bell-labs.com
  2002-10-28 21:19 Russ Cox
@ 2002-10-28 22:21 ` Chris Silva
  0 siblings, 0 replies; 16+ messages in thread
From: Chris Silva @ 2002-10-28 22:21 UTC (permalink / raw)
  To: 9fans

term% 8.debug
p9sk1 key: dom=outside.plan9.bell-labs.com proto=p9sk1 user=cls
	cannot dial auth server: no auth server found for
outside.plan9.bell-labs.com
	csquery authdom=outside.plan9.bell-labs.com auth=* failed
	csquery dom=outside.plan9.bell-labs.com auth=''
	dial net!!ticket failed: cs: can't translate address
term%

this is what is at the end of /lib/ndb/local:
auth=sources.cs.bell-labs.com authdom=outside.plan9.bell-labs.com

On Monday, October 28, 2002, at 02:19 PM, Russ Cox wrote:

> auth/debug is new.  you have to pull to get it.  ;-)
>
> put this in /sys/src/cmd/auth as debug.c and then mk 8.debug; 8.debug
>
> /*
>  * Test various aspects of the authentication setup.
>  */
>
> #include <u.h>
> #include <libc.h>
> #include <bio.h>
> #include <ndb.h>
> #include <auth.h>
> #include <authsrv.h>
>
> void
> usage(void)
> {
> 	fprint(2, "usage: auth/debug\n");
> 	exits("usage");
> }
>
> static char*
> readcons(char *prompt, char *def, int raw, char *buf, int nbuf)
> {
> 	int fdin, fdout, ctl, n, m;
> 	char line[10];
>
> 	fdin = open("/dev/cons", OREAD);
> 	if(fdin < 0)
> 		fdin = 0;
> 	fdout = open("/dev/cons", OWRITE);
> 	if(fdout < 0)
> 		fdout = 1;
> 	if(def != nil)
> 		fprint(fdout, "%s[%s]: ", prompt, def);
> 	else
> 		fprint(fdout, "%s: ", prompt);
> 	if(raw){
> 		ctl = open("/dev/consctl", OWRITE);
> 		if(ctl >= 0)
> 			write(ctl, "rawon", 5);
> 	} else
> 		ctl = -1;
>
> 	m = 0;
> 	for(;;){
> 		n = read(fdin, line, 1);
> 		if(n == 0){
> 			close(ctl);
> 			werrstr("readcons: EOF");
> 			return nil;
> 		}
> 		if(n < 0){
> 			close(ctl);
> 			werrstr("can't read cons");
> 			return nil;
> 		}
> 		if(line[0] == 0x7f)
> 			exits(0);
> 		if(n == 0 || line[0] == '\n' || line[0] == '\r'){
> 			if(raw){
> 				write(ctl, "rawoff", 6);
> 				write(fdout, "\n", 1);
> 				close(ctl);
> 			}
> 			buf[m] = '\0';
> 			if(buf[0]=='\0' && def)
> 				strcpy(buf, def);
> 			return buf;
> 		}
> 		if(line[0] == '\b'){
> 			if(m > 0)
> 				m--;
> 		}else if(line[0] == 0x15){	/* ^U: line kill */
> 			m = 0;
> 			if(def != nil)
> 				fprint(fdout, "%s[%s]: ", prompt, def);
> 			else
> 				fprint(fdout, "%s: ", prompt);
> 		}else{
> 			if(m >= nbuf-1){
> 				fprint(fdout, "line too long\n");
> 				m = 0;
> 				if(def != nil)
> 					fprint(fdout, "%s[%s]: ", prompt, def);
> 				else
> 					fprint(fdout, "%s: ", prompt);
> 			}else
> 				buf[m++] = line[0];
> 		}
> 	}
> 	return buf;	/* how does this happen */
> }
>
> void authdialfutz(char*, char*);
> void authfutz(char*, char*);
>
> /* scan factotum for p9sk1 keys; check them */
> void
> debugfactotumkeys(void)
> {
> 	char *s, *dom, *proto, *user;
> 	int found;
> 	Attr *a;
> 	Biobuf *b;
>
> 	b = Bopen("/mnt/factotum/ctl", OREAD);
> 	if(b == nil){
> 		fprint(2, "cannot open /mnt/factotum/ctl");
> 		return;
> 	}
> 	found = 0;
> 	while((s = Brdstr(b, '\n', 1)) != nil){
> 		if(strncmp(s, "key ", 4) != 0){
> 			print("malformed ctl line: %s\n", s);
> 			free(s);
> 			continue;
> 		}
> 		a = _parseattr(s+4);
> 		free(s);
> 		proto = _str_findattr(a, "proto");
> 		if(proto==nil || strcmp(proto, "p9sk1")!=0)
> 			continue;
> 		dom = _str_findattr(a, "dom");
> 		if(dom == nil){
> 			print("p9sk1 key with no dom: %A\n", a);
> 			_freeattr(a);
> 			continue;
> 		}
> 		user = _str_findattr(a, "user");
> 		if(user == nil){
> 			print("p9sk1 key with no user: %A\n", a);
> 			_freeattr(a);
> 			continue;
> 		}
> 		print("p9sk1 key: %A\n", a);
> 		found = 1;
> 		authdialfutz(dom, user);
> 		_freeattr(a);
> 	}
> 	if(!found)
> 		print("no p9sk1 keys found in factotum\n");
> }
>
> void
> authdialfutz(char *dom, char *user)
> {
> 	int fd;
> 	Ndbtuple *nt;
> 	char server[Ndbvlen];
> 	char *addr;
>
> 	fd = authdial(nil, dom);
> 	if(fd >= 0){
> 		print("\tsuccessfully dialed auth server\n");
> 		close(fd);
> 		authfutz(dom, user);
> 		return;
> 	}
> 	print("\tcannot dial auth server: %r\n");
> 	nt = csgetval(nil, "authdom", dom, "auth", server);
> 	if(nt){
> 		print("\tcsquery authdom=%q auth=%s\n", dom, server);
> 		return;
> 	}
> 	print("\tcsquery authdom=%q auth=* failed\n", dom);
> 	nt = csgetval(nil, "dom", dom, "auth", server);
> 	if(nt){
> 		print("\tcsquery dom=%q auth=%q\n", dom, server);
> 		return;
> 	}
> 	print("\tcsquery dom=%q auth=%q\n", dom, server);
>
> 	fd = dial(addr=netmkaddr(server, nil, "ticket"), 0, 0, 0);
> 	if(fd >= 0){
> 		print("\tdial %s succeeded\n", addr);
> 		close(fd);
> 		return;
> 	}
> 	print("\tdial %s failed: %r\n", addr);
> }
>
> void
> authfutz(char *dom, char *user)
> {
> 	int fd, nobootes;
> 	char pw[128], prompt[128], key[DESKEYLEN], booteskey[DESKEYLEN],
> tbuf[2*TICKETLEN],
> 		trbuf[TICKREQLEN];
> 	Ticket t;
> 	Ticketreq tr;
>
> 	snprint(prompt, sizeof prompt, "\tpassword for %s@%s [hit enter to
> skip test]", user, dom);
> 	readcons(prompt, nil, 1, pw, sizeof pw);
> 	if(pw[0] == '\0')
> 		return;
> 	passtokey(key, pw);
>
> 	fd = authdial(nil, dom);
> 	if(fd < 0){
> 		print("\tauthdial failed(!): %r\n");
> 		return;
> 	}
>
> 	/* try ticket request using just user key */
> 	tr.type = AuthTreq;
> 	strecpy(tr.authid, tr.authid+sizeof tr.authid, user);
> 	strecpy(tr.authdom, tr.authdom+sizeof tr.authdom, dom);
> 	strecpy(tr.hostid, tr.hostid+sizeof tr.hostid, user);
> 	strecpy(tr.uid, tr.uid+sizeof tr.uid, user);
> 	memset(tr.chal, 0xAA, sizeof tr.chal);
> 	convTR2M(&tr, trbuf);
> 	if(_asgetticket(fd, trbuf, tbuf) < 0){
> 		close(fd);
> 		print("\t_asgetticket failed: %r\n");
> 		return;
> 	}
> 	convM2T(tbuf, &t, key);
> 	if(t.num != AuthTc){
> 		print("\tcannot decrypt ticket1 from auth server (bad
> t.num=0x%.2ux)\n", t.num);
> 		print("\tauth server and you do not agree on key for
> %s@%s\n", user, dom);
> 		return;
> 	}
> 	if(memcmp(t.chal, tr.chal, sizeof tr.chal) != 0){
> 		print("\tbad challenge1 from auth server got %.*H wanted %.*H\n",
> 			sizeof t.chal, t.chal, sizeof tr.chal, tr.chal);
> 		print("\tauth server is rogue\n");
> 		return;
> 	}
>
> 	convM2T(tbuf+TICKETLEN, &t, key);
> 	if(t.num != AuthTs){
> 		print("\tcannot decrypt ticket2 from auth server (bad
> t.num=0x%.2ux)\n", t.num);
> 		print("\tauth server and you do not agree on key for
> %s@%s\n", user, dom);
> 		return;
> 	}
> 	if(memcmp(t.chal, tr.chal, sizeof tr.chal) != 0){
> 		print("\tbad challenge2 from auth server got %.*H wanted %.*H\n",
> 			sizeof t.chal, t.chal, sizeof tr.chal, tr.chal);
> 		print("\tauth server is rogue\n");
> 		return;
> 	}
> 	print("\tticket request using %s@%s key succeeded\n", user, dom);
>
> 	/* try ticket request using bootes key */
> 	snprint(prompt, sizeof prompt, "\tcpu server owner for domain
> %s ", dom);
> 	readcons(prompt, "bootes", 0, tr.authid, sizeof tr.authid);
> 	convTR2M(&tr, trbuf);
> 	if(_asgetticket(fd, trbuf, tbuf) < 0){
> 		close(fd);
> 		print("\t_asgetticket failed: %r\n");
> 		return;
> 	}
> 	convM2T(tbuf, &t, key);
> 	if(t.num != AuthTc){
> 		print("\tcannot decrypt ticket1 from auth server (bad
> t.num=0x%.2ux)\n", t.num);
> 		print("\tauth server and you do not agree on key for
> %s@%s\n", user, dom);
> 		return;
> 	}
> 	if(memcmp(t.chal, tr.chal, sizeof tr.chal) != 0){
> 		print("\tbad challenge1 from auth server got %.*H wanted %.*H\n",
> 			sizeof t.chal, t.chal, sizeof tr.chal, tr.chal);
> 		print("\tauth server is rogue\n");
> 		return;
> 	}
>
> 	snprint(prompt, sizeof prompt, "\tpassword for %s@%s [hit enter to
> skip test]", tr.authid, dom);
> 	readcons(prompt, nil, 1, pw, sizeof pw);
> 	if(pw[0] == '\0'){
> 		nobootes=1;
> 		goto Nobootes;
> 	}
> 	nobootes = 0;
> 	passtokey(booteskey, pw);
>
> 	convM2T(tbuf+TICKETLEN, &t, booteskey);
> 	if(t.num != AuthTs){
> 		print("\tcannot decrypt ticket2 from auth server (bad
> t.num=0x%.2ux)\n", t.num);
> 		print("\tauth server and you do not agree on key for
> %s@%s\n", tr.authid, dom);
> 		return;
> 	}
> 	if(memcmp(t.chal, tr.chal, sizeof tr.chal) != 0){
> 		print("\tbad challenge2 from auth server got %.*H wanted %.*H\n",
> 			sizeof t.chal, t.chal, sizeof tr.chal, tr.chal);
> 		print("\tauth server is rogue\n");
> 		return;
> 	}
> 	print("\tticket request using %s@%s key succeeded\n", tr.authid, dom);
>
> Nobootes:;
>
> 	/* try p9sk1 exchange with local factotum to test that key is right */
>
>
> 	/*
> 	 * try p9sk1 exchange with factotum on
> 	 * auth server (assumes running cpu service)
> 	 * to test that bootes key is right over there
> 	 */
>
> }
>
> void
> main(int argc, char **argv)
> {
> 	quotefmtinstall();
> 	fmtinstall('A', _attrfmt);
> 	fmtinstall('H', encodefmt);
>
> 	ARGBEGIN{
> 	default:
> 		usage();
> 	}ARGEND
>
> 	if(argc != 0)
> 		usage();
>
> 	debugfactotumkeys();
> }
>



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] dist updates from sources.cs.bell-labs.com
@ 2002-10-28 21:19 Russ Cox
  2002-10-28 22:21 ` Chris Silva
  0 siblings, 1 reply; 16+ messages in thread
From: Russ Cox @ 2002-10-28 21:19 UTC (permalink / raw)
  To: 9fans

auth/debug is new.  you have to pull to get it.  ;-)

put this in /sys/src/cmd/auth as debug.c and then mk 8.debug; 8.debug

/*
 * Test various aspects of the authentication setup.
 */

#include <u.h>
#include <libc.h>
#include <bio.h>
#include <ndb.h>
#include <auth.h>
#include <authsrv.h>

void
usage(void)
{
	fprint(2, "usage: auth/debug\n");
	exits("usage");
}

static char*
readcons(char *prompt, char *def, int raw, char *buf, int nbuf)
{
	int fdin, fdout, ctl, n, m;
	char line[10];

	fdin = open("/dev/cons", OREAD);
	if(fdin < 0)
		fdin = 0;
	fdout = open("/dev/cons", OWRITE);
	if(fdout < 0)
		fdout = 1;
	if(def != nil)
		fprint(fdout, "%s[%s]: ", prompt, def);
	else
		fprint(fdout, "%s: ", prompt);
	if(raw){
		ctl = open("/dev/consctl", OWRITE);
		if(ctl >= 0)
			write(ctl, "rawon", 5);
	} else
		ctl = -1;

	m = 0;
	for(;;){
		n = read(fdin, line, 1);
		if(n == 0){
			close(ctl);
			werrstr("readcons: EOF");
			return nil;
		}
		if(n < 0){
			close(ctl);
			werrstr("can't read cons");
			return nil;
		}
		if(line[0] == 0x7f)
			exits(0);
		if(n == 0 || line[0] == '\n' || line[0] == '\r'){
			if(raw){
				write(ctl, "rawoff", 6);
				write(fdout, "\n", 1);
				close(ctl);
			}
			buf[m] = '\0';
			if(buf[0]=='\0' && def)
				strcpy(buf, def);
			return buf;
		}
		if(line[0] == '\b'){
			if(m > 0)
				m--;
		}else if(line[0] == 0x15){	/* ^U: line kill */
			m = 0;
			if(def != nil)
				fprint(fdout, "%s[%s]: ", prompt, def);
			else
				fprint(fdout, "%s: ", prompt);
		}else{
			if(m >= nbuf-1){
				fprint(fdout, "line too long\n");
				m = 0;
				if(def != nil)
					fprint(fdout, "%s[%s]: ", prompt, def);
				else
					fprint(fdout, "%s: ", prompt);
			}else
				buf[m++] = line[0];
		}
	}
	return buf;	/* how does this happen */
}

void authdialfutz(char*, char*);
void authfutz(char*, char*);

/* scan factotum for p9sk1 keys; check them */
void
debugfactotumkeys(void)
{
	char *s, *dom, *proto, *user;
	int found;
	Attr *a;
	Biobuf *b;

	b = Bopen("/mnt/factotum/ctl", OREAD);
	if(b == nil){
		fprint(2, "cannot open /mnt/factotum/ctl");
		return;
	}
	found = 0;
	while((s = Brdstr(b, '\n', 1)) != nil){
		if(strncmp(s, "key ", 4) != 0){
			print("malformed ctl line: %s\n", s);
			free(s);
			continue;
		}
		a = _parseattr(s+4);
		free(s);
		proto = _str_findattr(a, "proto");
		if(proto==nil || strcmp(proto, "p9sk1")!=0)
			continue;
		dom = _str_findattr(a, "dom");
		if(dom == nil){
			print("p9sk1 key with no dom: %A\n", a);
			_freeattr(a);
			continue;
		}
		user = _str_findattr(a, "user");
		if(user == nil){
			print("p9sk1 key with no user: %A\n", a);
			_freeattr(a);
			continue;
		}
		print("p9sk1 key: %A\n", a);
		found = 1;
		authdialfutz(dom, user);
		_freeattr(a);
	}
	if(!found)
		print("no p9sk1 keys found in factotum\n");
}

void
authdialfutz(char *dom, char *user)
{
	int fd;
	Ndbtuple *nt;
	char server[Ndbvlen];
	char *addr;

	fd = authdial(nil, dom);
	if(fd >= 0){
		print("\tsuccessfully dialed auth server\n");
		close(fd);
		authfutz(dom, user);
		return;
	}
	print("\tcannot dial auth server: %r\n");
	nt = csgetval(nil, "authdom", dom, "auth", server);
	if(nt){
		print("\tcsquery authdom=%q auth=%s\n", dom, server);
		return;
	}
	print("\tcsquery authdom=%q auth=* failed\n", dom);
	nt = csgetval(nil, "dom", dom, "auth", server);
	if(nt){
		print("\tcsquery dom=%q auth=%q\n", dom, server);
		return;
	}
	print("\tcsquery dom=%q auth=%q\n", dom, server);

	fd = dial(addr=netmkaddr(server, nil, "ticket"), 0, 0, 0);
	if(fd >= 0){
		print("\tdial %s succeeded\n", addr);
		close(fd);
		return;
	}
	print("\tdial %s failed: %r\n", addr);
}

void
authfutz(char *dom, char *user)
{
	int fd, nobootes;
	char pw[128], prompt[128], key[DESKEYLEN], booteskey[DESKEYLEN], tbuf[2*TICKETLEN],
		trbuf[TICKREQLEN];
	Ticket t;
	Ticketreq tr;

	snprint(prompt, sizeof prompt, "\tpassword for %s@%s [hit enter to skip test]", user, dom);
	readcons(prompt, nil, 1, pw, sizeof pw);
	if(pw[0] == '\0')
		return;
	passtokey(key, pw);

	fd = authdial(nil, dom);
	if(fd < 0){
		print("\tauthdial failed(!): %r\n");
		return;
	}

	/* try ticket request using just user key */
	tr.type = AuthTreq;
	strecpy(tr.authid, tr.authid+sizeof tr.authid, user);
	strecpy(tr.authdom, tr.authdom+sizeof tr.authdom, dom);
	strecpy(tr.hostid, tr.hostid+sizeof tr.hostid, user);
	strecpy(tr.uid, tr.uid+sizeof tr.uid, user);
	memset(tr.chal, 0xAA, sizeof tr.chal);
	convTR2M(&tr, trbuf);
	if(_asgetticket(fd, trbuf, tbuf) < 0){
		close(fd);
		print("\t_asgetticket failed: %r\n");
		return;
	}
	convM2T(tbuf, &t, key);
	if(t.num != AuthTc){
		print("\tcannot decrypt ticket1 from auth server (bad t.num=0x%.2ux)\n", t.num);
		print("\tauth server and you do not agree on key for %s@%s\n", user, dom);
		return;
	}
	if(memcmp(t.chal, tr.chal, sizeof tr.chal) != 0){
		print("\tbad challenge1 from auth server got %.*H wanted %.*H\n",
			sizeof t.chal, t.chal, sizeof tr.chal, tr.chal);
		print("\tauth server is rogue\n");
		return;
	}

	convM2T(tbuf+TICKETLEN, &t, key);
	if(t.num != AuthTs){
		print("\tcannot decrypt ticket2 from auth server (bad t.num=0x%.2ux)\n", t.num);
		print("\tauth server and you do not agree on key for %s@%s\n", user, dom);
		return;
	}
	if(memcmp(t.chal, tr.chal, sizeof tr.chal) != 0){
		print("\tbad challenge2 from auth server got %.*H wanted %.*H\n",
			sizeof t.chal, t.chal, sizeof tr.chal, tr.chal);
		print("\tauth server is rogue\n");
		return;
	}
	print("\tticket request using %s@%s key succeeded\n", user, dom);

	/* try ticket request using bootes key */
	snprint(prompt, sizeof prompt, "\tcpu server owner for domain %s ", dom);
	readcons(prompt, "bootes", 0, tr.authid, sizeof tr.authid);
	convTR2M(&tr, trbuf);
	if(_asgetticket(fd, trbuf, tbuf) < 0){
		close(fd);
		print("\t_asgetticket failed: %r\n");
		return;
	}
	convM2T(tbuf, &t, key);
	if(t.num != AuthTc){
		print("\tcannot decrypt ticket1 from auth server (bad t.num=0x%.2ux)\n", t.num);
		print("\tauth server and you do not agree on key for %s@%s\n", user, dom);
		return;
	}
	if(memcmp(t.chal, tr.chal, sizeof tr.chal) != 0){
		print("\tbad challenge1 from auth server got %.*H wanted %.*H\n",
			sizeof t.chal, t.chal, sizeof tr.chal, tr.chal);
		print("\tauth server is rogue\n");
		return;
	}

	snprint(prompt, sizeof prompt, "\tpassword for %s@%s [hit enter to skip test]", tr.authid, dom);
	readcons(prompt, nil, 1, pw, sizeof pw);
	if(pw[0] == '\0'){
		nobootes=1;
		goto Nobootes;
	}
	nobootes = 0;
	passtokey(booteskey, pw);

	convM2T(tbuf+TICKETLEN, &t, booteskey);
	if(t.num != AuthTs){
		print("\tcannot decrypt ticket2 from auth server (bad t.num=0x%.2ux)\n", t.num);
		print("\tauth server and you do not agree on key for %s@%s\n", tr.authid, dom);
		return;
	}
	if(memcmp(t.chal, tr.chal, sizeof tr.chal) != 0){
		print("\tbad challenge2 from auth server got %.*H wanted %.*H\n",
			sizeof t.chal, t.chal, sizeof tr.chal, tr.chal);
		print("\tauth server is rogue\n");
		return;
	}
	print("\tticket request using %s@%s key succeeded\n", tr.authid, dom);

Nobootes:;

	/* try p9sk1 exchange with local factotum to test that key is right */


	/*
	 * try p9sk1 exchange with factotum on
	 * auth server (assumes running cpu service)
	 * to test that bootes key is right over there
	 */

}

void
main(int argc, char **argv)
{
	quotefmtinstall();
	fmtinstall('A', _attrfmt);
	fmtinstall('H', encodefmt);

	ARGBEGIN{
	default:
		usage();
	}ARGEND

	if(argc != 0)
		usage();

	debugfactotumkeys();
}


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [9fans] dist updates from sources.cs.bell-labs.com
@ 2002-10-26 16:21 Chris Silva
  0 siblings, 0 replies; 16+ messages in thread
From: Chris Silva @ 2002-10-26 16:21 UTC (permalink / raw)
  To: 9fans

I'm still having difficulties replica/pull'ing. Now I'm not
authenticating and I figure I have some configuration error.

Here is what I am doing:
term% disk/kfscmd allow
term% replica/pull -v /tmp/network
post...

!Adding key: dom=outside.plan9.bell-labs.com proto=p9sk1
user[cls]:
password:
!
srv tcp!204.178.31.8!9fs: mount failed: authentication failed
bind: /n/sources/plan9: '/n/sources/plan9' does not exist
servermount: bind 125: bind
term%

Here is /tmp/network:
#!/bin/rc

s=/n/dist/dist/replica
serverroot=/n/dist
serverlog=$s/plan9.log
serverproto=$s/plan9.proto

fn servermount {
		srv tcp!204.178.31.8 sources /n/sources
		bind /n/sources/plan9 /n/dist
}
fn serverupdate { status='' }

fn clientmount {  9fs kfs }
c=/n/kfs/dist/replica
clientroot=/n/kfs
clientdb=$c/client/plan9.db
clientexclude=(dist/replica/client)
clientlog=$c/client/plan9.log

applyopt=(-u -T$c/client/plan9.time)

Here is /lib/ndb/local:
database=
	file=/lib/ndb/local
	file=/lib/ndb/common


dom=
	ns=ns.xmission.com
	ns=ns1.xmission.com
	ns=ns2.xmission.com
dom=ns.xmission.com ip=198.60.22.2
dom=ns1.xmission.com ip=198.60.22.22
dom=ns2.xmission.com ip=207.78.169.150


dom=ack.dsl.xmission.com
	ns=ns.xmission.com
	ns=ns1.xmission.com
	ns=ns2.xmission.com


ipnet=ack ip=192.168.1.3 ipmask=255.255.255.0
	ipgw=192.168.1.1
	dns=ns.xmission.com
	dns=ns1.xmission.com

ip=192.168.1.3 ether=00034797fe5f sys=unsightly
	dom=ack.dsl.xmission.com
	proto=il

auth=204.178.31.8 authdom=outside.plan9.bell-labs.com



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] dist updates from sources.cs.bell-labs.com
  2002-10-23 18:43   ` andrey mirtchovski
  2002-10-23 18:52     ` Dan Cross
@ 2002-10-23 23:14     ` Chris Silva
  1 sibling, 0 replies; 16+ messages in thread
From: Chris Silva @ 2002-10-23 23:14 UTC (permalink / raw)
  To: 9fans

this is what happens:

term% srv -m tcp!sources.cs.bell-labs.com sources /n/sources
post...

!Adding key: dom=outside.plan9.bell-labs.com proto=p9sk1
user[acmesucks]:
password:
!
term% bind /n/sources/plan9 /n/dist
term%
term% replica/pull -v $home/tmp/network
rm: /n/kfs/dist/replica/client/plan9.log:
'/n/kfs/dist/replica/client/plan9.log' does not exist
rm /n/kfs/dist/replica/client/plan9.log: rm 184:
'/n/kfs/dist/replica/client/plan9.log' does not exist
term%

Thanks,

Chris

On Wednesday, October 23, 2002, at 12:43 PM, andrey mirtchovski wrote:

> you should do a:
>
> 	bind /n/sources/plan9 /n/dist
>
> before the replica/pull part and after the 'srv part'
>
> see the Russ Cox' script:
>
> http://groups.google.com/groups?selm=8aa0fc5d47540ca24e1a89f6336a7564%40plan9.
> bell-labs.com&oe=UTF-8&output=gplain
>
> at any rate, you should be able to cd to and list the contents of
> /n/sources after doing a:
>
> 	srv -m tcp!sources.cs.bell-labs.com sources /n/sources
>
> andrey
>
> On Wed, 23 Oct 2002, Chris Silva wrote:
>
>> term% disk/kfscmd allow
>> term% 9fs kfs
>> term% srv -m tcp!sources.cs.bell-labs.com sources /n/sources
>> post...
>>
>> !Adding key: dom=outside.plan9.bell-labs.com proto=p9sk1
>> user[acmesucks]:
>> password:
>> !
>> term% replica/pull -v /dist/replica/network
>> rm: /n/kfs/dist/replica/client/plan9.log:
>> '/n/kfs/dist/replica/client/plan9.log' does not exist
>> rm /n/kfs/dist/replica/client/plan9.log: rm 182:
>> '/n/kfs/dist/replica/client/plan9.log' does not exist
>> term%
>>
>> Any clear fix for this problem?
>>
>> Russ Cox wrote:
>>
>>> Can you send the output of:
>>>
>>> 	9fs kfs
>>> 	srv -m tcp!sources.cs.bell-labs.com sources /n/sources
>>> 	replica/pull -v /dist/replica/network
>>>
>>> ?
>>
>
>



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] dist updates from sources.cs.bell-labs.com
@ 2002-10-23 20:12 Russ Cox
  0 siblings, 0 replies; 16+ messages in thread
From: Russ Cox @ 2002-10-23 20:12 UTC (permalink / raw)
  To: 9fans

> Er, maybe I'm smoking my hair, but don't the functions in
> /dist/replica/network do the appropriate mounts, binds and so forth for
> you?  You shouldn't even need to do ``9fs kfs'' or ``srv -m ...''.  I
> know I certainly don't.

The 9fs kfs and srv -m in my post were to see whether
they generated errors, not to help replica/pull.  You're right
that replica/pull doesn't need any help.

Russ



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] dist updates from sources.cs.bell-labs.com
  2002-10-23 18:52     ` Dan Cross
@ 2002-10-23 19:01       ` andrey mirtchovski
  0 siblings, 0 replies; 16+ messages in thread
From: andrey mirtchovski @ 2002-10-23 19:01 UTC (permalink / raw)
  To: 9fans

you're right. the problem lies not with the binding (funny, i never
used /dist/replica/network myself, but it's pretty much the same
script Russ posted when he initially announced sources.cs)...

unfortunately i can't help debugging the kfs, since i have no kfs
around at the moment :(

andrey

On Wed, 23 Oct 2002, Dan Cross wrote:

> Er, maybe I'm smoking my hair, but don't the functions in
> /dist/replica/network do the appropriate mounts, binds and so forth for
> you?  You shouldn't even need to do ``9fs kfs'' or ``srv -m ...''.  I
> know I certainly don't.
>
> 	- Dan C.
>



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] dist updates from sources.cs.bell-labs.com
  2002-10-23 18:43   ` andrey mirtchovski
@ 2002-10-23 18:52     ` Dan Cross
  2002-10-23 19:01       ` andrey mirtchovski
  2002-10-23 23:14     ` Chris Silva
  1 sibling, 1 reply; 16+ messages in thread
From: Dan Cross @ 2002-10-23 18:52 UTC (permalink / raw)
  To: 9fans

Er, maybe I'm smoking my hair, but don't the functions in
/dist/replica/network do the appropriate mounts, binds and so forth for
you?  You shouldn't even need to do ``9fs kfs'' or ``srv -m ...''.  I
know I certainly don't.

	- Dan C.



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] dist updates from sources.cs.bell-labs.com
  2002-10-23 16:43 ` Chris Silva
@ 2002-10-23 18:43   ` andrey mirtchovski
  2002-10-23 18:52     ` Dan Cross
  2002-10-23 23:14     ` Chris Silva
  0 siblings, 2 replies; 16+ messages in thread
From: andrey mirtchovski @ 2002-10-23 18:43 UTC (permalink / raw)
  To: 9fans

you should do a:

	bind /n/sources/plan9 /n/dist

before the replica/pull part and after the 'srv part'

see the Russ Cox' script:

http://groups.google.com/groups?selm=8aa0fc5d47540ca24e1a89f6336a7564%40plan9.bell-labs.com&oe=UTF-8&output=gplain

at any rate, you should be able to cd to and list the contents of
/n/sources after doing a:

	srv -m tcp!sources.cs.bell-labs.com sources /n/sources

andrey

On Wed, 23 Oct 2002, Chris Silva wrote:

> term% disk/kfscmd allow
> term% 9fs kfs
> term% srv -m tcp!sources.cs.bell-labs.com sources /n/sources
> post...
>
> !Adding key: dom=outside.plan9.bell-labs.com proto=p9sk1
> user[acmesucks]:
> password:
> !
> term% replica/pull -v /dist/replica/network
> rm: /n/kfs/dist/replica/client/plan9.log:
> '/n/kfs/dist/replica/client/plan9.log' does not exist
> rm /n/kfs/dist/replica/client/plan9.log: rm 182:
> '/n/kfs/dist/replica/client/plan9.log' does not exist
> term%
>
> Any clear fix for this problem?
>
> Russ Cox wrote:
>
> > Can you send the output of:
> >
> > 	9fs kfs
> > 	srv -m tcp!sources.cs.bell-labs.com sources /n/sources
> > 	replica/pull -v /dist/replica/network
> >
> > ?
>



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] dist updates from sources.cs.bell-labs.com
  2002-10-23 13:50 Russ Cox
@ 2002-10-23 16:43 ` Chris Silva
  2002-10-23 18:43   ` andrey mirtchovski
  0 siblings, 1 reply; 16+ messages in thread
From: Chris Silva @ 2002-10-23 16:43 UTC (permalink / raw)
  To: 9fans

term% disk/kfscmd allow
term% 9fs kfs
term% srv -m tcp!sources.cs.bell-labs.com sources /n/sources
post...

!Adding key: dom=outside.plan9.bell-labs.com proto=p9sk1
user[acmesucks]:
password:
!
term% replica/pull -v /dist/replica/network
rm: /n/kfs/dist/replica/client/plan9.log:
'/n/kfs/dist/replica/client/plan9.log' does not exist
rm /n/kfs/dist/replica/client/plan9.log: rm 182:
'/n/kfs/dist/replica/client/plan9.log' does not exist
term%

Any clear fix for this problem?

Russ Cox wrote:

> Can you send the output of:
>
> 	9fs kfs
> 	srv -m tcp!sources.cs.bell-labs.com sources /n/sources
> 	replica/pull -v /dist/replica/network
>
> ?


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] dist updates from sources.cs.bell-labs.com
@ 2002-10-23 13:50 Russ Cox
  2002-10-23 16:43 ` Chris Silva
  0 siblings, 1 reply; 16+ messages in thread
From: Russ Cox @ 2002-10-23 13:50 UTC (permalink / raw)
  To: 9fans

Can you send the output of:

	9fs kfs
	srv -m tcp!sources.cs.bell-labs.com sources /n/sources
	replica/pull -v /dist/replica/network

?


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [9fans] dist updates from sources.cs.bell-labs.com
@ 2002-10-23  9:56 Chris Silva
  0 siblings, 0 replies; 16+ messages in thread
From: Chris Silva @ 2002-10-23  9:56 UTC (permalink / raw)
  To: 9fans

I'm having problems with obtaining updates from
sources.cs.bell-labs.com. I've followed the instructions but when I use
the "replica/pull -v /tmp/network" I log in correctly but get a rm error
saying /n/dist/dist/replica/plan9.log and
/n/kfs/dist/replica/client/plan9.log do not exist. Yet I've created them
using echo and touch but I have the same problem. What do I need to do
to have replica/pull work properly?

Thanks,

Chris


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2002-10-29  1:57 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-26 18:20 [9fans] dist updates from sources.cs.bell-labs.com Russ Cox
2002-10-28 20:01 ` Chris Silva
  -- strict thread matches above, loose matches on Subject: below --
2002-10-29  1:57 YAMANASHI Takeshi
2002-10-28 23:21 Russ Cox
2002-10-29  1:48 ` Chris Silva
2002-10-28 21:19 Russ Cox
2002-10-28 22:21 ` Chris Silva
2002-10-26 16:21 Chris Silva
2002-10-23 20:12 Russ Cox
2002-10-23 13:50 Russ Cox
2002-10-23 16:43 ` Chris Silva
2002-10-23 18:43   ` andrey mirtchovski
2002-10-23 18:52     ` Dan Cross
2002-10-23 19:01       ` andrey mirtchovski
2002-10-23 23:14     ` Chris Silva
2002-10-23  9:56 Chris Silva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).