krb5mech.c revision 694c35faa87b858ecdadfe4fc592615f4eefbb07
/*
* 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) 2011 Bayard G. Bell. All rights reserved.
*
* A module for Kerberos V5 security mechanism.
*
*/
#include <mechglueP.h>
#include <gssapiP_krb5.h>
#include <gssapi_err_generic.h>
#include <gssapi/kgssapi_defs.h>
#include <k5-int.h>
/* mechglue wrappers */
(void *, OM_uint32 *, /* minor_status */
gss_ctx_id_t *, /* context_handle */
gss_buffer_t, /* output_token */
static OM_uint32 k5glue_sign
(void *, OM_uint32 *, /* minor_status */
gss_ctx_id_t, /* context_handle */
int, /* qop_req */
gss_buffer_t, /* message_buffer */
gss_buffer_t, /* message_token */
static OM_uint32 k5glue_verify
(void *, OM_uint32 *, /* minor_status */
gss_ctx_id_t, /* context_handle */
gss_buffer_t, /* message_buffer */
gss_buffer_t, /* token_buffer */
int *, /* qop_state */
static OM_uint32 k5glue_seal
(void *, OM_uint32 *, /* minor_status */
gss_ctx_id_t, /* context_handle */
int, /* conf_req_flag */
int, /* qop_req */
gss_buffer_t, /* input_message_buffer */
int *, /* conf_state */
gss_buffer_t, /* output_message_buffer */
static OM_uint32 k5glue_unseal
(void *, OM_uint32 *, /* minor_status */
gss_ctx_id_t, /* context_handle */
gss_buffer_t, /* input_message_buffer */
gss_buffer_t, /* output_message_buffer */
int *, /* conf_state */
int *, /* qop_state */
(void *, OM_uint32 *, /* minor_status */
gss_buffer_t, /* interprocess_token */
gss_ctx_id_t *); /* context_handle */
static struct gss_config krb5_mechanism =
{{9, "\052\206\110\206\367\022\001\002\002"},
NULL, /* context */
NULL, /* next */
TRUE, /* uses_kmod */
};
static gss_mechanism
{
return (&krb5_mechanism);
}
/*
* Module linkage information for the kernel.
*/
extern struct mod_ops mod_miscops;
&mod_miscops, "Krb5 GSS mechanism"
};
static struct modlinkage modlinkage = {
(void *)&modlmisc,
};
static int krb5_fini_code = EBUSY;
int
_init()
{
int retval;
return (retval);
mech = gss_mech_initialize();
"KRB5 GSS mechanism: mechanism already in table.\n");
"table supports kernel operations!\n");
}
/*
* keep us loaded, but let us be unloadable. This
* will give the developer time to trouble shoot
*/
krb5_fini_code = 0;
} else {
}
return (0);
}
int
_fini()
{
int ret = krb5_fini_code;
if (ret == 0) {
}
return (ret);
}
int
{
}
/* ARGSUSED */
static OM_uint32
void *ctx;
{
return (krb5_gss_delete_sec_context(minor_status,
}
/* V2 */
/* ARGSUSED */
static OM_uint32
void *ctx;
{
return (krb5_gss_import_sec_context(minor_status,
}
/* V1 only */
/* ARGSUSED */
static OM_uint32
void *ctx;
int conf_req_flag;
int qop_req;
int *conf_state;
{
}
/* ARGSUSED */
static OM_uint32
void *ctx;
int qop_req;
{
}
/* ARGSUSED */
static OM_uint32
void *ctx;
int *conf_state;
int *qop_state;
{
}
/* V1 only */
/* ARGSUSED */
static OM_uint32
void *ctx;
int *qop_state;
{
return (krb5_gss_verify(minor_status,
}