]> git.ipfire.org Git - thirdparty/glibc.git/blob - sunrpc/rpc/auth_des.h
Update.
[thirdparty/glibc.git] / sunrpc / rpc / auth_des.h
1 /* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
8
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB. If not,
16 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. */
18
19 #ifndef _RPC_AUTH_DES_H
20 #define _RPC_AUTH_DES_H 1
21
22 #include <sys/cdefs.h>
23 #include <rpc/auth.h>
24
25 __BEGIN_DECLS
26
27 /* There are two kinds of "names": fullnames and nicknames */
28 enum authdes_namekind
29 {
30 ADN_FULLNAME,
31 ADN_NICKNAME
32 };
33
34 /* A fullname contains the network name of the client,
35 a conversation key and the window */
36 struct authdes_fullname
37 {
38 char *name; /* network name of client, up to MAXNETNAMELEN */
39 des_block key; /* conversation key */
40 u_long window; /* associated window */
41 };
42
43 /* A credential */
44 struct authdes_cred
45 {
46 enum authdes_namekind adc_namekind;
47 struct authdes_fullname adc_fullname;
48 u_long adc_nickname;
49 };
50
51 /* A des authentication verifier */
52 struct authdes_verf
53 {
54 union
55 {
56 struct timeval adv_ctime; /* clear time */
57 des_block adv_xtime; /* crypt time */
58 }
59 adv_time_u;
60 u_long adv_int_u;
61 };
62
63 /* des authentication verifier: client variety
64
65 adv_timestamp is the current time.
66 adv_winverf is the credential window + 1.
67 Both are encrypted using the conversation key. */
68 #define adv_timestamp adv_time_u.adv_ctime
69 #define adv_xtimestamp adv_time_u.adv_xtime
70 #define adv_winverf adv_int_u
71
72 /* des authentication verifier: server variety
73
74 adv_timeverf is the client's timestamp + client's window
75 adv_nickname is the server's nickname for the client.
76 adv_timeverf is encrypted using the conversation key. */
77 #define adv_timeverf adv_time_u.adv_ctime
78 #define adv_xtimeverf adv_time_u.adv_xtime
79 #define adv_nickname adv_int_u
80
81 /* Map a des credential into a unix cred. */
82 extern int authdes_getucred __P ((__const struct authdes_cred * __adc,
83 uid_t * __uid, gid_t * __gid,
84 short *__grouplen, gid_t * __groups));
85
86 /* Get the public key for NAME and place it in KEY. NAME can only be
87 up to MAXNETNAMELEN bytes long and the destination buffer KEY should
88 have HEXKEYBYTES + 1 bytes long to fit all characters from the key. */
89 extern int getpublickey __P ((__const char *__name, char *__key));
90
91 /* Get the secret key for NAME and place it in KEY. PASSWD is used to
92 decrypt the encrypted key stored in the database. NAME can only be
93 up to MAXNETNAMELEN bytes long and the destination buffer KEY
94 should have HEXKEYBYTES + 1 bytes long to fit all characters from
95 the key. */
96 extern int getsecretkey __P ((__const char *__name, char *__key,
97 __const char *__passwd));
98
99 extern int rtime __P ((struct sockaddr_in *__addrp, struct timeval *__timep,
100 struct timeval *__timeout));
101
102 __END_DECLS
103
104
105 #endif /* rpc/auth_des.h */