Return an error when GSSInitSecContext is called with an unacceptable mechanism.
authorMark Donnelly <mark@painless-security.com>
Mon, 13 Jul 2015 19:02:56 +0000 (15:02 -0400)
committerMark Donnelly <mark@painless-security.com>
Mon, 13 Jul 2015 19:02:56 +0000 (15:02 -0400)
commitc9083c77ea799ce4de4994db505f82c3072f3756
tree636fb00586d0b7d18def9a85486faa565c7e4f47
parent95edc34cfd372556b91a45e3ba252f8d6f25a491
Return an error when GSSInitSecContext is called with an unacceptable mechanism.

* Throw std::invalid_argument when the argument doesn't match the GSS_EAP mechanism
* Catch the std::invalid_argument exception within GSSRequest, and generate a somewhat meaningful JSON response with it:
  { method: "method_name",
    return_values:
    { major_status: -1,
      minor_status: -1,
      errors:
      { major_status_message: "An error occurred in parsing the JSON arguments.",
        minor_status_message: "1.2.3.4 must be 1.3.6.1.5.5.15.1.1.*"
      }
    }
  }

  Note that the status codes are -1, which will never happen in GSS itself - those values are unsigned.
json_gssapi/json_protocol.txt
json_gssapi/src/GSSRequest.cpp
json_gssapi/src/commands/GSSInitSecContext.cpp