add some function headers
authorLuke Howard <lukeh@padl.com>
Sat, 16 Oct 2010 08:55:23 +0000 (19:55 +1100)
committerLuke Howard <lukeh@padl.com>
Sat, 16 Oct 2010 08:55:23 +0000 (19:55 +1100)
72 files changed:
accept_sec_context.c
acquire_cred.c
acquire_cred_with_password.c
add_cred.c
add_cred_with_password.c
canonicalize_name.c
compare_name.c
context_time.c
delete_name_attribute.c
delete_sec_context.c
display_name.c
display_name_ext.c
display_status.c
duplicate_name.c
eap_mech.c
export_name.c
export_name_composite.c
export_sec_context.c
get_mic.c
get_name_attribute.c
import_name.c
import_sec_context.c
indicate_mechs.c
init_sec_context.c
inquire_attrs_for_mech.c
inquire_context.c
inquire_cred.c
inquire_cred_by_oid.c
inquire_mech_for_saslname.c
inquire_mechs_for_name.c
inquire_name.c
inquire_names_for_mech.c
inquire_saslname_for_mech.c
inquire_sec_context_by_oid.c
pseudo_random.c
release_cred.c
release_name.c
release_oid.c
set_cred_option.c
set_name_attribute.c
set_sec_context_option.c
unwrap.c
unwrap_iov.c
util.h
util_attr.cpp
util_attr.h
util_buffer.c
util_cksum.c
util_context.c
util_cred.c
util_crypt.c
util_exts.c
util_krb.c
util_lucid.c
util_mech.c
util_name.c
util_oid.c
util_ordering.c
util_radius.cpp
util_radius.h
util_reauth.c
util_reauth.h
util_saml.cpp
util_saml.h
util_shib.cpp
util_shib.h
util_token.c
verify_mic.c
wrap.c
wrap_iov.c
wrap_iov_length.c
wrap_size_limit.c

index 6aef48e..2b2d995 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Establish a security context on the acceptor (server). These functions
+ * wrap around libradsec and (thus) talk to a RADIUS server or proxy.
+ */
+
 #include "gssapiP_eap.h"
 
 #ifdef GSSEAP_ENABLE_REAUTH
index c85966e..ab5cb97 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Wrapper for acquiring a credential handle.
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32
index f86d3ba..8d2e3c8 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Wrapper for acquiring a credential handle using a password.
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32
index de50884..c831f4a 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Wrapper for acquiring a credential handle.
+ */
+
 #include "gssapiP_eap.h"
 
 /*
index beaed83..ca2dd6e 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Wrapper for acquiring a credential handle using a password.
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32
index 4862796..acfbbc3 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Function for canonicalizing a name; presently just duplicates it.
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32
index 44fd57e..47c573e 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Compare two names.
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32
index 707d29d..4b08d2e 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Determine remaining lifetime of a context handle.
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32
index 868b1d5..61f7b43 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Wrapper for removing a name attribute.
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32
index cb3e0eb..4f11148 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Release a context handle.
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32
index 861cdee..21f48c6 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Wrapper for "displaying" (returning string representation of) a name.
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32
index ea4b85a..ffc5ad8 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Parameterized version of gss_display_name(), currently unimplemented.
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32
index bd19849..5033620 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Function for converting mechanism error codes to strings.
+ */
+
 #include "gssapiP_eap.h"
 
 static GSSEAP_THREAD_ONCE gssEapStatusInfoKeyOnce = GSSEAP_ONCE_INITIALIZER;
index 6fd9e36..deb6420 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Duplicate a name.
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32
index 4199fcd..c9b03b6 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Initialisation and finalise functions.
+ */
+
 #include "gssapiP_eap.h"
 
 static OM_uint32
index 4e92e7e..901f7ed 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Serialise a name.
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32
index dffff14..35c9bee 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Serialise a name and its attributes.
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32
index 1f4e6fe..e476c34 100644 (file)
  * SUCH DAMAGE.
  */
 
-#include "gssapiP_eap.h"
-
 /*
- * Export a partially established acceptor context.
+ * Serialise a security context. On the acceptor, this may be partially
+ * established.
  */
+
+#include "gssapiP_eap.h"
+
 static OM_uint32
 gssEapExportPartialContext(OM_uint32 *minor,
                            gss_ctx_id_t ctx,
index 45c96ec..172e21a 100644 (file)
--- a/get_mic.c
+++ b/get_mic.c
  * SUCH DAMAGE.
  */
 
+/*
+ * Message protection services: make a message integerity check.
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32
 gss_get_mic(OM_uint32 *minor,
             gss_ctx_id_t ctx,
-            gss_qop_t qop_req __attribute__((__unused__)),
+            gss_qop_t qop_req,
             gss_buffer_t message_buffer,
             gss_buffer_t message_token)
 {
@@ -47,6 +51,11 @@ gss_get_mic(OM_uint32 *minor,
         return GSS_S_NO_CONTEXT;
     }
 
+    if (qop_req != GSS_C_QOP_DEFAULT) {
+        *minor = GSSEAP_UNKNOWN_QOP;
+        return GSS_S_UNAVAILABLE;
+    }
+
     *minor = 0;
 
     message_token->value = NULL;
index 4ac5a1b..dfaa0d5 100644 (file)
 
 #include "gssapiP_eap.h"
 
+/*
+ * Wrapper for retrieving a naming attribute.
+ */
+
 OM_uint32
 gss_get_name_attribute(OM_uint32 *minor,
                        gss_name_t name,
index bceefcd..d616fc0 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Deserialise a name.
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32
index 084ca87..ea1072e 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Deserialise a context handle.
+ */
+
 #include "gssapiP_eap.h"
 
 #define UPDATE_REMAIN(n)    do {                \
index 7f98a80..ecda509 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Enumerate the supported mechanism OIDs.
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32
index a0cb7d9..d90f9e6 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Establish a security context on the initiator (client). These functions
+ * wrap around libeap.
+ */
+
 #include "gssapiP_eap.h"
 
 #ifdef GSSEAP_ENABLE_REAUTH
index 1d17a9d..dec08c8 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Enumerate the features supported by the GSS EAP mechanism.
+ */
+
 #include "gssapiP_eap.h"
 
 #define MA_ADD(ma, set)    do { \
index 369ed0d..510826b 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Return context handle properties.
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32
index 3f185c7..01c3b4a 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Return credential handle properties.
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32
index 8212a1d..226f83f 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Return extended credential handle properties.
+ */
+
 #include "gssapiP_eap.h"
 
 static struct {
index 9b7c5d9..536f3c7 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Map mechanism OID to a SASL mechanism name.
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32
index 045d0d8..14def4e 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Determine mechanism OIDs supported by name.
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32
index 1cd8f73..2cf3229 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Enumerate name attributes.
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32 gss_inquire_name(OM_uint32 *minor,
index 4ca60a3..7217e33 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Return supported name OID types.
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32
index 64a33c3..a26dd17 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Map SASL mechanism name to a mechanism OID.
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32
index e6437c1..cf74bea 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Return extended properties of a context handle.
+ */
+
 #include "gssapiP_eap.h"
 
 static OM_uint32
index 3440055..3edd28a 100644 (file)
  * or implied warranty.
  */
 
+/*
+ * PRF
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32
index 0dbcda7..3a429a0 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Release a credential handle.
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32
index d85a81d..7491691 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Release a name.
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32
index 8feeccd..947baa2 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Mark an internalized OID as not required to be released.
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32
index 396012a..6f2be5a 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Set an extended property on a credential handle.
+ */
+
 #include "gssapiP_eap.h"
 
 static OM_uint32
index 93d1c25..e2f635b 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Set an attribute on a name.
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32
index 859582d..cfe0384 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Set an extended property on a context handle.
+ */
+
 #include "gssapiP_eap.h"
 
 static struct {
index 911fd2b..f660017 100644 (file)
--- a/unwrap.c
+++ b/unwrap.c
  * SUCH DAMAGE.
  */
 
+/*
+ * Message protection services: unwrap.
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32
index fca9d64..6c4dde1 100644 (file)
  * or implied warranty.
  */
 
+/*
+ * Message protection services: unwrap with scatter-gather API.
+ */
+
 #include "gssapiP_eap.h"
 
 /*
diff --git a/util.h b/util.h
index 7816393..910b5df 100644 (file)
--- a/util.h
+++ b/util.h
  *
  */
 
+/*
+ * Utility functions.
+ */
+
 #ifndef _UTIL_H_
 #define _UTIL_H_ 1
 
index 14865fa..3d7d1f6 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Attribute provider mechanism.
+ */
+
 #include "gssapiP_eap.h"
 
 #include <typeinfo>
index 0358936..9dd4787 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Attribute provider interface.
+ */
+
 #ifndef _UTIL_ATTR_H_
 #define _UTIL_ATTR_H_ 1
 
index df1c0ac..a553882 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Buffer handling helpers.
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32
index 80d57d8..9616e9c 100644 (file)
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
+/*
+ * Message protection services: checksum helpers.
+ */
+
 #include "gssapiP_eap.h"
 
 static int
index 95cfccf..d00965a 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Utility routines for context handles.
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32
index b7b3f57..6878bc2 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Utility routines for credential handles.
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32
index e8ebd9c..62e880e 100644 (file)
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
+/*
+ * Message protection services: cryptography helpers.
+ */
+
 #include "gssapiP_eap.h"
 
 /*
index 5fa8345..5cdbf1b 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Extension token support.
+ */
+
 #include "gssapiP_eap.h"
 
 static OM_uint32
index a11f1f4..34d6cb6 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Kerberos 5 helpers.
+ */
+
 #include "gssapiP_eap.h"
 
 static GSSEAP_THREAD_ONCE krbContextKeyOnce = GSSEAP_ONCE_INITIALIZER;
index 79c5ebc..469c84d 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * "Lucid" security context export routine (called by MIT Kerberos mechanism).
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32
index 62540ae..dd0c664 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * General mechanism utility routines.
+ */
+
 #include "gssapiP_eap.h"
 
 /*
index 45cd26d..9bceb3b 100644 (file)
  * or implied warranty.
  */
 
+/*
+ * Name utility routines.
+ */
+
 #include "gssapiP_eap.h"
 
 static gss_OID_desc gssEapNtPrincipalName = {
index 0f10076..7c63785 100644 (file)
  *
  */
 
+/*
+ * OID utility routines.
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32
index 0ab8c28..9d74697 100644 (file)
  */
 
 /*
- * $Id: util_ordering.c 23457 2009-12-08 00:04:48Z tlyu $
- */
-
-/*
- * functions to check sequence numbers for replay and sequencing
+ * Functions to check sequence numbers for replay and sequencing
  */
 
 #include "gssapiP_eap.h"
index 3d8cb83..770579c 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * RADIUS attribute provider implementation.
+ */
+
 #include "gssapiP_eap.h"
 
 /* stuff that should be provided by libradsec/libfreeradius-radius */
index 805f57e..d6e4cf5 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * RADIUS attribute provider.
+ */
+
 #ifndef _UTIL_RADIUS_H_
 #define _UTIL_RADIUS_H_ 1
 
index 52b9976..141ee77 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Fast reauthentication support.
+ */
+
 #include "gssapiP_eap.h"
 
 #include <dlfcn.h>
index 45c45df..96287d2 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Fast reauthentication support.
+ */
+
 #include "gssapiP_eap.h"
 
 #ifndef _UTIL_REAUTH_H_
 #define _UTIL_REAUTH_H_ 1
 
+/* AD element containing serialised AVPs. */
 #define KRB5_AUTHDATA_RADIUS_AVP        513
 
 OM_uint32
index b4afd21..7e61300 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * SAML attribute provider implementation.
+ */
+
 #include "gssapiP_eap.h"
 
 #include <sstream>
index 25647db..6be1c08 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * SAML attribute provider.
+ */
+
 #ifndef _UTIL_SAML_H_
 #define _UTIL_SAML_H_ 1
 
index 0c9744d..13d88f6 100644 (file)
  * limitations under the License.
  */
 
+/*
+ * Local attribute provider implementation.
+ */
+
 #include <shibsp/exceptions.h>
 #include <shibsp/attribute/SimpleAttribute.h>
 
index 6e53aec..8224547 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Local attribute provider.
+ */
+
 #ifndef _UTIL_SHIB_H_
 #define _UTIL_SHIB_H_ 1
 
index 6642375..1ce51f9 100644 (file)
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
+/*
+ * Utility routines for GSS tokens.
+ */
+
 #include "gssapiP_eap.h"
 
 /*
index e06816c..5df6b52 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Message protection services: verify a message integrity check.
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32
diff --git a/wrap.c b/wrap.c
index 3be87d5..2dd9031 100644 (file)
--- a/wrap.c
+++ b/wrap.c
  * SUCH DAMAGE.
  */
 
+/*
+ * Message protection services: wrap.
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32
index 9e6933d..3bf719c 100644 (file)
  * or implied warranty.
  */
 
+/*
+ * Message protection services: wrap with scatter-gather API.
+ */
+
 #include "gssapiP_eap.h"
 
 unsigned char
@@ -335,6 +339,11 @@ gss_wrap_iov(OM_uint32 *minor,
         return GSS_S_NO_CONTEXT;
     }
 
+    if (qop_req != GSS_C_QOP_DEFAULT) {
+        *minor = GSSEAP_UNKNOWN_QOP;
+        return GSS_S_UNAVAILABLE;
+    }
+
     *minor = 0;
 
     GSSEAP_MUTEX_LOCK(&ctx->mutex);
index b9bbfdc..56c2299 100644 (file)
  * or implied warranty.
  */
 
+/*
+ * Message protection services: determine protected message size.
+ */
+
 #include "gssapiP_eap.h"
 
 #define INIT_IOV_DATA(_iov)     do { (_iov)->buffer.value = NULL;       \
@@ -77,11 +81,15 @@ gssEapWrapIovLength(OM_uint32 *minor,
     int dce_style;
     size_t ec;
 
-    if (qop_req != GSS_C_QOP_DEFAULT)
-        return GSS_S_FAILURE;
+    if (qop_req != GSS_C_QOP_DEFAULT) {
+        *minor = GSSEAP_UNKNOWN_QOP;
+        return GSS_S_UNAVAILABLE;
+    }
 
-    if (ctx->encryptionType == ENCTYPE_NULL)
+    if (ctx->encryptionType == ENCTYPE_NULL) {
+        *minor = GSSEAP_KEY_UNAVAILABLE;
         return GSS_S_UNAVAILABLE;
+    }
 
     GSSEAP_KRB_INIT(&krbContext);
 
index 4e7a0da..82d97cb 100644 (file)
  * SUCH DAMAGE.
  */
 
+/*
+ * Message protection services: determine maximum input size.
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32