1 .\" @(#)rpc_secure.3n 2.1 88/08/08 4.0 RPCSRC; from 1.19 88/06/24 SMI
2 .\" $FreeBSD: src/lib/libc/rpc/rpc_secure.3,v 1.6.2.5 2001/12/14 18:33:57 ru Exp $
3 .\" $DragonFly: src/lib/libc/rpc/rpc_secure.3,v 1.4 2007/11/23 23:16:36 swildner Exp $
10 .Nd library routines for secure remote procedure calls
19 .Fa "struct sockaddr *addr"
23 .Fn authdes_getucred "struct authdes_cred *adc" "uid_t *uid" "gid_t *gid" "int *grouplen" "gid_t *groups"
25 .Fn getnetname "char *name"
27 .Fn host2netname "char *name" "char *host" "char *domain"
29 .Fn key_decryptsession "const char *remotename" "des_block *deskey"
31 .Fn key_encryptsession "const char *remotename" "des_block *deskey"
33 .Fn key_gendes "des_block *deskey"
35 .Fn key_setsecret "const char *key"
37 .Fn netname2host "char *name" "char *host" "int hostlen"
39 .Fn netname2user "char *name" "uid_t *uidp" "gid_t *gidp" "int *gidlenp" "gid_t *gidlist"
41 .Fn user2netname "char *name" "uid_t uid" "char *domain"
43 These routines are part of the
45 library. They implement
49 for further details about
54 is the first of two routines which interface to the
56 secure authentication system, known as
60 .Fn authdes_getucred ,
63 Note: the keyserver daemon
65 must be running for the
67 authentication system to work.
70 used on the client side, returns an authentication handle that
71 will enable the use of the secure authentication system.
74 is the network name, or
76 of the owner of the server process.
80 derived from the utility routine
82 but could also represent a user name using
84 The second field is window on the validity of
85 the client credential, given in seconds. A small
86 window is more secure than a large one, but choosing
87 too small of a window will increase the frequency of
88 resynchronizations because of clock drift.
94 then the authentication system will assume
95 that the local clock is always in sync with the server's
96 clock, and will not attempt resynchronizations.
98 is supplied, however, then the system will use the address
99 for consulting the remote time service whenever
102 This parameter is usually the
108 is also optional. If it is
110 then the authentication system will
113 key to be used for the encryption of credentials.
114 If it is supplied, however, then it will be used instead.
116 .Fn Authdes_getucred ,
117 the second of the two
119 authentication routines,
120 is used on the server side for converting a
123 operating system independent, into a
126 This routine differs from utility routine
130 pulls its information from a cache, and does not have to do a
131 Yellow Pages lookup every time it is called to get its information.
134 installs the unique, operating-system independent netname of
136 caller in the fixed-length array
145 converts from a domain-specific hostname to an
146 operating-system independent netname.
155 .Fn Key_decryptsession
156 is an interface to the keyserver daemon, which is associated
159 secure authentication system
162 User programs rarely need to call it, or its associated routines
163 .Fn key_encryptsession ,
167 System commands such as
171 library are the main clients of these four routines.
173 .Fn Key_decryptsession
174 takes a server netname and a
176 key, and decrypts the key by
177 using the public key of the server and the secret key
178 associated with the effective uid of the calling process. It
180 .Fn key_encryptsession .
182 .Fn Key_encryptsession
183 is a keyserver interface routine.
185 takes a server netname and a des key, and encrypts
186 it using the public key of the server and the secret key
187 associated with the effective uid of the calling process. It
189 .Fn key_decryptsession .
192 is a keyserver interface routine.
194 is used to ask the keyserver for a secure conversation key.
197 is usually not good enough,
199 the common ways of choosing random numbers, such as using the
200 current time, are very easy to guess.
203 is a keyserver interface routine.
204 It is used to set the key for
207 of the calling process.
210 converts from an operating-system independent netname to a
211 domain-specific hostname.
216 if it fails. Inverse of
220 converts from an operating-system independent netname to a
221 domain-specific user ID.
231 converts from a domain-specific username to an operating-system
245 The following manuals:
247 .%B Remote Procedure Calls: Protocol Specification
250 .%B Remote Procedure Call Programming Guide
253 .%B Rpcgen Programming Guide
256 .%B RPC: Remote Procedure Call Protocol Specification
257 .%O RFC 1050, Sun Microsystems Inc., USC-ISI