Rework the invalid argument for init sec context exception
[gssweb.git] / json_gssapi / src / commands / GSSInitSecContext.cpp
index 97263bd..bf1611f 100644 (file)
@@ -191,6 +191,8 @@ bool GSSInitSecContext::loadParameters(JSONObject *params)
     }
     if (GSS_C_NO_OID == this->mechType.toGss() )
       throw std::invalid_argument( std::string() + "Could not create a mech_type OID from '" + key + "'");
+    if ( !(this->mechType.isGssEapMech()) )
+      throw GSSException(string("'") + params->get("mech_type").string() + "' must be in 1.3.6.1.5.5.15.1.1.*", 65536, 0, this->mechType.toGss());
   }
   
   // req_flags
@@ -256,7 +258,7 @@ bool GSSInitSecContext::zeroOut(bool initialized)
   this->claimantCred = GSS_C_NO_CREDENTIAL;
   this->context_handle = GSS_C_NO_CONTEXT;
   this->target_name = GSS_C_NO_NAME;
-  this->mechType.setValue( (char *)"{ 1 3 6 1 5 5 15 1 1 18 }" );
+  this->mechType.setValue( (char *)"{ 1 3 6 1 5 5 15 1 1 17 }" );
   this->input_token.length = 0;
   this->input_token.value = NULL;
   this->output_token.length = 0;