Ignore empty realms comparing acceptor name hint
[mech_eap.git] / mech_eap / util_radius.cpp
index c76fffe..7d9b9e8 100644 (file)
@@ -171,11 +171,19 @@ isInternalAttributeP(const gss_eap_attrid &attrid)
     switch (attrid.first) {
     case VENDORPEC_UKERNA:
         switch (attrid.second) {
+        case PW_SAML_AAA_ASSERTION:
+            bInternalAttribute = true;
+            break;
+        default:
+            break;
+        }
+        break;
+    case 0:
+        switch (attrid.second) {
         case PW_GSS_ACCEPTOR_SERVICE_NAME:
         case PW_GSS_ACCEPTOR_HOST_NAME:
-        case PW_GSS_ACCEPTOR_SERVICE_SPECIFIC:
+        case PW_GSS_ACCEPTOR_SERVICE_SPECIFICS:
         case PW_GSS_ACCEPTOR_REALM_NAME:
-        case PW_SAML_AAA_ASSERTION:
             bInternalAttribute = true;
             break;
         default:
@@ -282,7 +290,7 @@ getAttributeId(const gss_buffer_t desc,
     canon = isdigit(*(char *)desc->value);
 
     /* need to duplicate because attr may not be NUL terminated */
-    strAttr = (char *)GSSEAP_MALLOC(canon ? 5 : 0 + desc->length + 1);
+    strAttr = (char *)GSSEAP_MALLOC((canon ? 5 : 0) + desc->length + 1);
     if (strAttr == NULL)
         throw new std::bad_alloc();
 
@@ -822,7 +830,7 @@ gss_eap_radius_attr_provider::initWithJsonObject(const gss_eap_attr_ctx *ctx,
 const char *
 gss_eap_radius_attr_provider::prefix(void) const
 {
-    return "urn:ietf:params:gssapi:aaa-radius";
+    return "urn:ietf:params:gss:radius-attribute";
 }
 
 JSONObject