summaryrefslogtreecommitdiffstats
path: root/src/Common/Requests/GSSAPIAuthRequest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Common/Requests/GSSAPIAuthRequest.cpp')
-rw-r--r--src/Common/Requests/GSSAPIAuthRequest.cpp26
1 files changed, 7 insertions, 19 deletions
diff --git a/src/Common/Requests/GSSAPIAuthRequest.cpp b/src/Common/Requests/GSSAPIAuthRequest.cpp
index 91488d0..53d969f 100644
--- a/src/Common/Requests/GSSAPIAuthRequest.cpp
+++ b/src/Common/Requests/GSSAPIAuthRequest.cpp
@@ -18,7 +18,7 @@
*/
#include "GSSAPIAuthRequest.h"
-#include "../RequestManager.h"
+#include <Net/Connection.h>
#include <cstring>
@@ -37,17 +37,7 @@ GSSAPIAuthRequest::~GSSAPIAuthRequest() {
gss_release_name(&minStat, &gssServiceName);
}
-bool GSSAPIAuthRequest::send(Net::Connection *connection, const std::string &serviceName0) {
- GSSAPIAuthRequest *request = new GSSAPIAuthRequest(serviceName0);
-
- if(Mad::Common::RequestManager::getRequestManager()->sendRequest(connection, request))
- return true;
-
- delete request;
- return false;
-}
-
-bool GSSAPIAuthRequest::sendRequest(Net::Connection *connection, uint16_t requestId) {
+void GSSAPIAuthRequest::sendRequest(Net::Connection *connection, uint16_t requestId) {
OM_uint32 majStat, minStat;
gss_buffer_desc buffer;
@@ -61,7 +51,7 @@ bool GSSAPIAuthRequest::sendRequest(Net::Connection *connection, uint16_t reques
if(majStat != GSS_S_COMPLETE) {
gssServiceName = GSS_C_NO_NAME;
- return false;
+ return;
}
majStat = gss_init_sec_context(&minStat, GSS_C_NO_CREDENTIAL, &gssContext, gssServiceName, GSS_C_NO_OID, GSS_C_MUTUAL_FLAG | GSS_C_REPLAY_FLAG,
@@ -73,22 +63,20 @@ bool GSSAPIAuthRequest::sendRequest(Net::Connection *connection, uint16_t reques
}
else if(majStat != GSS_S_CONTINUE_NEEDED) {
gss_release_buffer(&minStat, &buffer);
- return false;
+ return;
}
if(!connection->send(Net::Packet(Net::Packet::GSSAPI_AUTH, requestId, buffer.value, buffer.length))) {
gss_release_buffer(&minStat, &buffer);
- return false;
+ return;
}
gss_release_buffer(&minStat, &buffer);
-
- return true;
}
void GSSAPIAuthRequest::handlePacket(Net::Connection *connection, const Net::Packet &packet) {
if(packet.getType() != Net::Packet::GSSAPI_AUTH) {
- signalFinished().emit();
+ finishWithError(Exception(Exception::UNEXPECTED_PACKET));
return; // TODO Logging
}
@@ -157,7 +145,7 @@ void GSSAPIAuthRequest::handlePacket(Net::Connection *connection, const Net::Pac
gss_release_buffer(&minStat, &sendBuffer);
- signalFinished().emit();
+ finish();
}
}