Path: blob/main/crypto/krb5/src/lib/gssapi/mechglue/g_mech_invoke.c
39586 views
/*1* Copyright 2008 by the Massachusetts Institute of Technology.2* All Rights Reserved.3*4* Export of this software from the United States of America may5* require a specific license from the United States Government.6* It is the responsibility of any person or organization contemplating7* export to obtain such a license before exporting.8*9* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and10* distribute this software and its documentation for any purpose and11* without fee is hereby granted, provided that the above copyright12* notice appear in all copies and that both that copyright notice and13* this permission notice appear in supporting documentation, and that14* the name of M.I.T. not be used in advertising or publicity pertaining15* to distribution of the software without specific, written prior16* permission. Furthermore if you modify this software you must label17* your software as modified software and not distribute it in such a18* fashion that it might be confused with the original M.I.T. software.19* M.I.T. makes no representations about the suitability of20* this software for any purpose. It is provided "as is" without express21* or implied warranty.22*/2324/* Glue routine for gssspi_mech_invoke */2526#include "mglueP.h"27#ifdef HAVE_STDLIB_H28#include <stdlib.h>29#endif30#include <string.h>31#include <errno.h>3233OM_uint32 KRB5_CALLCONV34gssspi_mech_invoke (OM_uint32 *minor_status,35const gss_OID desired_mech,36const gss_OID desired_object,37gss_buffer_t value)38{39OM_uint32 status;40gss_OID selected_mech = GSS_C_NO_OID;41gss_mechanism mech;4243if (minor_status == NULL)44return GSS_S_CALL_INACCESSIBLE_WRITE;4546*minor_status = 0;4748/*49* select the approprate underlying mechanism routine and50* call it.51*/5253status = gssint_select_mech_type(minor_status, desired_mech,54&selected_mech);55if (status != GSS_S_COMPLETE)56return status;5758mech = gssint_get_mechanism(selected_mech);59if (mech == NULL || mech->gssspi_mech_invoke == NULL) {60return GSS_S_BAD_MECH;61}6263status = mech->gssspi_mech_invoke(minor_status,64gssint_get_public_oid(selected_mech),65desired_object,66value);67if (status != GSS_S_COMPLETE)68map_error(minor_status, mech);6970return status;71}727374