xref: /freebsd/crypto/krb5/src/lib/gssapi/krb5/compare_name.c (revision 7f2fe78b9dd5f51c821d771b63d2e096f6fd49e9)
1*7f2fe78bSCy Schubert /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2*7f2fe78bSCy Schubert /*
3*7f2fe78bSCy Schubert  * Copyright 1993 by OpenVision Technologies, Inc.
4*7f2fe78bSCy Schubert  *
5*7f2fe78bSCy Schubert  * Permission to use, copy, modify, distribute, and sell this software
6*7f2fe78bSCy Schubert  * and its documentation for any purpose is hereby granted without fee,
7*7f2fe78bSCy Schubert  * provided that the above copyright notice appears in all copies and
8*7f2fe78bSCy Schubert  * that both that copyright notice and this permission notice appear in
9*7f2fe78bSCy Schubert  * supporting documentation, and that the name of OpenVision not be used
10*7f2fe78bSCy Schubert  * in advertising or publicity pertaining to distribution of the software
11*7f2fe78bSCy Schubert  * without specific, written prior permission. OpenVision makes no
12*7f2fe78bSCy Schubert  * representations about the suitability of this software for any
13*7f2fe78bSCy Schubert  * purpose.  It is provided "as is" without express or implied warranty.
14*7f2fe78bSCy Schubert  *
15*7f2fe78bSCy Schubert  * OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16*7f2fe78bSCy Schubert  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
17*7f2fe78bSCy Schubert  * EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18*7f2fe78bSCy Schubert  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
19*7f2fe78bSCy Schubert  * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
20*7f2fe78bSCy Schubert  * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
21*7f2fe78bSCy Schubert  * PERFORMANCE OF THIS SOFTWARE.
22*7f2fe78bSCy Schubert  */
23*7f2fe78bSCy Schubert 
24*7f2fe78bSCy Schubert /*
25*7f2fe78bSCy Schubert  * $Id$
26*7f2fe78bSCy Schubert  */
27*7f2fe78bSCy Schubert 
28*7f2fe78bSCy Schubert #include "gssapiP_krb5.h"
29*7f2fe78bSCy Schubert 
30*7f2fe78bSCy Schubert OM_uint32 KRB5_CALLCONV
krb5_gss_compare_name(minor_status,name1,name2,name_equal)31*7f2fe78bSCy Schubert krb5_gss_compare_name(minor_status, name1, name2, name_equal)
32*7f2fe78bSCy Schubert     OM_uint32 *minor_status;
33*7f2fe78bSCy Schubert     gss_name_t name1;
34*7f2fe78bSCy Schubert     gss_name_t name2;
35*7f2fe78bSCy Schubert     int *name_equal;
36*7f2fe78bSCy Schubert {
37*7f2fe78bSCy Schubert     krb5_context context;
38*7f2fe78bSCy Schubert     krb5_error_code code;
39*7f2fe78bSCy Schubert 
40*7f2fe78bSCy Schubert     code = krb5_gss_init_context(&context);
41*7f2fe78bSCy Schubert     if (code) {
42*7f2fe78bSCy Schubert         *minor_status = code;
43*7f2fe78bSCy Schubert         return GSS_S_FAILURE;
44*7f2fe78bSCy Schubert     }
45*7f2fe78bSCy Schubert 
46*7f2fe78bSCy Schubert     *minor_status = 0;
47*7f2fe78bSCy Schubert     *name_equal = kg_compare_name(context,
48*7f2fe78bSCy Schubert                                   (krb5_gss_name_t)name1,
49*7f2fe78bSCy Schubert                                   (krb5_gss_name_t)name2);
50*7f2fe78bSCy Schubert     krb5_free_context(context);
51*7f2fe78bSCy Schubert     return(GSS_S_COMPLETE);
52*7f2fe78bSCy Schubert }
53