summaryrefslogtreecommitdiffstats
path: root/src/Common/Requests/GSSAPIAuthRequest.cpp
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2008-09-16 01:20:43 +0200
committerMatthias Schiffer <matthias@gamezock.de>2008-09-16 01:20:43 +0200
commitcc35771abf4fc7e0dd472bd818ff2b4962c7e204 (patch)
tree682bc38ffbf5954a93b1967a700f40bd78038ee4 /src/Common/Requests/GSSAPIAuthRequest.cpp
parent2226256eedb2849f387ff566893a91bf5da3cdc9 (diff)
downloadmad-cc35771abf4fc7e0dd472bd818ff2b4962c7e204.tar
mad-cc35771abf4fc7e0dd472bd818ff2b4962c7e204.zip
Bessere Fehlerbehandlung
Diffstat (limited to 'src/Common/Requests/GSSAPIAuthRequest.cpp')
-rw-r--r--src/Common/Requests/GSSAPIAuthRequest.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/Common/Requests/GSSAPIAuthRequest.cpp b/src/Common/Requests/GSSAPIAuthRequest.cpp
index a4a1b17..91488d0 100644
--- a/src/Common/Requests/GSSAPIAuthRequest.cpp
+++ b/src/Common/Requests/GSSAPIAuthRequest.cpp
@@ -86,13 +86,17 @@ bool GSSAPIAuthRequest::sendRequest(Net::Connection *connection, uint16_t reques
return true;
}
-bool GSSAPIAuthRequest::handlePacket(Net::Connection *connection, const Net::Packet &packet) {
- if(packet.getType() != Net::Packet::GSSAPI_AUTH)
- return false; // TODO Logging
+void GSSAPIAuthRequest::handlePacket(Net::Connection *connection, const Net::Packet &packet) {
+ if(packet.getType() != Net::Packet::GSSAPI_AUTH) {
+ signalFinished().emit();
+ return; // TODO Logging
+ }
OM_uint32 majStat, minStat;
gss_buffer_desc recvBuffer, sendBuffer;
+ // Needs error handling!
+
if(gssContinue) {
recvBuffer.length = packet.getLength();
recvBuffer.value = std::malloc(recvBuffer.length);
@@ -109,12 +113,12 @@ bool GSSAPIAuthRequest::handlePacket(Net::Connection *connection, const Net::Pac
}
else if(majStat != GSS_S_CONTINUE_NEEDED) {
gss_release_buffer(&minStat, &sendBuffer);
- return false;
+ return;
}
if(!connection->send(Net::Packet(Net::Packet::GSSAPI_AUTH, packet.getRequestId(), sendBuffer.value, sendBuffer.length))) {
gss_release_buffer(&minStat, &sendBuffer);
- return false;
+ return;
}
gss_release_buffer(&minStat, &sendBuffer);
@@ -134,7 +138,7 @@ bool GSSAPIAuthRequest::handlePacket(Net::Connection *connection, const Net::Pac
std::free(recvBuffer.value);
if(majStat != GSS_S_COMPLETE)
- return false;
+ return;
connection->setAuthenticated();
std::cout << "Authentication complete." << std::endl;
@@ -143,20 +147,18 @@ bool GSSAPIAuthRequest::handlePacket(Net::Connection *connection, const Net::Pac
if(majStat != GSS_S_COMPLETE) {
gss_release_buffer(&minStat, &sendBuffer);
- return false;
+ return;
}
if(!connection->send(Net::Packet(Net::Packet::GSSAPI_AUTH, packet.getRequestId(), sendBuffer.value, sendBuffer.length))) {
gss_release_buffer(&minStat, &sendBuffer);
- return false;
+ return;
}
gss_release_buffer(&minStat, &sendBuffer);
signalFinished().emit();
}
-
- return true;
}
}