2 % * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
3 % * unrestricted use provided that this legend is included on all tape
4 % * media and as a part of the software program in whole or part. Users
5 % * may copy or modify Sun RPC without charge, but are not authorized
6 % * to license or distribute it to anyone else except as part of a product or
7 % * program developed by the user.
9 % * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
10 % * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
11 % * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
13 % * Sun RPC is provided with no support and without any obligation on the
14 % * part of Sun Microsystems, Inc. to assist in its use, correction,
15 % * modification or enhancement.
17 % * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
18 % * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
19 % * OR ANY PART THEREOF.
21 % * In no event will Sun Microsystems, Inc. be liable for any lost revenue
22 % * or profits or other special, indirect and consequential damages, even if
23 % * Sun has been advised of the possibility of such damages.
25 % * Sun Microsystems, Inc.
26 % * 2550 Garcia Avenue
27 % * Mountain View, California 94043
29 % * @(#)key_prot.x 1.7 94/04/29 SMI
30 % * $DragonFly: src/include/rpcsvc/key_prot.x,v 1.2 2003/06/17 04:25:58 dillon Exp $
33 * Key server protocol definition
34 * Copyright (C) 1990, 1991 Sun Microsystems, Inc.
36 * The keyserver is a public key storage/encryption/decryption service
37 * The encryption method used is based on the Diffie-Hellman exponential
38 * key exchange technology.
40 * The key server is local to each machine, akin to the portmapper.
41 * Under TI-RPC, communication with the keyserver is through the
44 * NOTE: This .x file generates the USER level headers for the keyserver.
45 * the KERNEL level headers are created by hand as they kernel has special
50 %/* Copyright (c) 1990, 1991 Sun Microsystems, Inc. */
53 % * Compiled from key_prot.x using rpcgen.
54 % * DO NOT EDIT THIS FILE!
55 % * This is NOT source code!
59 * PROOT and MODULUS define the way the Diffie-Hellman key is generated.
61 * MODULUS should be chosen as a prime of the form: MODULUS == 2*p + 1,
62 * where p is also prime.
64 * PROOT satisfies the following two conditions:
65 * (1) (PROOT ** 2) % MODULUS != 1
66 * (2) (PROOT ** p) % MODULUS != 1
71 const HEXMODULUS = "d4a0ba0250b6fd2ec626e7efd637df76c716e22d0944b88b";
73 const HEXKEYBYTES = 48; /* HEXKEYBYTES == strlen(HEXMODULUS) */
74 const KEYSIZE = 192; /* KEYSIZE == bit length of key */
75 const KEYBYTES = 24; /* byte length of key */
78 * The first 16 hex digits of the encrypted secret key are used as
79 * a checksum in the database.
81 const KEYCHECKSUMSIZE = 16;
87 KEY_SUCCESS, /* no problems */
88 KEY_NOSECRET, /* no secret key stored */
89 KEY_UNKNOWN, /* unknown netname */
90 KEY_SYSTEMERR /* system error (out of memory, encryption failure) */
93 typedef opaque keybuf[HEXKEYBYTES]; /* store key in hex */
95 typedef string netnamestr<MAXNETNAMELEN>;
98 * Argument to ENCRYPT or DECRYPT
101 netnamestr remotename;
106 * Argument to ENCRYPT_PK or DECRYPT_PK
108 struct cryptkeyarg2 {
109 netnamestr remotename;
110 netobj remotekey; /* Contains a length up to 1024 bytes */
116 * Result of ENCRYPT, DECRYPT, ENCRYPT_PK, and DECRYPT_PK
118 union cryptkeyres switch (keystatus status) {
125 const MAXGIDS = 16; /* max number of gids in gid list */
137 * Result returned from GETCRED
139 union getcredres switch (keystatus status) {
149 struct key_netstarg {
152 netnamestr st_netname;
155 union key_netstres switch (keystatus status){
173 * This is my secret key.
180 * I want to talk to X.
181 * Encrypt a conversation key for me.
184 KEY_ENCRYPT(cryptkeyarg) = 2;
187 * X just sent me a message.
188 * Decrypt the conversation key for me.
191 KEY_DECRYPT(cryptkeyarg) = 3;
194 * Generate a secure conversation key for me
200 * Get me the uid, gid and group-access-list associated
201 * with this netname (for kernel which cannot use NIS)
204 KEY_GETCRED(netnamestr) = 5;
210 * Procedures 1-5 are identical to version 1
215 * This is my secret key.
222 * I want to talk to X.
223 * Encrypt a conversation key for me.
226 KEY_ENCRYPT(cryptkeyarg) = 2;
229 * X just sent me a message.
230 * Decrypt the conversation key for me.
233 KEY_DECRYPT(cryptkeyarg) = 3;
236 * Generate a secure conversation key for me
242 * Get me the uid, gid and group-access-list associated
243 * with this netname (for kernel which cannot use NIS)
246 KEY_GETCRED(netnamestr) = 5;
249 * I want to talk to X. and I know X's public key
250 * Encrypt a conversation key for me.
253 KEY_ENCRYPT_PK(cryptkeyarg2) = 6;
256 * X just sent me a message. and I know X's public key
257 * Decrypt the conversation key for me.
260 KEY_DECRYPT_PK(cryptkeyarg2) = 7;
263 * Store my public key, netname and private key.
266 KEY_NET_PUT(key_netstarg) = 8;
269 * Retrieve my public key, netname and private key.
272 KEY_NET_GET(void) = 9;
275 * Return me the conversation key that is constructed
276 * from my secret key and this publickey.
280 KEY_GET_CONV(keybuf) = 10;