diff options
Diffstat (limited to 'src/Common/Requests/GSSAPIAuthRequest.cpp')
-rw-r--r-- | src/Common/Requests/GSSAPIAuthRequest.cpp | 22 |
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; } } |