cleanup, refactor TLV code
[mech_eap.orig] / inquire_cred_by_oid.c
index 5abdc2d..b4a95f8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, JANET(UK)
+ * Copyright (c) 2011, JANET(UK)
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * SUCH DAMAGE.
  */
 
+/*
+ * Return extended credential handle properties.
+ */
+
 #include "gssapiP_eap.h"
 
 static struct {
@@ -45,14 +49,14 @@ gss_inquire_cred_by_oid(OM_uint32 *minor,
                         const gss_OID desired_object,
                         gss_buffer_set_t *data_set)
 {
-    OM_uint32 major = GSS_S_UNAVAILABLE;
+    OM_uint32 major;
     int i;
 
     *data_set = GSS_C_NO_BUFFER_SET;
 
     if (cred_handle == GSS_C_NO_CREDENTIAL) {
         *minor = EINVAL;
-        return GSS_S_NO_CRED;
+        return GSS_S_CALL_INACCESSIBLE_READ | GSS_S_NO_CRED;
     }
 
     GSSEAP_MUTEX_LOCK(&cred_handle->mutex);