1 /* Copyright (c) 1990, 1991 Sun Microsystems, Inc.
3 * Redistribution and use in source and binary forms, with or without
4 * modification, are permitted provided that the following conditions are
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above
10 * copyright notice, this list of conditions and the following
11 * disclaimer in the documentation and/or other materials
12 * provided with the distribution.
13 * * Neither the name of Sun Microsystems, Inc. nor the names of its
14 * contributors may be used to endorse or promote products derived
15 * from this software without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
20 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
21 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
22 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 #include "rpc/key_prot.h"
34 xdr_keystatus (XDR
* xdrs
, keystatus
* objp
)
36 if (!INTUSE(xdr_enum
) (xdrs
, (enum_t
*) objp
))
44 xdr_keybuf (XDR
* xdrs
, keybuf objp
)
46 if (!INTUSE(xdr_opaque
) (xdrs
, objp
, HEXKEYBYTES
))
54 xdr_netnamestr (XDR
* xdrs
, netnamestr
* objp
)
56 if (!INTUSE(xdr_string
) (xdrs
, objp
, MAXNETNAMELEN
))
61 INTDEF(xdr_netnamestr
)
64 xdr_cryptkeyarg (XDR
* xdrs
, cryptkeyarg
* objp
)
66 if (!INTUSE(xdr_netnamestr
) (xdrs
, &objp
->remotename
))
69 if (!INTUSE(xdr_des_block
) (xdrs
, &objp
->deskey
))
74 INTDEF(xdr_cryptkeyarg
)
77 xdr_cryptkeyarg2 (XDR
* xdrs
, cryptkeyarg2
* objp
)
79 if (!INTUSE(xdr_netnamestr
) (xdrs
, &objp
->remotename
))
81 if (!INTUSE(xdr_netobj
) (xdrs
, &objp
->remotekey
))
83 if (!INTUSE(xdr_des_block
) (xdrs
, &objp
->deskey
))
87 INTDEF(xdr_cryptkeyarg2
)
90 xdr_cryptkeyres (XDR
* xdrs
, cryptkeyres
* objp
)
92 if (!INTUSE(xdr_keystatus
) (xdrs
, &objp
->status
))
97 if (!INTUSE(xdr_des_block
) (xdrs
, &objp
->cryptkeyres_u
.deskey
))
105 INTDEF(xdr_cryptkeyres
)
108 xdr_unixcred (XDR
* xdrs
, unixcred
* objp
)
110 if (!INTUSE(xdr_u_int
) (xdrs
, &objp
->uid
))
112 if (!INTUSE(xdr_u_int
) (xdrs
, &objp
->gid
))
114 if (!INTUSE(xdr_array
) (xdrs
, (void *) &objp
->gids
.gids_val
,
115 (u_int
*) & objp
->gids
.gids_len
, MAXGIDS
,
116 sizeof (u_int
), (xdrproc_t
) INTUSE(xdr_u_int
)))
123 xdr_getcredres (XDR
* xdrs
, getcredres
* objp
)
125 if (!INTUSE(xdr_keystatus
) (xdrs
, &objp
->status
))
127 switch (objp
->status
)
130 if (!INTUSE(xdr_unixcred
) (xdrs
, &objp
->getcredres_u
.cred
))
140 xdr_key_netstarg (XDR
* xdrs
, key_netstarg
* objp
)
142 if (!INTUSE(xdr_keybuf
) (xdrs
, objp
->st_priv_key
))
144 if (!INTUSE(xdr_keybuf
) (xdrs
, objp
->st_pub_key
))
146 if (!INTUSE(xdr_netnamestr
) (xdrs
, &objp
->st_netname
))
150 INTDEF(xdr_key_netstarg
)
153 xdr_key_netstres (XDR
* xdrs
, key_netstres
* objp
)
155 if (!INTUSE(xdr_keystatus
) (xdrs
, &objp
->status
))
157 switch (objp
->status
)
160 if (!INTUSE(xdr_key_netstarg
) (xdrs
, &objp
->key_netstres_u
.knet
))
168 INTDEF(xdr_key_netstres
)