add others
This commit is contained in:
parent
ce94dbe662
commit
57fcfc2a0b
16 changed files with 1185 additions and 0 deletions
34
src/cmd/auth/respond.c
Normal file
34
src/cmd/auth/respond.c
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#include <u.h>
|
||||
#include <libc.h>
|
||||
#include <auth.h>
|
||||
|
||||
void
|
||||
usage(void)
|
||||
{
|
||||
fprint(2, "usage: auth/respond 'params' chal\n");
|
||||
exits("usage");
|
||||
}
|
||||
|
||||
void
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
char buf[128];
|
||||
int n;
|
||||
|
||||
ARGBEGIN{
|
||||
default:
|
||||
usage();
|
||||
}ARGEND
|
||||
|
||||
if(argc != 2)
|
||||
usage();
|
||||
|
||||
memset(buf, 0, sizeof buf);
|
||||
n = auth_respond(argv[1], strlen(argv[1]), buf, sizeof buf-1, auth_getkey, "%s", argv[0]);
|
||||
if(n < 0)
|
||||
sysfatal("auth_respond: %r");
|
||||
write(1, buf, n);
|
||||
print("\n");
|
||||
}
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue