2N/A/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2N/A/*
2N/A * lib/gssapi/krb5/rel_oid.c
2N/A *
2N/A * Copyright 1995, 2007 by the Massachusetts Institute of Technology.
2N/A * All Rights Reserved.
2N/A *
2N/A * Export of this software from the United States of America may
2N/A * require a specific license from the United States Government.
2N/A * It is the responsibility of any person or organization contemplating
2N/A * export to obtain such a license before exporting.
2N/A *
2N/A * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
2N/A * distribute this software and its documentation for any purpose and
2N/A * without fee is hereby granted, provided that the above copyright
2N/A * notice appear in all copies and that both that copyright notice and
2N/A * this permission notice appear in supporting documentation, and that
2N/A * the name of M.I.T. not be used in advertising or publicity pertaining
2N/A * to distribution of the software without specific, written prior
2N/A * permission. Furthermore if you modify this software you must label
2N/A * your software as modified software and not distribute it in such a
2N/A * fashion that it might be confused with the original M.I.T. software.
2N/A * M.I.T. makes no representations about the suitability of
2N/A * this software for any purpose. It is provided "as is" without express
2N/A * or implied warranty.
2N/A *
2N/A */
2N/A
2N/A/*
2N/A * rel_oid.c - Release an OID.
2N/A */
2N/A#include "gssapiP_krb5.h"
2N/A#include "mglueP.h" /* Solaris Kerberos */
2N/A
2N/AOM_uint32 krb5_gss_internal_release_oid (OM_uint32 *, /* minor_status */
2N/A gss_OID * /* oid */
2N/A);
2N/A
2N/AOM_uint32
2N/Akrb5_gss_release_oid(minor_status, oid)
2N/A OM_uint32 *minor_status;
2N/A gss_OID *oid;
2N/A{
2N/A /*
2N/A * The V2 API says the following!
2N/A *
2N/A * gss_release_oid[()] will recognize any of the GSSAPI's own OID values,
2N/A * and will silently ignore attempts to free these OIDs; for other OIDs
2N/A * it will call the C free() routine for both the OID data and the
2N/A * descriptor. This allows applications to freely mix their own heap-
2N/A * allocated OID values with OIDs returned by GSS-API.
2N/A */
2N/A if (krb5_gss_internal_release_oid(minor_status, oid) != GSS_S_COMPLETE) {
2N/A /* Pawn it off on the generic routine */
2N/A return(generic_gss_release_oid(minor_status, oid));
2N/A }
2N/A else {
2N/A *oid = GSS_C_NO_OID;
2N/A *minor_status = 0;
2N/A return(GSS_S_COMPLETE);
2N/A }
2N/A}
2N/A
2N/AOM_uint32
2N/Akrb5_gss_internal_release_oid(minor_status, oid)
2N/A OM_uint32 *minor_status;
2N/A gss_OID *oid;
2N/A{
2N/A /*
2N/A * This function only knows how to release internal OIDs. It will
2N/A * return GSS_S_CONTINUE_NEEDED for any OIDs it does not recognize.
2N/A */
2N/A
2N/A *minor_status = 0;
2N/A if ((*oid != gss_mech_krb5) &&
2N/A (*oid != gss_mech_krb5_old) &&
2N/A (*oid != gss_mech_krb5_wrong) &&
2N/A (*oid != gss_nt_krb5_name) &&
2N/A (*oid != gss_nt_krb5_principal)) {
2N/A /* We don't know about this OID */
2N/A return(GSS_S_CONTINUE_NEEDED);
2N/A }
2N/A else {
2N/A *oid = GSS_C_NO_OID;
2N/A return(GSS_S_COMPLETE);
2N/A }
2N/A}