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
%
11<I>P</I><I>S</I>11-><I>F</I><I>S</I>11: start proto=apop role=server 11<I>F</I><I>S</I>11-><I>P</I><I>S</I>11: ok 11<I>P</I><I>S</I>11-><I>F</I><I>S</I>11: read 11<I>F</I><I>S</I>11-><I>P</I><I>S</I>11: ok +OK POP3 <I>challenge</I>
11<I>P</I><I>S</I>11-><I>P</I><I>C</I>11: +OK POP3 <I>challenge</I>
11<I>P</I><I>C</I>11-><I>F</I><I>C</I>11: start proto=apop role=client
server=x.y.com
11<I>F</I><I>C</I>11-><I>P</I><I>C</I>11: ok
11<I>P</I><I>C</I>11-><I>F</I><I>C</I>11: write +OK POP3 <I>challenge</I>
11<I>F</I><I>C</I>11-><I>P</I><I>C</I>11: ok
11<I>P</I><I>C</I>11-><I>F</I><I>C</I>11: read
11<I>F</I><I>C</I>11-><I>P</I><I>C</I>11: ok APOP gre <I>response</I>
11<I>P</I><I>C</I>11-><I>P</I><I>S</I>11: APOP gre <I>response</I>
11<I>P</I><I>S</I>11-><I>F</I><I>S</I>11: write APOP gre <I>response</I> 11<I>F</I><I>S</I>11-><I>P</I><I>S</I>11: ok 11<I>P</I><I>S</I>11-><I>F</I><I>S</I>11: read 11<I>F</I><I>S</I>11-><I>P</I><I>S</I>11: ok +OK welcome 11<I>P</I><I>S</I>11-><I>P</I><I>C</I>11: +OK welcome
11<I>P</I><I>S</I>11-><I>F</I><I>S</I>11: authinfo
11<I>F</I><I>S</I>11-><I>P</I><I>S</I>11: ok client=gre
capability=capability
confirm tag=1 attributes
tag=1 answer=yes
11<I>F</I><I>C</I>11-><I>P</I><I>C</I>11: 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)
11<I>C</I>-><I>S</I>: <I>nonce</I><I>C</I>11
11<I>S</I>-><I>C</I>: <I>nonce</I><I>S</I>11,<I>uid</I><I>S</I>11,<I>domain</I><I>S</I>11
11<I>C</I>-><I>A</I>: <I>nonce</I><I>S</I>11,<I>uid</I><I>S</I>11,<I>domain</I><I>S</I>11,<I>uid</I><I>C</I>11,
11<I>factotum</I><I>C</I>11
11<I>A</I>-><I>C</I>: <I>K</I><I>C</I>11{<I>nonce</I><I>S</I>11,<I>uid</I><I>C</I>11,<I>uid</I><I>S</I>,11<I>K</I><I>n</I>11},
11<I>K</I><I>S</I>11{<I>nonce</I><I>S</I>11,<I>uid</I><I>C</I>11,<I>uid</I><I>S</I>,11<I>K</I><I>n</I>11}
11<I>C</I>-><I>S</I>: <I>K</I><I>S</I>11{<I>nonce</I><I>S</I>11,<I>uid</I><I>C</I>11,<I>uid</I><I>S</I>11,<I>K</I><I>n</I>11},
11<I>K</I><I>n</I>11{<I>nonce</I><I>S</I>11,<I>counter</I>}
11<I>S</I>-><I>C</I>: <I>K</I><I>n</I>11{<I>nonce</I><I>C</I>11,<I>counter</I>}
11<I>C</I>-><I>S</I>: <I>uid</I><I>C</I>11
11<I>S</I>-><I>A</I>: <I>nonce</I><I>S</I>11,<I>uid</I><I>S</I>11,<I>domain</I><I>S</I>11,<I>uid</I><I>C</I>11,
11<I>factotum</I><I>S</I>11
11<I>A</I>-><I>S</I>: <I>challenge</I>
11<I>S</I>-><I>C</I>: <I>challenge</I>
11<I>C</I>-><I>S</I>: <I>response</I>
11<I>S</I>-><I>A</I>: <I>response</I>
11<I>A</I>-><I>S</I>: <I>K</I><I>C</I>11{<I>nonce</I><I>S</I>11,<I>uid</I><I>C</I>11,<I>uid</I><I>S</I>,11<I>K</I><I>n</I>11},
11<I>K</I><I>n</I>11{<I>nonce</I><I>C</I>11}
11<I>C</I>-><I>A</I>: <I>uid</I><I>C</I>11
11<I>A</I>-><I>C</I>: <I>K</I><I>c</I>11{<I>K</I><I>n</I>11}
11<I>C</I>-><I>A</I>: <I>K</I><I>n</I>11{<I>password</I><I>old</I>11,<I>password</I><I>new</I>11}
11<I>A</I>-><I>C</I>: <I>OK</I>
v11<I></I><I>n</I>11 11<I>proto</I>111@11<I>domain</I>111 11<I>proto</I>211@11<I>domain</I>211 ...
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 */
}
11<I>C</I>-><I>S</I>: <I>C</I>,<I>g</I>^<I>x</I>11<I>H</I> 11<I>S</I>-><I>C</I>: <I>S</I>,<I>g</I>^<I>y</I>11,<I>hash</I>(<I>g</I>^<I>xy</I>11,<I>C</I>,<I>S</I>) 11<I>C</I>-><I>S</I>: <I>hash</I>(<I>g</I>^<I>xy</I>11,<I>S</I>,<I>C</I>)
int pushtls(int fd, char *hashalg,
char *cryptalg, int isclient,
char *secret, char *dir);
int tlsClient(int fd, TLSconn *conn)