1e8636dfdSBill Paul #if defined(LIBC_SCCS) && !defined(lint) 2e8636dfdSBill Paul static char sccsid[] = "@(#)authdes_prot.c 2.1 88/07/29 4.0 RPCSRC; from 1.6 88/02/08 SMI"; 3e8636dfdSBill Paul #endif 4d3d20c82SDavid E. O'Brien #include <sys/cdefs.h> 5d3d20c82SDavid E. O'Brien __FBSDID("$FreeBSD$"); 6d3d20c82SDavid E. O'Brien 7e8636dfdSBill Paul /* 8e8636dfdSBill Paul * Sun RPC is a product of Sun Microsystems, Inc. and is provided for 9e8636dfdSBill Paul * unrestricted use provided that this legend is included on all tape 10e8636dfdSBill Paul * media and as a part of the software program in whole or part. Users 11e8636dfdSBill Paul * may copy or modify Sun RPC without charge, but are not authorized 12e8636dfdSBill Paul * to license or distribute it to anyone else except as part of a product or 13e8636dfdSBill Paul * program developed by the user. 14e8636dfdSBill Paul * 15e8636dfdSBill Paul * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE 16e8636dfdSBill Paul * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR 17e8636dfdSBill Paul * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. 18e8636dfdSBill Paul * 19e8636dfdSBill Paul * Sun RPC is provided with no support and without any obligation on the 20e8636dfdSBill Paul * part of Sun Microsystems, Inc. to assist in its use, correction, 21e8636dfdSBill Paul * modification or enhancement. 22e8636dfdSBill Paul * 23e8636dfdSBill Paul * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE 24e8636dfdSBill Paul * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC 25e8636dfdSBill Paul * OR ANY PART THEREOF. 26e8636dfdSBill Paul * 27e8636dfdSBill Paul * In no event will Sun Microsystems, Inc. be liable for any lost revenue 28e8636dfdSBill Paul * or profits or other special, indirect and consequential damages, even if 29e8636dfdSBill Paul * Sun has been advised of the possibility of such damages. 30e8636dfdSBill Paul * 31e8636dfdSBill Paul * Sun Microsystems, Inc. 32e8636dfdSBill Paul * 2550 Garcia Avenue 33e8636dfdSBill Paul * Mountain View, California 94043 34e8636dfdSBill Paul */ 35e8636dfdSBill Paul /* 368360efbdSAlfred Perlstein * Copyright (c) 1986-1991 by Sun Microsystems Inc. 37e8636dfdSBill Paul */ 38e8636dfdSBill Paul 39e8636dfdSBill Paul /* 40e8636dfdSBill Paul * authdes_prot.c, XDR routines for DES authentication 41e8636dfdSBill Paul */ 42e8636dfdSBill Paul 438360efbdSAlfred Perlstein #include "namespace.h" 44e8636dfdSBill Paul #include <rpc/types.h> 45e8636dfdSBill Paul #include <rpc/xdr.h> 46e8636dfdSBill Paul #include <rpc/auth.h> 47e8636dfdSBill Paul #include <rpc/auth_des.h> 488360efbdSAlfred Perlstein #include "un-namespace.h" 49e8636dfdSBill Paul 50e8636dfdSBill Paul #define ATTEMPT(xdr_op) if (!(xdr_op)) return (FALSE) 51e8636dfdSBill Paul 52e8636dfdSBill Paul bool_t 53e8636dfdSBill Paul xdr_authdes_cred(xdrs, cred) 54e8636dfdSBill Paul XDR *xdrs; 55e8636dfdSBill Paul struct authdes_cred *cred; 56e8636dfdSBill Paul { 57102c7c92SJohn Birrell enum authdes_namekind *padc_namekind = &cred->adc_namekind; 58e8636dfdSBill Paul /* 59e8636dfdSBill Paul * Unrolled xdr 60e8636dfdSBill Paul */ 61102c7c92SJohn Birrell ATTEMPT(xdr_enum(xdrs, (enum_t *) padc_namekind)); 62e8636dfdSBill Paul switch (cred->adc_namekind) { 63e8636dfdSBill Paul case ADN_FULLNAME: 648360efbdSAlfred Perlstein ATTEMPT(xdr_string(xdrs, &cred->adc_fullname.name, 658360efbdSAlfred Perlstein MAXNETNAMELEN)); 668360efbdSAlfred Perlstein ATTEMPT(xdr_opaque(xdrs, (caddr_t)&cred->adc_fullname.key, 678360efbdSAlfred Perlstein sizeof(des_block))); 688360efbdSAlfred Perlstein ATTEMPT(xdr_opaque(xdrs, (caddr_t)&cred->adc_fullname.window, 698360efbdSAlfred Perlstein sizeof(cred->adc_fullname.window))); 70e8636dfdSBill Paul return (TRUE); 71e8636dfdSBill Paul case ADN_NICKNAME: 728360efbdSAlfred Perlstein ATTEMPT(xdr_opaque(xdrs, (caddr_t)&cred->adc_nickname, 738360efbdSAlfred Perlstein sizeof(cred->adc_nickname))); 74e8636dfdSBill Paul return (TRUE); 75e8636dfdSBill Paul default: 76e8636dfdSBill Paul return (FALSE); 77e8636dfdSBill Paul } 78e8636dfdSBill Paul } 79e8636dfdSBill Paul 80e8636dfdSBill Paul 81e8636dfdSBill Paul bool_t 82e8636dfdSBill Paul xdr_authdes_verf(xdrs, verf) 838fb3f3f6SDavid E. O'Brien XDR *xdrs; 848fb3f3f6SDavid E. O'Brien struct authdes_verf *verf; 85e8636dfdSBill Paul { 86e8636dfdSBill Paul /* 87e8636dfdSBill Paul * Unrolled xdr 88e8636dfdSBill Paul */ 898360efbdSAlfred Perlstein ATTEMPT(xdr_opaque(xdrs, (caddr_t)&verf->adv_xtimestamp, 908360efbdSAlfred Perlstein sizeof(des_block))); 918360efbdSAlfred Perlstein ATTEMPT(xdr_opaque(xdrs, (caddr_t)&verf->adv_int_u, 928360efbdSAlfred Perlstein sizeof(verf->adv_int_u))); 93e8636dfdSBill Paul return (TRUE); 94e8636dfdSBill Paul } 95