hard code list of plan 9 services in case they are not in /etc/services
This commit is contained in:
parent
26a5fd5725
commit
b589fce2fb
8 changed files with 300 additions and 8 deletions
18
src/lib9/netcrypt.c
Normal file
18
src/lib9/netcrypt.c
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#include <u.h>
|
||||
#include <libc.h>
|
||||
#include <auth.h>
|
||||
|
||||
int
|
||||
netcrypt(void *key, void *chal)
|
||||
{
|
||||
uchar buf[8], *p;
|
||||
|
||||
strncpy((char*)buf, chal, 7);
|
||||
buf[7] = '\0';
|
||||
for(p = buf; *p && *p != '\n'; p++)
|
||||
;
|
||||
*p = '\0';
|
||||
encrypt(key, buf, 8);
|
||||
sprint(chal, "%.2ux%.2ux%.2ux%.2ux", buf[0], buf[1], buf[2], buf[3]);
|
||||
return 1;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue