May 2024 | ||||||
Mo | Tu | We | Th | Fr | Sa | Su |
29 | 30 | 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 | 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 |
001: /* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. 002: This file is part of the GNU C Library. 003: 004: The GNU C Library is free software; you can redistribute it and/or 005: modify it under the terms of the GNU Lesser General Public 006: License as published by the Free Software Foundation; either 007: version 2.1 of the License, or (at your option) any later version. 008: 009: The GNU C Library is distributed in the hope that it will be useful, 010: but WITHOUT ANY WARRANTY; without even the implied warranty of 011: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 012: Lesser General Public License for more details. 013: 014: You should have received a copy of the GNU Lesser General Public 015: License along with the GNU C Library; if not, write to the Free 016: Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 017: 02111-1307 USA. */ 018: 019: #ifndef _RPC_AUTH_DES_H 020: #define _RPC_AUTH_DES_H 1 021: 022: #include <sys/cdefs.h> 023: #include <rpc/auth.h> 024: 025: __BEGIN_DECLS 026: 027: /* There are two kinds of "names": fullnames and nicknames */ 028: enum authdes_namekind 029: { 030: ADN_FULLNAME, 031: ADN_NICKNAME 032: }; 033: 034: /* A fullname contains the network name of the client, 035: a conversation key and the window */ 036: struct authdes_fullname 037: { 038: char *name; /* network name of client, up to MAXNETNAMELEN */ 039: des_block key; /* conversation key */ 040: uint32_t window; /* associated window */ 041: }; 042: 043: /* A credential */ 044: struct authdes_cred 045: { 046: enum authdes_namekind adc_namekind; 047: struct authdes_fullname adc_fullname; 048: uint32_t adc_nickname; 049: }; 050: 051: /* A timeval replacement for !32bit platforms */ 052: struct rpc_timeval 053: { 054: uint32_t tv_sec; /* Seconds. */ 055: uint32_t tv_usec; /* Microseconds. */ 056: }; 057: 058: /* A des authentication verifier */ 059: struct authdes_verf 060: { 061: union 062: { 063: struct rpc_timeval adv_ctime; /* clear time */ 064: des_block adv_xtime; /* crypt time */ 065: } 066: adv_time_u; 067: uint32_t adv_int_u; 068: }; 069: 070: /* des authentication verifier: client variety 071: 072: adv_timestamp is the current time. 073: adv_winverf is the credential window + 1. 074: Both are encrypted using the conversation key. */ 075: #define adv_timestamp adv_time_u.adv_ctime 076: #define adv_xtimestamp adv_time_u.adv_xtime 077: #define adv_winverf adv_int_u 078: 079: /* des authentication verifier: server variety 080: 081: adv_timeverf is the client's timestamp + client's window 082: adv_nickname is the server's nickname for the client. 083: adv_timeverf is encrypted using the conversation key. */ 084: #define adv_timeverf adv_time_u.adv_ctime 085: #define adv_xtimeverf adv_time_u.adv_xtime 086: #define adv_nickname adv_int_u 087: 088: /* Map a des credential into a unix cred. */ 089: extern int authdes_getucred (__const struct authdes_cred * __adc, 090: uid_t * __uid, gid_t * __gid, 091: short *__grouplen, gid_t * __groups) __THROW; 092: 093: /* Get the public key for NAME and place it in KEY. NAME can only be 094: up to MAXNETNAMELEN bytes long and the destination buffer KEY should 095: have HEXKEYBYTES + 1 bytes long to fit all characters from the key. */ 096: extern int getpublickey (__const char *__name, char *__key) __THROW; 097: 098: /* Get the secret key for NAME and place it in KEY. PASSWD is used to 099: decrypt the encrypted key stored in the database. NAME can only be 100: up to MAXNETNAMELEN bytes long and the destination buffer KEY 101: should have HEXKEYBYTES + 1 bytes long to fit all characters from 102: the key. */ 103: extern int getsecretkey (__const char *__name, char *__key, 104: __const char *__passwd) __THROW; 105: 106: extern int rtime (struct sockaddr_in *__addrp, struct rpc_timeval *__timep, 107: struct rpc_timeval *__timeout) __THROW; 108: 109: __END_DECLS 110: 111: 112: #endif /* rpc/auth_des.h */ 113: