dhmech.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* 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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "dh_gssapi.h"
#include <stdlib.h>
/*
* gss_config structure for Diffie-Hellman family of mechanisms.
* This structure is defined in mechglueP.h and defines the entry points
* that libgss uses to call a backend.
*/
static struct gss_config dh_mechanism = {
{0, 0}, /* OID for mech type. */
0,
/* EXPORT DELETE START */ /* CRYPT DELETE START */
/* EXPORT DELETE END */ /* CRYPT DELETE END */
NULL, /* Back ends don't implement this */
NULL, /* Back ends don't implement this */
/* EXPORT DELETE START */ /* CRYPT DELETE START */
/* EXPORT DELETE END */ /* CRYPT DELETE END */
NULL, /* __gss_userok */
/* EXPORT DELETE START */
/* CRYPT DELETE START */
/*
* This block comment is Sun Proprietary: Need-To-Know.
* What we are doing is leaving the seal and unseal entry points
* in an obvious place before sign and unsign for the Domestic customer
* of the Solaris Source Product. The Domestic customer of the Solaris Source
* Product will have to deal with the problem of creating exportable libgss
* binaries.
* In the binary product that Sun builds, these entry points are elsewhere,
* and bracketed with special comments so that the CRYPT_SRC and EXPORT_SRC
* targets delete them.
*/
#if 0
/* CRYPT DELETE END */
/* CRYPT DELETE START */
#endif /* 0 */
/* CRYPT DELETE END */
/* EXPORT DELETE END */
NULL, /* gss_store_cred() -- DH lacks this for now */
};
/*
* __dh_gss_initialize:
* Each mechanism in the Diffie-Hellman family of mechanisms calls this
* routine passing a pointer to a gss_config structure. This routine will
* then check that the mech is not already initialized (If so just return
* the mech). It will then assign the entry points that are common to the
* mechanism family to the uninitialized mech. After which, it allocate space
* for that mechanism's context. It will be up to the caller to fill in
* its mechanism OID and fill in the corresponding fields in mechanism
* specific context.
*/
{
return (mech); /* already initialized */
/* Copy the common entry points for this mechcanisms */
*mech = dh_mechanism;
/* Allocate space for this mechanism's context */
return (NULL);
/* return the mech */
return (mech);
}