Path: blob/main/crypto/heimdal/lib/gssapi/krb5/aeap.c
34923 views
/*1* Copyright (c) 2008 Kungliga Tekniska Högskolan2* (Royal Institute of Technology, Stockholm, Sweden).3* All rights reserved.4*5* Redistribution and use in source and binary forms, with or without6* modification, are permitted provided that the following conditions7* are met:8*9* 1. Redistributions of source code must retain the above copyright10* notice, this list of conditions and the following disclaimer.11*12* 2. Redistributions in binary form must reproduce the above copyright13* notice, this list of conditions and the following disclaimer in the14* documentation and/or other materials provided with the distribution.15*16* 3. Neither the name of the Institute nor the names of its contributors17* may be used to endorse or promote products derived from this software18* without specific prior written permission.19*20* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND21* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE22* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE23* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE24* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL25* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS26* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)27* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT28* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY29* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF30* SUCH DAMAGE.31*/3233#include "gsskrb5_locl.h"3435#include <roken.h>3637#if 038OM_uint32 GSSAPI_CALLCONV39_gk_wrap_iov(OM_uint32 * minor_status,40gss_ctx_id_t context_handle,41int conf_req_flag,42gss_qop_t qop_req,43int * conf_state,44gss_iov_buffer_desc *iov,45int iov_count)46{47const gsskrb5_ctx ctx = (const gsskrb5_ctx) context_handle;48krb5_context context;4950GSSAPI_KRB5_INIT (&context);5152if (ctx->more_flags & IS_CFX)53return _gssapi_wrap_cfx_iov(minor_status, ctx, context,54conf_req_flag, conf_state,55iov, iov_count);5657return GSS_S_FAILURE;58}5960OM_uint32 GSSAPI_CALLCONV61_gk_unwrap_iov(OM_uint32 *minor_status,62gss_ctx_id_t context_handle,63int *conf_state,64gss_qop_t *qop_state,65gss_iov_buffer_desc *iov,66int iov_count)67{68const gsskrb5_ctx ctx = (const gsskrb5_ctx) context_handle;69krb5_context context;7071GSSAPI_KRB5_INIT (&context);7273if (ctx->more_flags & IS_CFX)74return _gssapi_unwrap_cfx_iov(minor_status, ctx, context,75conf_state, qop_state, iov, iov_count);7677return GSS_S_FAILURE;78}79#endif8081OM_uint32 GSSAPI_CALLCONV82_gk_wrap_iov_length(OM_uint32 * minor_status,83gss_ctx_id_t context_handle,84int conf_req_flag,85gss_qop_t qop_req,86int *conf_state,87gss_iov_buffer_desc *iov,88int iov_count)89{90const gsskrb5_ctx ctx = (const gsskrb5_ctx) context_handle;91krb5_context context;9293GSSAPI_KRB5_INIT (&context);9495if (ctx->more_flags & IS_CFX)96return _gssapi_wrap_iov_length_cfx(minor_status, ctx, context,97conf_req_flag, qop_req, conf_state,98iov, iov_count);99100return GSS_S_FAILURE;101}102103104