1RPC(3) BSD Library Functions Manual RPC(3)
2
4 rpc_secure — library routines for secure remote procedure calls
5
7 #include <rpc/rpc.h>
8
9 AUTH *
10 authdes_create(char *name, unsigned window, struct sockaddr *addr,
11 des_block *ckey);
12
13 AUTH *
14 authdes_pk_create(char *name, netobj *publickey, unsigned window,
15 struct sockaddr *addr, des_block *ckey);
16
17 int
18 authdes_getucred(struct authdes_cred *adc, uid_t *uid, gid_t *gid,
19 int *grouplen, gid_t *groups);
20
21 int
22 getnetname(char *name);
23
24 int
25 host2netname(char *name, const char *host, const char *domain);
26
27 int
28 key_decryptsession(const char *remotename, des_block *deskey);
29
30 int
31 key_encryptsession(const char *remotename, des_block *deskey);
32
33 int
34 key_gendes(des_block *deskey);
35
36 int
37 key_setsecret(const char *key);
38
39 int
40 netname2host(char *name, char *host, int hostlen);
41
42 int
43 netname2user(char *name, uid_t *uidp, gid_t *gidp, int *gidlenp,
44 gid_t *gidlist);
45
46 int
47 user2netname(char *name, const uid_t uid, const char *domain);
48
50 These routines are part of the RPC library. They implement DES Authenti‐
51 cation. See rpc(3) for further details about RPC.
52
53 The authdes_create() is the first of two routines which interface to the
54 RPC secure authentication system, known as DES authentication. The sec‐
55 ond is authdes_getucred(), below.
56
57 Note: the keyserver daemon keyserv(8) must be running for the DES authen‐
58 tication system to work.
59
60 The authdes_create() function, used on the client side, returns an
61 authentication handle that will enable the use of the secure authentica‐
62 tion system. The first argument name is the network name, or netname, of
63 the owner of the server process. This field usually represents a
64 hostname derived from the utility routine host2netname(), but could also
65 represent a user name using user2netname(). The second field is window
66 on the validity of the client credential, given in seconds. A small win‐
67 dow is more secure than a large one, but choosing too small of a window
68 will increase the frequency of resynchronizations because of clock drift.
69 The third argument addr is optional. If it is NULL, then the authentica‐
70 tion system will assume that the local clock is always in sync with the
71 server's clock, and will not attempt resynchronizations. If an address
72 is supplied, however, then the system will use the address for consulting
73 the remote time service whenever resynchronization is required. This
74 argument is usually the address of the RPC server itself. The final
75 argument ckey is also optional. If it is NULL, then the authentication
76 system will generate a random DES key to be used for the encryption of
77 credentials. If it is supplied, however, then it will be used instead.
78
79 The authdes_pk_create() function is identical to authdes_create(), except
80 that the public key