user[none]: gre
!Adding key: dom=cs.bell-labs.com
proto=p9sk1
user[gre]: \n
password: ****
!Adding key: proto=apop
server=plan9.bell-labs.com
user[gre]: \n
password: ****
user[none]: gre secstore password: ****** STA PIN+SecurID: ******
dom=bell-labs.com proto=p9sk1 user=gre !password='don''t tell' proto=apop server=x.y.com user=gre !password='bite me'
server=x.y.com proto=apop
server=x.y.com proto=apop user? !password?
% cd /mnt/factotum
% ls -l
-lrw------- gre gre 0 Jan 30 22:17 confirm
--rw------- gre gre 0 Jan 30 22:17 ctl
-lr-------- gre gre 0 Jan 30 22:17 log
-lrw------- gre gre 0 Jan 30 22:17 needkey
--r--r--r-- gre gre 0 Jan 30 22:17 proto
--rw-rw-rw- gre gre 0 Jan 30 22:17 rpc
% cat >ctl
key dom=bell-labs.com proto=p9sk1 user=gre
!password='don''t tell'
key proto=apop server=x.y.com user=gre
!password='bite me'
^D
% cat ctl
key dom=bell-labs.com proto=p9sk1 user=gre
key proto=apop server=x.y.com user=gre
% echo 'delkey proto=apop' >ctl
% cat ctl
key dom=bell-labs.com proto=p9sk1 user=gre
%
PS->FS: start proto=apop role=server FS->PS: ok PS->FS: read FS->PS: ok +OK POP3 challenge
PS->PC: +OK POP3 challenge
PC->FC: start proto=apop role=client
server=x.y.com
FC->PC: ok
PC->FC: write +OK POP3 challenge
FC->PC: ok
PC->FC: read
FC->PC: ok APOP gre response
PC->PS: APOP gre response
PS->FS: write APOP gre response FS->PS: ok PS->FS: read FS->PS: ok +OK welcome PS->PC: +OK welcome
PS->FS: authinfo
FS->PS: ok client=gre
capability=capability
confirm tag=1 attributes
tag=1 answer=yes
FC->PC: needkey proto=apop
server=x.y.com user? !password?
needkey tag=1 attributes
afd = fauth(int fd, char *servicename);
mount(int fd, int afd, char *mountpoint,
int flag, char *servicename)
C->S: nonceC
S->C: nonceS,uidS,domainS
C->A: nonceS,uidS,domainS,uidC,
factotumC
A->C: KC{nonceS,uidC,uidS,Kn},
KS{nonceS,uidC,uidS,Kn}
C->S: KS{nonceS,uidC,uidS,Kn},
Kn{nonceS,counter}
S->C: Kn{nonceC,counter}
C->S: uidC
S->A: nonceS,uidS,domainS,uidC,
factotumS
A->S: challenge
S->C: challenge
C->S: response
S->A: response
A->S: KC{nonceS,uidC,uidS,Kn},
Kn{nonceC}
C->A: uidC
A->C: Kc{Kn}
C->A: Kn{passwordold,passwordnew}
A->C: OK
vn proto10@domain10 proto20@domain20 ...
proto@domain
OK
int
amount(int fd, char *mntpt,
int flags, char *aname)
{
int afd, ret;
AuthInfo *ai;
afd = fauth(fd, aname);
if(afd >= 0){
ai = auth_proxy(afd, amount_getkey,
"proto=p9any role=client");
if(ai != NULL)
auth_freeAI(ai);
}
ret = mount(fd, afd, mntpt,
flags, aname);
if(afd >= 0)
close(afd);
return ret;
}
/* client */
int
p9auth(int fd)
{
AuthInfo *ai;
ai = auth_proxy(fd, auth_getkey,
"proto=p9any role=client");
if(ai == NULL)
return -1;
/* start cpu protocol here */
}
/* server */
int
srvp9auth(int fd, char *user)
{
AuthInfo *ai;
ai = auth_proxy(fd, NULL,
"proto=p9any role=server");
if(ai == NULL)
return -1;
/* set user id for server process */
if(auth_chuid(ai, NULL) < 0)
return -1;
/* start cpu protocol here */
}
C->S: C,g^xH S->C: S,g^y,hash(g^xy,C,S) C->S: hash(g^xy,S,C)
int pushtls(int fd, char *hashalg,
char *cryptalg, int isclient,
char *secret, char *dir);
int tlsClient(int fd, TLSconn *conn)