More Heimdal portability cleanups
[mech_eap.orig] / init_sec_context.c
index 25f3ae5..bc3f554 100644 (file)
@@ -202,7 +202,9 @@ static struct eapol_callbacks gssEapPolicyCallbacks = {
     peerNotifyPending,
 };
 
+#ifdef GSSEAP_DEBUG
 extern int wpa_debug_level;
+#endif
 
 static OM_uint32
 peerConfigInit(OM_uint32 *minor,
@@ -224,7 +226,9 @@ peerConfigInit(OM_uint32 *minor,
     GSSEAP_KRB_INIT(&krbContext);
 
     eapPeerConfig->fragment_size = 1024;
+#ifdef GSSEAP_DEBUG
     wpa_debug_level = 0;
+#endif
 
     assert(cred->name != GSS_C_NO_NAME);
 
@@ -612,7 +616,7 @@ eapGssSmInitError(OM_uint32 *minor,
     major = load_uint32_be(&p[0]);
     *minor = ERROR_TABLE_BASE_eapg + load_uint32_be(&p[4]);
 
-    if (!GSS_ERROR(major)) {
+    if (!GSS_ERROR(major) || !IS_WIRE_ERROR(*minor)) {
         major = GSS_S_FAILURE;
         *minor = GSSEAP_BAD_ERROR_TOKEN;
     }