/*
* 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.
*/
/* 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"
/*
* auth_des.c, client-side implementation of DES authentication
*
*/
#include "mt.h"
#include "rpc_mt.h"
#include <rpc/des_crypt.h>
#include <syslog.h>
#include <stdlib.h>
#include <string.h>
#include <synch.h>
char **, char **);
static struct auth_ops *authdes_ops(void);
/*
* This struct is pointed to by the ah_private field of an "AUTH *"
*/
struct ad_private {
};
const des_block *, nis_server *);
/*
* documented version of authdes_seccreate
*/
/*
* servername: network name of server
* win: time to live
* timehost: optional hostname to sync with
* ckey: optional conversation key to use
*/
AUTH *
{
"authdes_seccreate: no public key found for %s",
return (NULL);
}
}
/*
* Slightly modified version of authdes_seccreate which takes the public key
* of the server principal as an argument. This spares us a call to
* getpublickey() which in the nameserver context can cause a deadlock.
*/
AUTH *
{
/*
* Allocate everything now
*/
return (NULL);
}
goto failed;
}
if (!getnetname(namebuf))
goto failed;
goto failed;
}
goto failed;
}
} else {
}
"authdes_seccreate: keyserv(1m) is unable to generate session key");
goto failed;
}
} else
/*
* Set up auth handle
*/
goto failed;
}
return (auth);
if (auth)
if (ad) {
if (ad->ad_fullname)
if (ad->ad_servername)
if (ad->ad_timehost)
}
return (NULL);
}
/*
* Implement the five authentication operations
*/
/*
* 1. Next Verifier
*/
/*ARGSUSED*/
static void
{
/* what the heck am I supposed to do??? */
}
/*
* 2. Marshal
*/
static bool_t
{
/* LINTED pointer alignment */
int status;
int len;
/*
* Figure out the "time", accounting for any time difference
* with the server if necessary.
*/
}
/*
* XDR the timestamp and possibly some other things, then
* encrypt them.
*/
2 * sizeof (des_block),
} else {
sizeof (des_block),
DES_ENCRYPT | DES_HW);
}
if (DES_FAILED(status)) {
return (FALSE);
}
} else {
}
/*
* Serialize the credential and verifier into opaque
* authentication data.
*/
} else {
}
} else {
return (FALSE);
return (FALSE);
}
return (FALSE);
} else {
return (FALSE);
return (FALSE);
}
}
/*
* 3. Validate
*/
static bool_t
{
/* LINTED pointer alignment */
int status;
return (FALSE);
/* LINTED pointer alignment */
/*
* Decrypt the timestamp
*/
if (DES_FAILED(status)) {
return (FALSE);
}
/*
* xdr the decrypted timestamp
*/
/* LINTED pointer alignment */
/*
* validate
*/
sizeof (struct timeval)) != 0) {
return (FALSE);
}
/*
* We have a nickname now, let's use it
*/
return (TRUE);
}
/*
* 4. Refresh
*/
/*ARGSUSED*/
static bool_t
{
/* LINTED pointer alignment */
int ok;
if (!ok) {
/*
* Hope the clocks are synced!
*/
"authdes_refresh: unable to synchronize clock");
}
}
"authdes_refresh: keyserv(1m) is unable to encrypt session key");
return (FALSE);
}
return (TRUE);
}
/*
* 5. Destroy
*/
static void
{
/* LINTED pointer alignment */
if (ad->ad_timehost)
}
static struct auth_ops *
authdes_ops(void)
{
/* VARIABLES PROTECTED BY ops_lock: ops */
(void) mutex_lock(&ops_lock);
}
(void) mutex_unlock(&ops_lock);
return (&ops);
}