diff --git a/lib/gssapi/mech/gss_oid_equal.c b/lib/gssapi/mech/gss_oid_equal.c index 93ee6b2a2..20255c007 100644 --- a/lib/gssapi/mech/gss_oid_equal.c +++ b/lib/gssapi/mech/gss_oid_equal.c @@ -33,10 +33,24 @@ #include "mech_locl.h" +/** + * Compare two GSS-API OIDs with each other. + * + * GSS_C_NO_OID matches nothing, not even it-self. + * + * @param a first oid to compare + * @param b second oid to compare + * + * @return zero when both oid are the same OID, non-zero when they are + * not the same. + * + * @ingroup gssapi + */ + int GSSAPI_LIB_FUNCTION gss_oid_equal(const gss_OID a, const gss_OID b) { - if (a == b) + if (a == b && a != GSS_C_NO_OID) return 1; if (a == GSS_C_NO_OID || b == GSS_C_NO_OID || a->length != b->length) return 0;