xref: /inferno-os/module/security.m (revision 46439007cf417cbd9ac8049bb4122c890097a0fa)
1#
2#  security routines implemented in limbo
3#
4
5
6Virgil: module
7{
8	PATH:	con "/dis/lib/virgil.dis";
9
10	virgil:	fn(args: list of string): string;
11};
12
13Random: module
14{
15	PATH:	con "/dis/lib/random.dis";
16
17	ReallyRandom:	con 0;
18	NotQuiteRandom:	con 1;
19
20	randomint: fn(which: int): int;
21	randombuf: fn(which, n: int): array of byte;
22};
23
24#
25#  secure socket layer emulator
26#
27SSL: module
28{
29	PATH:	con "/dis/lib/ssl.dis";
30
31	connect: fn(fd: ref Sys->FD): (string, ref Sys->Connection);
32	secret: fn(c: ref Sys->Connection, secretin, secretout: array of byte): string;
33};
34
35
36#
37#  Encrypted Key Exchange protocol
38#
39Login: module
40{
41	PATH:	con "/dis/lib/login.dis";
42
43	login:	fn(id, password, dest: string): (string, ref Keyring->Authinfo);
44};
45
46#
47#  Station To Station protocol
48#
49Auth: module
50{
51	PATH:	con "/dis/lib/auth.dis";
52
53	init: fn(): string;
54	server: fn(algs: list of string, ai: ref Keyring->Authinfo, fd: ref Sys->FD, setid: int): (ref Sys->FD, string);
55	client: fn(alg: string, ai: ref Keyring->Authinfo, fd: ref Sys->FD): (ref Sys->FD, string);
56	auth:	fn(ai: ref Keyring->Authinfo, keyspec: string, alg: string, dfd: ref Sys->FD): (ref Sys->FD, ref Keyring->Authinfo, string);
57	keyfile:	fn(keyspec: string): string;
58	key:	fn(keyspec: string): ref Keyring->Authinfo;
59};
60