From: Luke Howard Date: Mon, 11 Oct 2010 14:35:02 +0000 (+0200) Subject: add gsseap error table X-Git-Tag: vm/20110310~136 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=mech_eap.orig;a=commitdiff_plain;h=11f9efdde75b31b6d4b78ff04618cebd4b4496f4 add gsseap error table --- diff --git a/.gitignore b/.gitignore index 1a3b666..6cc5e45 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,8 @@ /ltmain.sh /missing +/gsseap_err.[ch] + .DS_Store Makefile.in diff --git a/Makefile.am b/Makefile.am index 6a4557c..7ce3113 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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] diff --git a/eap_mech.c b/eap_mech.c index f067b4e..686bea9 100644 --- a/eap_mech.c +++ b/eap_mech.c @@ -160,6 +160,8 @@ gssEapInitiatorInit(void) { OM_uint32 major, minor; + initialize_gsseap_error_table(); + major = gssEapInitLibEap(&minor); assert(major == GSS_S_COMPLETE); diff --git a/gssapiP_eap.h b/gssapiP_eap.h index 473aa84..0cf0cb9 100644 --- a/gssapiP_eap.h +++ b/gssapiP_eap.h @@ -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 index 0000000..f89da01 --- /dev/null +++ b/gsseap_err.et @@ -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 diff --git a/util_exts.c b/util_exts.c index 00207f1..ccc86ec 100644 --- a/util_exts.c +++ b/util_exts.c @@ -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; } }