1 #pragma ident "%Z%%M% %I% %E% SMI" 2 3 /* 4 * lib/gssapi/krb5/rel_oid.c 5 * 6 * Copyright 1995 by the Massachusetts Institute of Technology. 7 * All Rights Reserved. 8 * 9 * Export of this software from the United States of America may 10 * require a specific license from the United States Government. 11 * It is the responsibility of any person or organization contemplating 12 * export to obtain such a license before exporting. 13 * 14 * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and 15 * distribute this software and its documentation for any purpose and 16 * without fee is hereby granted, provided that the above copyright 17 * notice appear in all copies and that both that copyright notice and 18 * this permission notice appear in supporting documentation, and that 19 * the name of M.I.T. not be used in advertising or publicity pertaining 20 * to distribution of the software without specific, written prior 21 * permission. Furthermore if you modify this software you must label 22 * your software as modified software and not distribute it in such a 23 * fashion that it might be confused with the original M.I.T. software. 24 * M.I.T. makes no representations about the suitability of 25 * this software for any purpose. It is provided "as is" without express 26 * or implied warranty. 27 * 28 */ 29 30 /* 31 * rel_oid.c - Release an OID. 32 */ 33 #include "gssapiP_krb5.h" 34 #include "mglueP.h" 35 36 OM_uint32 krb5_gss_internal_release_oid (OM_uint32 *, /* minor_status */ 37 gss_OID * /* oid */ 38 ); 39 40 OM_uint32 41 krb5_gss_release_oid(minor_status, oid) 42 OM_uint32 *minor_status; 43 gss_OID *oid; 44 { 45 /* 46 * The V2 API says the following! 47 * 48 * gss_release_oid[()] will recognize any of the GSSAPI's own OID values, 49 * and will silently ignore attempts to free these OIDs; for other OIDs 50 * it will call the C free() routine for both the OID data and the 51 * descriptor. This allows applications to freely mix their own heap- 52 * allocated OID values with OIDs returned by GSS-API. 53 */ 54 if (krb5_gss_internal_release_oid(minor_status, oid) != GSS_S_COMPLETE) { 55 /* Pawn it off on the generic routine */ 56 return(generic_gss_release_oid(minor_status, oid)); 57 } 58 else { 59 *oid = GSS_C_NO_OID; 60 *minor_status = 0; 61 return(GSS_S_COMPLETE); 62 } 63 } 64 65 OM_uint32 66 krb5_gss_internal_release_oid(minor_status, oid) 67 OM_uint32 *minor_status; 68 gss_OID *oid; 69 { 70 /* 71 * This function only knows how to release internal OIDs. It will 72 * return GSS_S_CONTINUE_NEEDED for any OIDs it does not recognize. 73 */ 74 75 if ((*oid != gss_mech_krb5) && 76 (*oid != gss_mech_krb5_old) && 77 (*oid != gss_mech_krb5_wrong) && 78 (*oid != gss_nt_krb5_name) && 79 (*oid != gss_nt_krb5_principal)) { 80 /* We don't know about this OID */ 81 return(GSS_S_CONTINUE_NEEDED); 82 } 83 else { 84 *oid = GSS_C_NO_OID; 85 *minor_status = 0; 86 return(GSS_S_COMPLETE); 87 } 88 } 89 90