


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='open sesame'
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
%
n(1111<I>P</I><I>S</I>11-><I>F</I><I>S</I>11n(99: start proto=apop role=server n(1111<I>F</I><I>S</I>11-><I>P</I><I>S</I>11n(99: ok n(1111<I>P</I><I>S</I>11-><I>F</I><I>S</I>11n(99: read n(1111<I>F</I><I>S</I>11-><I>P</I><I>S</I>11n(99: ok +OK POP3 <I>challenge</I>
n(1111<I>P</I><I>S</I>11-><I>P</I><I>C</I>11n(99: +OK POP3 <I>challenge</I>
n(1111<I>P</I><I>C</I>11-><I>F</I><I>C</I>11n(99: start proto=apop role=client
server=x.y.com
n(1111<I>F</I><I>C</I>11-><I>P</I><I>C</I>11n(99: ok
n(1111<I>P</I><I>C</I>11-><I>F</I><I>C</I>11n(99: write +OK POP3 <I>challenge</I>
n(1111<I>F</I><I>C</I>11-><I>P</I><I>C</I>11n(99: ok
n(1111<I>P</I><I>C</I>11-><I>F</I><I>C</I>11n(99: read
n(1111<I>F</I><I>C</I>11-><I>P</I><I>C</I>11n(99: ok APOP gre <I>response</I>
n(1111<I>P</I><I>C</I>11-><I>P</I><I>S</I>11n(99: APOP gre <I>response</I>
n(1111<I>P</I><I>S</I>11-><I>F</I><I>S</I>11n(99: write APOP gre <I>response</I> n(1111<I>F</I><I>S</I>11-><I>P</I><I>S</I>11n(99: ok n(1111<I>P</I><I>S</I>11-><I>F</I><I>S</I>11n(99: read n(1111<I>F</I><I>S</I>11-><I>P</I><I>S</I>11n(99: ok +OK welcome n(1111<I>P</I><I>S</I>11-><I>P</I><I>C</I>11n(99: +OK welcome
n(1111<I>P</I><I>S</I>11-><I>F</I><I>S</I>11n(99: authinfo
n(1111<I>F</I><I>S</I>11-><I>P</I><I>S</I>11n(99: ok client=gre
capability=capability
confirm tag=1 attributes
tag=1 answer=yes
n(1111<I>F</I><I>C</I>11-><I>P</I><I>C</I>11n(99: 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)
n(1111<I>C</I>-><I>S</I>: <I>nonce</I><I>C</I>11n(99
n(1111<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>11n(99
n(1111<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,n(99
n(11 11<I>factotum</I><I>C</I>11n(99
n(1111<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},n(99
n(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}n(99
n(1111<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},n(99
n(11 11<I>K</I><I>n</I>11{<I>nonce</I><I>S</I>11,<I>counter</I>}n(99
n(1111<I>S</I>-><I>C</I>: <I>K</I><I>n</I>11{<I>nonce</I><I>C</I>11,<I>counter</I>}n(99
n(1111<I>C</I>-><I>S</I>: <I>nonce</I><I>C</I>11n(99
n(1111<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>11n(99
n(1111<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,n(99
n(11 11<I>hostid</I><I>C</I>11,<I>uid</I><I>C</I>11n(99
n(1111<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},n(99
n(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}n(99
n(1111<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},n(99
n(11 11<I>K</I><I>n</I>11{<I>nonce</I><I>S</I>11}n(99
n(1111<I>S</I>-><I>C</I>: <I>K</I><I>n</I>11{<I>nonce</I><I>C</I>11}n(99
n(1111<I>C</I>-><I>A</I>: <I>uid</I><I>C</I>11n(99
n(1111<I>A</I>-><I>C</I>: <I>K</I><I>c</I>11{<I>K</I><I>n</I>11}n(99
n(1111<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}n(99
n(1111<I>A</I>-><I>C</I>: <I>OK</I>n(99
n(11v.11<I>n</I>n(99 11<I>proto</I>111n(99@11<I>domain</I>111n(99 11<I>proto</I>211n(99@11<I>domain</I>211n(99 ...
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 */
}

n(1111<I>C</I>-><I>S</I>: <I>C</I>,<I>g</I>^<I>x</I>11<I>H</I>n(99 n(1111<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>)n(99 n(1111<I>C</I>-><I>S</I>: <I>hash</I>(<I>g</I>^<I>xy</I>11,<I>S</I>,<I>C</I>)n(99
int pushtls(int fd, char *hashalg,
char *cryptalg, int isclient,
char *secret, char *dir);
int tlsClient(int fd, TLSconn *conn)