key_call.c revision f48205be61a214698b763ff550ab9e657525104c
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Portions of this source code were derived from Berkeley 4.3 BSD
* under license from the Regents of the University of California.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* key_call.c, Interface to keyserver
* key_encryptsession(agent, deskey, cr)-encrypt a session key to talk to agent
* key_decryptsession(agent, deskey) - decrypt ditto
* key_gendes(deskey) - generate a secure des key
* key_getnetname(netname, cr) - get the netname from the keyserv
* netname2user(...) - get unix credential for given name (kernel only)
*/
#include <sys/pathname.h>
#include <sys/sysmacros.h>
#include <rpc/key_prot.h>
struct auth_globals {
struct knetconfig auth_config;
};
cred_t *);
/* ARGSUSED */
void *
{
struct auth_globals *authg;
return (authg);
}
/* ARGSUSED */
void
{
}
enum clnt_stat
{
return (stat);
}
return (RPC_FAILED); /* XXX */
}
return (RPC_SUCCESS);
}
enum clnt_stat
{
return (stat);
}
return (RPC_FAILED); /* XXX */
}
return (RPC_SUCCESS);
}
enum clnt_stat
{
CRED()));
}
/*
* Call up to keyserv to get the netname of the client based
* on its uid. The netname is written into the string that "netname"
* points to; the caller is responsible for ensuring that sufficient space
* is available.
*/
enum clnt_stat
char *netname;
{
/*
* Look up the keyserv interface routines to see if
* netname is stored there.
*/
return (stat);
}
return (RPC_FAILED);
}
return (RPC_SUCCESS);
}
enum clnt_stat
{
struct getcredres res;
return (stat);
}
return (RPC_FAILED); /* XXX */
}
return (RPC_SUCCESS);
}
char loopback_name[] = NC_LOOPBACK;
static enum clnt_stat
{
int error;
struct auth_globals *authg;
char *keyname;
struct knetconfig *configp;
/*
* Using a global here is obviously busted and fraught with danger.
*/
/*
* 8 = strlen(".keyserv");
*/
/*
* filch a knetconfig structure.
*/
return (RPC_UNKNOWNPROTO);
}
}
/*
* now call the proper stuff.
*/
if (error != 0) {
switch (error) {
case EINTR:
return (RPC_INTR);
case ETIMEDOUT:
return (RPC_TIMEDOUT);
default:
return (RPC_FAILED); /* XXX */
}
}
return (RPC_INTR);
}
/* Mask out all signals except SIGHUP, SIGQUIT, and SIGTERM. */
if (stat != RPC_SUCCESS) {
stat);
return (stat);
}
return (RPC_SUCCESS);
}