/*
* 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 1993 OpenVision Technologies, Inc., All Rights Reserved.
*
* $Header:
* 1.10 1994/10/27 12:39:23 jik Exp $
*/
#include <stdlib.h>
#include <rpc/rpcsec_defs.h>
/*
* Miscellaneous XDR routines.
*/
{
/*
* We go through this contortion because size_t is a now a ulong,
* GSS-API uses ulongs.
*/
} else {
}
return (TRUE);
}
return (FALSE);
}
{
return (FALSE);
return (TRUE);
}
{
return (FALSE);
return (TRUE);
}
{
return (FALSE);
return (TRUE);
}
/*
* Generic routine to wrap data used by client and server sides.
*/
{
char *buf;
/*
*/
"__rpc_gss_wrap_data\n"));
return (FALSE);
}
/*
* serialize the sequence number into tmp memory
*/
goto fail;
/*
* serialize the arguments into tmp memory
*/
goto fail;
/*
* Data to be wrapped goes in in_buf. If privacy is used,
* out_buf will have wrapped data (in_buf will no longer be
* needed). If integrity is used, out_buf will have checksum
* which will follow the data in in_buf.
*/
switch (service) {
case rpc_gss_svc_privacy:
goto fail;
if (!conf_state)
goto fail;
break;
case rpc_gss_svc_integrity:
&out_buf) != GSS_S_COMPLETE)
goto fail;
break;
default:
goto fail;
}
/*
* write out in_buf and out_buf as needed
*/
goto fail;
}
goto fail;
fail:
if (buf)
return (ret);
}
/*
* Generic routine to unwrap data used by client and server sides.
*/
{
int qop;
/*
* Pull out wrapped data. For privacy service, this is the
* encrypted data. For integrity service, this is the data
* followed by a checksum.
*/
return (FALSE);
if (service == rpc_gss_svc_privacy) {
&qop);
if (major != GSS_S_COMPLETE) {
if (GSS_SUPPLEMENTARY_INFO(major))
return (FALSE);
}
/*
* Keep the returned token (unencrypted data) in in_buf.
*/
/*
* If privacy was not used, or if QOP is not what we are
* expecting, fail.
*/
goto fail;
} else if (service == rpc_gss_svc_integrity) {
return (FALSE);
if (major != GSS_S_COMPLETE) {
return (FALSE);
}
/*
* If QOP is not what we are expecting, fail.
*/
goto fail;
}
/*
* The data consists of the sequence number followed by the
* arguments. Make sure sequence number is what we are
* expecting (i.e., the value in the header).
*/
goto fail;
goto fail;
/*
* Deserialize the arguments into xdr_ptr, and release in_buf.
*/
goto fail;
if (service == rpc_gss_svc_privacy)
else
return (TRUE);
fail:
if (service == rpc_gss_svc_privacy)
else
return (FALSE);
}
/*ARGSUSED*/
int
int max_tp_unit_len;
{
int conf;
int ret_val = 0;
conf = 0;
else if (service == rpc_gss_svc_privacy)
conf = 1;
else if (service == rpc_gss_svc_none)
return (max_tp_unit_len);
/*
* max_input_size may result in negative value
*/
if (maj_stat == GSS_S_COMPLETE) {
if ((int)max_input_size <= 0)
ret_val = 0;
else
ret_val = (int)(max_input_size);
} else {
"gss_wrap_size_limit failed in "
"__find_max_data_length\n"));
}
return (ret_val);
}