add gsseap error table
authorLuke Howard <lukeh@padl.com>
Mon, 11 Oct 2010 14:35:02 +0000 (16:35 +0200)
committerLuke Howard <lukeh@padl.com>
Mon, 11 Oct 2010 14:35:02 +0000 (16:35 +0200)
.gitignore
Makefile.am
eap_mech.c
gssapiP_eap.h
gsseap_err.et [new file with mode: 0644]
util_exts.c

index 1a3b666..6cc5e45 100644 (file)
@@ -14,6 +14,8 @@
 /ltmain.sh
 /missing
 
+/gsseap_err.[ch]
+
 .DS_Store
 
 Makefile.in
index 6a4557c..7ce3113 100644 (file)
@@ -39,6 +39,7 @@ mech_eap_la_SOURCES =                         \
        export_sec_context.c                    \
        get_mic.c                               \
        get_name_attribute.c                    \
+       gsseap_err.c                            \
        import_name.c                           \
        import_sec_context.c                    \
        indicate_mechs.c                        \
@@ -102,3 +103,9 @@ radius_ad_la_LDFLAGS = -avoid-version -module \
 radius_ad_la_LIBADD  = @KRB5_LIBS@
 radius_ad_la_SOURCES = util_adshim.c
 endif
+
+gsseap_err.c: gsseap_err.et
+       $(prefix)/bin/compile_et $<
+
+clean-generic:
+       rm -f gsseap_err.[ch]
index f067b4e..686bea9 100644 (file)
@@ -160,6 +160,8 @@ gssEapInitiatorInit(void)
 {
     OM_uint32 major, minor;
 
+    initialize_gsseap_error_table();
+
     major = gssEapInitLibEap(&minor);
     assert(major == GSS_S_COMPLETE);
 
index 473aa84..0cf0cb9 100644 (file)
@@ -74,6 +74,7 @@ extern "C" {
 }
 #endif
 
+#include "gsseap_err.h"
 #include "util.h"
 
 #ifdef __cplusplus
diff --git a/gsseap_err.et b/gsseap_err.et
new file mode 100644 (file)
index 0000000..f89da01
--- /dev/null
@@ -0,0 +1,38 @@
+#
+# Copyright (c) 2010, JANET(UK)
+#  All rights reserved.
+# 
+#  Redistribution and use in source and binary forms, with or without
+#  modification, are permitted provided that the following conditions
+#  are met:
+# 
+#  1. Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+# 
+#  2. Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in the
+#     documentation and/or other materials provided with the distribution.
+# 
+#  3. Neither the name of JANET(UK) nor the names of its contributors
+#     may be used to endorse or promote products derived from this software
+#     without specific prior written permission.
+# 
+#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+#  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+#  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+#  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+#  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+#  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+#  OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+#  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+#  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+#  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+#  SUCH DAMAGE.
+#
+
+error_table gsseap
+
+error_code GSSEAP_CRIT_EXT_UNAVAILABLE,     "Critical extension unavailable"
+error_code GSSEAP_MISSING_REQUIRED_EXT,     "Missing required extension"
+
+end
index 00207f1..ccc86ec 100644 (file)
@@ -287,11 +287,8 @@ verifyExtensions(OM_uint32 *minor,
             types[j] |= EXT_FLAG_VERIFIED;
         } else if (ext->required) {
             /* Required extension missing */
-            *minor = ENOENT;
+            *minor = GSSEAP_MISSING_REQUIRED_EXT;
             major = GSS_S_UNAVAILABLE;
-            gssEapSaveStatusInfo(*minor,
-                                 "Missing required GSS EAP extension %08x",
-                                 ext->type);
             goto cleanup;
         }
     }
@@ -300,11 +297,8 @@ verifyExtensions(OM_uint32 *minor,
     for (i = 0; i < extensions->count; i++) {
         if ((types[i] & EXT_FLAG_CRITICAL) &&
             (types[i] & EXT_FLAG_VERIFIED) == 0) {
-            *minor = ENOSYS;
+            *minor = GSSEAP_CRIT_EXT_UNAVAILABLE;
             major = GSS_S_UNAVAILABLE;
-            gssEapSaveStatusInfo(*minor,
-                                 "Received unknown critical GSS EAP extension %08x",
-                                 (types[i] & EXT_TYPE_MASK));
             goto cleanup;
         }
     }