add a testing path for setting initiator credentials
[mech_eap.orig] / util_name.c
index b1475f8..70d23e2 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
@@ -227,7 +227,7 @@ importUserName(OM_uint32 *minor,
 
 static OM_uint32
 importAnonymousName(OM_uint32 *minor,
-                    const gss_buffer_t nameBuffer,
+                    const gss_buffer_t nameBuffer GSSEAP_UNUSED,
                     gss_name_t *pName)
 {
     OM_uint32 major;
@@ -282,7 +282,7 @@ gssEapImportNameInternal(OM_uint32 *minor,
     remain = nameBuffer->length;
 
     if (flags & EXPORT_NAME_FLAG_OID) {
-        if (remain < 6 + GSS_EAP_MECHANISM->length + 4)
+        if (remain < 6 + GSS_EAP_MECHANISM->length)
             return GSS_S_BAD_NAME;
 
         if (flags & EXPORT_NAME_FLAG_COMPOSITE)
@@ -312,6 +312,7 @@ gssEapImportNameInternal(OM_uint32 *minor,
     }
 
     /* NAME_LEN */
+    CHECK_REMAIN(4);
     len = load_uint32_be(p);
     UPDATE_REMAIN(4);