/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <unistd.h>
#include <rpc/key_prot.h>
#include <rpcsvc/nis_dhext.h>
#include <syslog.h>
#include <note.h>
/* defined in usr/src/libnsl/rpc/key_call.c */
extern bool_t (*__key_encryptsession_pk_LOCAL)();
extern bool_t (*__key_decryptsession_pk_LOCAL)();
extern bool_t (*__key_gendes_LOCAL)();
/*
* authsys_create_uid(uid_t uid)
*
* We don't include suplementary groups, since these are of no
* interest for the keyserv operations that we do.
*/
AUTH *
{
"pam_dhkeys: Can't determine hostname: %m");
return (NULL);
}
return (res);
}
/*
* my_key_call(proc, xdr_arg, arg, xdr_rslt, rslt, uit, gid)
*
* my_key_call is a copy of key_call() from libnsl with the
* added AUTHSYS rpc credential to make the keyserver use our
* REAL UID instead of our EFFECTIVE UID when handling our keys.
*/
int
{
int vers;
bool_t r;
if (r == TRUE) {
/* LINTED pointer alignment */
return (1);
}
return (0);
}
bool_t r;
if (r == TRUE) {
/* LINTED pointer alignment */
return (1);
}
return (0);
}
bool_t r;
if (r == TRUE) {
/* LINTED pointer alignment */
return (1);
}
return (0);
}
(proc == KEY_GET_CONV))
else
return (0);
}
int
{
return (-1);
}
if (status != KEY_SUCCESS) {
return (-1);
}
return (1);
}
int
{
if (skeylen == 0)
else
if (pkeylen == 0)
else
if (skeylen == 0) {
if (pkeylen == 0) {
/* debug("keylens are both 0"); */
return (-1);
}
} else {
/* debug("keylens don't match"); */
return (-1);
}
}
if (skeylen != 0) {
sizeof (tmp.st_priv_key));
} else {
sizeof (tmp.st_priv_key));
}
if (pkeylen != 0) {
sizeof (tmp.st_pub_key));
} else {
sizeof (tmp.st_pub_key));
}
}
return (-1);
}
if (status != KEY_SUCCESS) {
/* debug("key_setnet3 status is nonzero"); */
return (-1);
}
return (0);
}
/*
* key_secretkey_is_set_uid() returns 1 if the keyserver has a secret key
* stored for the caller's REAL uid; it returns 0 otherwise
*/
int
{
/* avoid leaving secret key in memory */
return (1);
}
return (0);
}
int
{
return (-1);
if (status != KEY_SUCCESS)
return (-1);
return (0);
}