mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-11-09 08:37:58 +08:00
Remove (Unused, obsolete).
This commit is contained in:
1 parent
f724f4f4dc
commit
ce1c8ea42e
12 files changed
-3899
No files matched your search
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,82 +0,0 @@
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
static char sccsid[] = "@(#)authdes_prot.c 2.1 88/07/29 4.0 RPCSRC; from 1.6 88/02/08 SMI";
|
||||
#endif
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
* unrestricted use provided that this legend is included on all tape
|
||||
* media and as a part of the software program in whole or part. Users
|
||||
* may copy or modify Sun RPC without charge, but are not authorized
|
||||
* to license or distribute it to anyone else except as part of a product or
|
||||
* program developed by the user.
|
||||
*
|
||||
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
|
||||
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
|
||||
*
|
||||
* Sun RPC is provided with no support and without any obligation on the
|
||||
* part of Sun Microsystems, Inc. to assist in its use, correction,
|
||||
* modification or enhancement.
|
||||
*
|
||||
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
|
||||
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
|
||||
* OR ANY PART THEREOF.
|
||||
*
|
||||
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
|
||||
* or profits or other special, indirect and consequential damages, even if
|
||||
* Sun has been advised of the possibility of such damages.
|
||||
*
|
||||
* Sun Microsystems, Inc.
|
||||
* 2550 Garcia Avenue
|
||||
* Mountain View, California 94043
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 1988 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
/*
|
||||
* authdes_prot.c, XDR routines for DES authentication
|
||||
*/
|
||||
|
||||
#include <rpc/types.h>
|
||||
#include <rpc/xdr.h>
|
||||
#include <rpc/auth.h>
|
||||
#include <rpc/auth_des.h>
|
||||
|
||||
#define ATTEMPT(xdr_op) if (!(xdr_op)) return (FALSE)
|
||||
|
||||
bool_t
|
||||
xdr_authdes_cred(xdrs, cred)
|
||||
XDR *xdrs;
|
||||
struct authdes_cred *cred;
|
||||
{
|
||||
/*
|
||||
* Unrolled xdr
|
||||
*/
|
||||
ATTEMPT(xdr_enum(xdrs, (enum_t *)&cred->adc_namekind));
|
||||
switch (cred->adc_namekind) {
|
||||
case ADN_FULLNAME:
|
||||
ATTEMPT(xdr_string(xdrs, &cred->adc_fullname.name, MAXNETNAMELEN));
|
||||
ATTEMPT(xdr_opaque(xdrs, (caddr_t)&cred->adc_fullname.key, sizeof(des_block)));
|
||||
ATTEMPT(xdr_opaque(xdrs, (caddr_t)&cred->adc_fullname.window, sizeof(cred->adc_fullname.window)));
|
||||
return (TRUE);
|
||||
case ADN_NICKNAME:
|
||||
ATTEMPT(xdr_opaque(xdrs, (caddr_t)&cred->adc_nickname, sizeof(cred->adc_nickname)));
|
||||
return (TRUE);
|
||||
default:
|
||||
return (FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool_t
|
||||
xdr_authdes_verf(xdrs, verf)
|
||||
register XDR *xdrs;
|
||||
register struct authdes_verf *verf;
|
||||
{
|
||||
/*
|
||||
* Unrolled xdr
|
||||
*/
|
||||
ATTEMPT(xdr_opaque(xdrs, (caddr_t)&verf->adv_xtimestamp, sizeof(des_block)));
|
||||
ATTEMPT(xdr_opaque(xdrs, (caddr_t)&verf->adv_int_u, sizeof(verf->adv_int_u)));
|
||||
return (TRUE);
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,90 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1996
|
||||
* Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by Bill Paul.
|
||||
* 4. Neither the name of the author nor the names of any co-contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD: src/lib/libc/rpc/crypt_client.c,v 1.4 1999/08/28 00:00:37 peter Exp $
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <rpc/des_crypt.h>
|
||||
#include <rpc/des.h>
|
||||
#include <string.h>
|
||||
#include <rpcsvc/crypt.h>
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] = "$FreeBSD: src/lib/libc/rpc/crypt_client.c,v 1.4 1999/08/28 00:00:37 peter Exp $";
|
||||
#endif
|
||||
|
||||
#ifndef KEYSERVSOCK
|
||||
#define KEYSERVSOCK "/var/run/keyservsock"
|
||||
#endif
|
||||
|
||||
int
|
||||
_des_crypt_call(buf, len, dparms)
|
||||
char *buf;
|
||||
int len;
|
||||
struct desparams *dparms;
|
||||
{
|
||||
CLIENT *clnt;
|
||||
desresp *result_1;
|
||||
desargs des_crypt_1_arg;
|
||||
int stat;
|
||||
|
||||
clnt = clnt_create(KEYSERVSOCK, CRYPT_PROG, CRYPT_VERS, "unix");
|
||||
if (clnt == (CLIENT *) NULL) {
|
||||
return(DESERR_HWERROR);
|
||||
}
|
||||
|
||||
des_crypt_1_arg.desbuf.desbuf_len = len;
|
||||
des_crypt_1_arg.desbuf.desbuf_val = buf;
|
||||
des_crypt_1_arg.des_dir = dparms->des_dir;
|
||||
des_crypt_1_arg.des_mode = dparms->des_mode;
|
||||
bcopy(dparms->des_ivec, des_crypt_1_arg.des_ivec, 8);
|
||||
bcopy(dparms->des_key, des_crypt_1_arg.des_key, 8);
|
||||
|
||||
result_1 = des_crypt_1(&des_crypt_1_arg, clnt);
|
||||
if (result_1 == (desresp *) NULL) {
|
||||
clnt_destroy(clnt);
|
||||
return(DESERR_HWERROR);
|
||||
}
|
||||
|
||||
stat = result_1->stat;
|
||||
|
||||
if (result_1->stat == DESERR_NONE ||
|
||||
result_1->stat == DESERR_NOHWDEVICE) {
|
||||
bcopy(result_1->desbuf.desbuf_val, buf, len);
|
||||
bcopy(result_1->des_ivec, dparms->des_ivec, 8);
|
||||
}
|
||||
|
||||
clnt_freeres(clnt, xdr_desresp, (char *)result_1);
|
||||
clnt_destroy(clnt);
|
||||
|
||||
return(stat);
|
||||
}
|
||||
@@ -1,153 +0,0 @@
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
* unrestricted use provided that this legend is included on all tape
|
||||
* media and as a part of the software program in whole or part. Users
|
||||
* may copy or modify Sun RPC without charge, but are not authorized
|
||||
* to license or distribute it to anyone else except as part of a product or
|
||||
* program developed by the user.
|
||||
*
|
||||
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
|
||||
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
|
||||
*
|
||||
* Sun RPC is provided with no support and without any obligation on the
|
||||
* part of Sun Microsystems, Inc. to assist in its use, correction,
|
||||
* modification or enhancement.
|
||||
*
|
||||
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
|
||||
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
|
||||
* OR ANY PART THEREOF.
|
||||
*
|
||||
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
|
||||
* or profits or other special, indirect and consequential damages, even if
|
||||
* Sun has been advised of the possibility of such damages.
|
||||
*
|
||||
* Sun Microsystems, Inc.
|
||||
* 2550 Garcia Avenue
|
||||
* Mountain View, California 94043
|
||||
*/
|
||||
/*
|
||||
* des_crypt.c, DES encryption library routines
|
||||
* Copyright (C) 1986, Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <rpc/des_crypt.h>
|
||||
#include <rpc/des.h>
|
||||
|
||||
#ifndef lint
|
||||
/* from: static char sccsid[] = "@(#)des_crypt.c 2.2 88/08/10 4.0 RPCSRC; from 1.13 88/02/08 SMI"; */
|
||||
static const char rcsid[] = "$FreeBSD: src/lib/libc/rpc/des_crypt.c,v 1.3 1999/08/28 00:00:38 peter Exp $";
|
||||
#endif
|
||||
|
||||
static int common_crypt __P(( char *, char *, register unsigned, unsigned, struct desparams * ));
|
||||
int (*__des_crypt_LOCAL)() = 0;
|
||||
extern _des_crypt_call __P(( char *, int, struct desparams * ));
|
||||
/*
|
||||
* Copy 8 bytes
|
||||
*/
|
||||
#define COPY8(src, dst) { \
|
||||
register char *a = (char *) dst; \
|
||||
register char *b = (char *) src; \
|
||||
*a++ = *b++; *a++ = *b++; *a++ = *b++; *a++ = *b++; \
|
||||
*a++ = *b++; *a++ = *b++; *a++ = *b++; *a++ = *b++; \
|
||||
}
|
||||
|
||||
/*
|
||||
* Copy multiple of 8 bytes
|
||||
*/
|
||||
#define DESCOPY(src, dst, len) { \
|
||||
register char *a = (char *) dst; \
|
||||
register char *b = (char *) src; \
|
||||
register int i; \
|
||||
for (i = (int) len; i > 0; i -= 8) { \
|
||||
*a++ = *b++; *a++ = *b++; *a++ = *b++; *a++ = *b++; \
|
||||
*a++ = *b++; *a++ = *b++; *a++ = *b++; *a++ = *b++; \
|
||||
} \
|
||||
}
|
||||
|
||||
/*
|
||||
* CBC mode encryption
|
||||
*/
|
||||
int
|
||||
cbc_crypt(key, buf, len, mode, ivec)
|
||||
char *key;
|
||||
char *buf;
|
||||
unsigned len;
|
||||
unsigned mode;
|
||||
char *ivec;
|
||||
{
|
||||
int err;
|
||||
struct desparams dp;
|
||||
|
||||
#ifdef BROKEN_DES
|
||||
dp.UDES.UDES_buf = buf;
|
||||
dp.des_mode = ECB;
|
||||
#else
|
||||
dp.des_mode = CBC;
|
||||
#endif
|
||||
COPY8(ivec, dp.des_ivec);
|
||||
err = common_crypt(key, buf, len, mode, &dp);
|
||||
COPY8(dp.des_ivec, ivec);
|
||||
return(err);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* ECB mode encryption
|
||||
*/
|
||||
int
|
||||
ecb_crypt(key, buf, len, mode)
|
||||
char *key;
|
||||
char *buf;
|
||||
unsigned len;
|
||||
unsigned mode;
|
||||
{
|
||||
struct desparams dp;
|
||||
|
||||
#ifdef BROKEN_DES
|
||||
dp.UDES.UDES_buf = buf;
|
||||
dp.des_mode = CBC;
|
||||
#else
|
||||
dp.des_mode = ECB;
|
||||
#endif
|
||||
return(common_crypt(key, buf, len, mode, &dp));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Common code to cbc_crypt() & ecb_crypt()
|
||||
*/
|
||||
static int
|
||||
common_crypt(key, buf, len, mode, desp)
|
||||
char *key;
|
||||
char *buf;
|
||||
register unsigned len;
|
||||
unsigned mode;
|
||||
register struct desparams *desp;
|
||||
{
|
||||
register int desdev;
|
||||
|
||||
if ((len % 8) != 0 || len > DES_MAXDATA) {
|
||||
return(DESERR_BADPARAM);
|
||||
}
|
||||
desp->des_dir =
|
||||
((mode & DES_DIRMASK) == DES_ENCRYPT) ? ENCRYPT : DECRYPT;
|
||||
|
||||
desdev = mode & DES_DEVMASK;
|
||||
COPY8(key, desp->des_key);
|
||||
/*
|
||||
* software
|
||||
*/
|
||||
if (__des_crypt_LOCAL != NULL) {
|
||||
if (!__des_crypt_LOCAL(buf, len, desp)) {
|
||||
return (DESERR_HWERROR);
|
||||
}
|
||||
} else {
|
||||
if (!_des_crypt_call(buf, len, desp)) {
|
||||
return (DESERR_HWERROR);
|
||||
}
|
||||
}
|
||||
return(desdev == DES_SW ? DESERR_NONE : DESERR_NOHWDEVICE);
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
#if !defined(lint) && defined(SCCSIDS)
|
||||
static char sccsid[] = "@(#)des_soft.c 2.2 88/08/10 4.0 RPCSRC; from 1.13 88/02/08 SMI";
|
||||
#endif
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
* unrestricted use provided that this legend is included on all tape
|
||||
* media and as a part of the software program in whole or part. Users
|
||||
* may copy or modify Sun RPC without charge, but are not authorized
|
||||
* to license or distribute it to anyone else except as part of a product or
|
||||
* program developed by the user.
|
||||
*
|
||||
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
|
||||
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
|
||||
*
|
||||
* Sun RPC is provided with no support and without any obligation on the
|
||||
* part of Sun Microsystems, Inc. to assist in its use, correction,
|
||||
* modification or enhancement.
|
||||
*
|
||||
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
|
||||
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
|
||||
* OR ANY PART THEREOF.
|
||||
*
|
||||
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
|
||||
* or profits or other special, indirect and consequential damages, even if
|
||||
* Sun has been advised of the possibility of such damages.
|
||||
*
|
||||
* Sun Microsystems, Inc.
|
||||
* 2550 Garcia Avenue
|
||||
* Mountain View, California 94043
|
||||
*/
|
||||
/*
|
||||
* Table giving odd parity in the low bit for ASCII characters
|
||||
*/
|
||||
static char partab[128] = {
|
||||
0x01, 0x01, 0x02, 0x02, 0x04, 0x04, 0x07, 0x07,
|
||||
0x08, 0x08, 0x0b, 0x0b, 0x0d, 0x0d, 0x0e, 0x0e,
|
||||
0x10, 0x10, 0x13, 0x13, 0x15, 0x15, 0x16, 0x16,
|
||||
0x19, 0x19, 0x1a, 0x1a, 0x1c, 0x1c, 0x1f, 0x1f,
|
||||
0x20, 0x20, 0x23, 0x23, 0x25, 0x25, 0x26, 0x26,
|
||||
0x29, 0x29, 0x2a, 0x2a, 0x2c, 0x2c, 0x2f, 0x2f,
|
||||
0x31, 0x31, 0x32, 0x32, 0x34, 0x34, 0x37, 0x37,
|
||||
0x38, 0x38, 0x3b, 0x3b, 0x3d, 0x3d, 0x3e, 0x3e,
|
||||
0x40, 0x40, 0x43, 0x43, 0x45, 0x45, 0x46, 0x46,
|
||||
0x49, 0x49, 0x4a, 0x4a, 0x4c, 0x4c, 0x4f, 0x4f,
|
||||
0x51, 0x51, 0x52, 0x52, 0x54, 0x54, 0x57, 0x57,
|
||||
0x58, 0x58, 0x5b, 0x5b, 0x5d, 0x5d, 0x5e, 0x5e,
|
||||
0x61, 0x61, 0x62, 0x62, 0x64, 0x64, 0x67, 0x67,
|
||||
0x68, 0x68, 0x6b, 0x6b, 0x6d, 0x6d, 0x6e, 0x6e,
|
||||
0x70, 0x70, 0x73, 0x73, 0x75, 0x75, 0x76, 0x76,
|
||||
0x79, 0x79, 0x7a, 0x7a, 0x7c, 0x7c, 0x7f, 0x7f,
|
||||
};
|
||||
|
||||
/*
|
||||
* Add odd parity to low bit of 8 byte key
|
||||
*/
|
||||
void
|
||||
des_setparity(p)
|
||||
char *p;
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 8; i++) {
|
||||
*p = partab[*p & 0x7f];
|
||||
p++;
|
||||
}
|
||||
}
|
||||
@@ -1,172 +0,0 @@
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
* unrestricted use provided that this legend is included on all tape
|
||||
* media and as a part of the software program in whole or part. Users
|
||||
* may copy or modify Sun RPC without charge, but are not authorized
|
||||
* to license or distribute it to anyone else except as part of a product or
|
||||
* program developed by the user or with the express written consent of
|
||||
* Sun Microsystems, Inc.
|
||||
*
|
||||
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
|
||||
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
|
||||
*
|
||||
* Sun RPC is provided with no support and without any obligation on the
|
||||
* part of Sun Microsystems, Inc. to assist in its use, correction,
|
||||
* modification or enhancement.
|
||||
*
|
||||
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
|
||||
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
|
||||
* OR ANY PART THEREOF.
|
||||
*
|
||||
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
|
||||
* or profits or other special, indirect and consequential damages, even if
|
||||
* Sun has been advised of the possibility of such damages.
|
||||
*
|
||||
* Sun Microsystems, Inc.
|
||||
* 2550 Garcia Avenue
|
||||
* Mountain View, California 94043
|
||||
*/
|
||||
#if !defined(lint) && defined(SCCSIDS)
|
||||
static char sccsid[] = "@(#)publickey.c 1.10 91/03/11 Copyr 1986 Sun Micro";
|
||||
#endif
|
||||
|
||||
/*
|
||||
* publickey.c
|
||||
* Copyright (C) 1986, Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Public key lookup routines
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <pwd.h>
|
||||
#include <rpc/rpc.h>
|
||||
#include <rpc/key_prot.h>
|
||||
#include <rpcsvc/yp_prot.h>
|
||||
#include <rpcsvc/ypclnt.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define PKFILE "/etc/publickey"
|
||||
|
||||
/*
|
||||
* Hack to let ypserv/rpc.nisd use AUTH_DES.
|
||||
*/
|
||||
int (*__getpublickey_LOCAL)() = 0;
|
||||
|
||||
/*
|
||||
* Get somebody's public key
|
||||
*/
|
||||
int
|
||||
__getpublickey_real(netname, publickey)
|
||||
char *netname;
|
||||
char *publickey;
|
||||
{
|
||||
char lookup[3 * HEXKEYBYTES];
|
||||
char *p;
|
||||
|
||||
if (publickey == NULL)
|
||||
return (0);
|
||||
if (!getpublicandprivatekey(netname, lookup))
|
||||
return (0);
|
||||
p = strchr(lookup, ':');
|
||||
if (p == NULL) {
|
||||
return (0);
|
||||
}
|
||||
*p = '\0';
|
||||
(void) strncpy(publickey, lookup, HEXKEYBYTES);
|
||||
publickey[HEXKEYBYTES] = '\0';
|
||||
return (1);
|
||||
}
|
||||
|
||||
/*
|
||||
* reads the file /etc/publickey looking for a + to optionally go to the
|
||||
* yellow pages
|
||||
*/
|
||||
|
||||
int
|
||||
getpublicandprivatekey(key, ret)
|
||||
char *key;
|
||||
char *ret;
|
||||
{
|
||||
char buf[1024]; /* big enough */
|
||||
char *res;
|
||||
FILE *fd;
|
||||
char *mkey;
|
||||
char *mval;
|
||||
|
||||
fd = fopen(PKFILE, "r");
|
||||
if (fd == (FILE *) 0)
|
||||
return (0);
|
||||
for (;;) {
|
||||
res = fgets(buf, 1024, fd);
|
||||
if (res == 0) {
|
||||
fclose(fd);
|
||||
return (0);
|
||||
}
|
||||
if (res[0] == '#')
|
||||
continue;
|
||||
else if (res[0] == '+') {
|
||||
#ifdef YP
|
||||
char *PKMAP = "publickey.byname";
|
||||
char *lookup;
|
||||
char *domain;
|
||||
int err;
|
||||
int len;
|
||||
|
||||
err = yp_get_default_domain(&domain);
|
||||
if (err) {
|
||||
continue;
|
||||
}
|
||||
lookup = NULL;
|
||||
err = yp_match(domain, PKMAP, key, strlen(key), &lookup, &len);
|
||||
if (err) {
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "match failed error %d\n", err);
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
lookup[len] = 0;
|
||||
strcpy(ret, lookup);
|
||||
fclose(fd);
|
||||
free(lookup);
|
||||
return (2);
|
||||
#else /* YP */
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr,
|
||||
"Bad record in %s '+' -- NIS not supported in this library copy\n", PKFILE);
|
||||
#endif /* DEBUG */
|
||||
continue;
|
||||
#endif /* YP */
|
||||
} else {
|
||||
mkey = strtok(buf, "\t ");
|
||||
if (mkey == NULL) {
|
||||
fprintf(stderr,
|
||||
"Bad record in %s -- %s", PKFILE, buf);
|
||||
continue;
|
||||
}
|
||||
mval = strtok((char *)NULL, " \t#\n");
|
||||
if (mval == NULL) {
|
||||
fprintf(stderr,
|
||||
"Bad record in %s val problem - %s", PKFILE, buf);
|
||||
continue;
|
||||
}
|
||||
if (strcmp(mkey, key) == 0) {
|
||||
strcpy(ret, mval);
|
||||
fclose(fd);
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int getpublickey(netname, publickey)
|
||||
char *netname;
|
||||
char *publickey;
|
||||
{
|
||||
if (__getpublickey_LOCAL != NULL)
|
||||
return(__getpublickey_LOCAL(netname, publickey));
|
||||
else
|
||||
return(__getpublickey_real(netname, publickey));
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,166 +0,0 @@
|
||||
/*
|
||||
* Please do not edit this file.
|
||||
* It was generated using rpcgen.
|
||||
*/
|
||||
|
||||
#include <rpc/key_prot.h>
|
||||
/*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
* unrestricted use provided that this legend is included on all tape
|
||||
* media and as a part of the software program in whole or part. Users
|
||||
* may copy or modify Sun RPC without charge, but are not authorized
|
||||
* to license or distribute it to anyone else except as part of a product or
|
||||
* program developed by the user.
|
||||
*
|
||||
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
|
||||
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
|
||||
*
|
||||
* Sun RPC is provided with no support and without any obligation on the
|
||||
* part of Sun Microsystems, Inc. to assist in its use, correction,
|
||||
* modification or enhancement.
|
||||
*
|
||||
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
|
||||
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
|
||||
* OR ANY PART THEREOF.
|
||||
*
|
||||
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
|
||||
* or profits or other special, indirect and consequential damages, even if
|
||||
* Sun has been advised of the possibility of such damages.
|
||||
*
|
||||
* Sun Microsystems, Inc.
|
||||
* 2550 Garcia Avenue
|
||||
* Mountain View, California 94043
|
||||
*/
|
||||
#pragma ident "@(#)key_prot.x 1.7 94/04/29 SMI"
|
||||
|
||||
/* Copyright (c) 1990, 1991 Sun Microsystems, Inc. */
|
||||
|
||||
/*
|
||||
* Compiled from key_prot.x using rpcgen.
|
||||
* DO NOT EDIT THIS FILE!
|
||||
* This is NOT source code!
|
||||
*/
|
||||
|
||||
bool_t
|
||||
xdr_keystatus(register XDR *xdrs, keystatus *objp)
|
||||
{
|
||||
|
||||
if (!xdr_enum(xdrs, (enum_t *)objp))
|
||||
return (FALSE);
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_keybuf(register XDR *xdrs, keybuf objp)
|
||||
{
|
||||
|
||||
if (!xdr_opaque(xdrs, objp, HEXKEYBYTES))
|
||||
return (FALSE);
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_netnamestr(register XDR *xdrs, netnamestr *objp)
|
||||
{
|
||||
|
||||
if (!xdr_string(xdrs, objp, MAXNETNAMELEN))
|
||||
return (FALSE);
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_cryptkeyarg(register XDR *xdrs, cryptkeyarg *objp)
|
||||
{
|
||||
|
||||
if (!xdr_netnamestr(xdrs, &objp->remotename))
|
||||
return (FALSE);
|
||||
if (!xdr_des_block(xdrs, &objp->deskey))
|
||||
return (FALSE);
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_cryptkeyarg2(register XDR *xdrs, cryptkeyarg2 *objp)
|
||||
{
|
||||
|
||||
if (!xdr_netnamestr(xdrs, &objp->remotename))
|
||||
return (FALSE);
|
||||
if (!xdr_netobj(xdrs, &objp->remotekey))
|
||||
return (FALSE);
|
||||
if (!xdr_des_block(xdrs, &objp->deskey))
|
||||
return (FALSE);
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_cryptkeyres(register XDR *xdrs, cryptkeyres *objp)
|
||||
{
|
||||
|
||||
if (!xdr_keystatus(xdrs, &objp->status))
|
||||
return (FALSE);
|
||||
switch (objp->status) {
|
||||
case KEY_SUCCESS:
|
||||
if (!xdr_des_block(xdrs, &objp->cryptkeyres_u.deskey))
|
||||
return (FALSE);
|
||||
break;
|
||||
}
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_unixcred(register XDR *xdrs, unixcred *objp)
|
||||
{
|
||||
|
||||
if (!xdr_u_int(xdrs, &objp->uid))
|
||||
return (FALSE);
|
||||
if (!xdr_u_int(xdrs, &objp->gid))
|
||||
return (FALSE);
|
||||
if (!xdr_array(xdrs, (char **)&objp->gids.gids_val, (u_int *) &objp->gids.gids_len, MAXGIDS,
|
||||
sizeof (u_int), (xdrproc_t) xdr_u_int))
|
||||
return (FALSE);
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_getcredres(register XDR *xdrs, getcredres *objp)
|
||||
{
|
||||
|
||||
if (!xdr_keystatus(xdrs, &objp->status))
|
||||
return (FALSE);
|
||||
switch (objp->status) {
|
||||
case KEY_SUCCESS:
|
||||
if (!xdr_unixcred(xdrs, &objp->getcredres_u.cred))
|
||||
return (FALSE);
|
||||
break;
|
||||
}
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_key_netstarg(register XDR *xdrs, key_netstarg *objp)
|
||||
{
|
||||
|
||||
if (!xdr_keybuf(xdrs, objp->st_priv_key))
|
||||
return (FALSE);
|
||||
if (!xdr_keybuf(xdrs, objp->st_pub_key))
|
||||
return (FALSE);
|
||||
if (!xdr_netnamestr(xdrs, &objp->st_netname))
|
||||
return (FALSE);
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_key_netstres(register XDR *xdrs, key_netstres *objp)
|
||||
{
|
||||
|
||||
if (!xdr_keystatus(xdrs, &objp->status))
|
||||
return (FALSE);
|
||||
switch (objp->status) {
|
||||
case KEY_SUCCESS:
|
||||
if (!xdr_key_netstarg(xdrs, &objp->key_netstres_u.knet))
|
||||
return (FALSE);
|
||||
break;
|
||||
}
|
||||
return (TRUE);
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user