diff options
Diffstat (limited to 'Swiften/Client/ClientSession.cpp')
| -rw-r--r-- | Swiften/Client/ClientSession.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Swiften/Client/ClientSession.cpp b/Swiften/Client/ClientSession.cpp index bb9be58..4e34417 100644 --- a/Swiften/Client/ClientSession.cpp +++ b/Swiften/Client/ClientSession.cpp | |||
| @@ -122,7 +122,7 @@ void ClientSession::sendStanza(std::shared_ptr<Stanza> stanza) { | |||
| 122 | } | 122 | } |
| 123 | 123 | ||
| 124 | void ClientSession::handleStreamStart(const ProtocolHeader&) { | 124 | void ClientSession::handleStreamStart(const ProtocolHeader&) { |
| 125 | CHECK_STATE_OR_RETURN(State::WaitingForStreamStart); | 125 | CHECK_STATE_OR_RETURN(State::WaitingForStreamStart) |
| 126 | state = State::Negotiating; | 126 | state = State::Negotiating; |
| 127 | } | 127 | } |
| 128 | 128 | ||
| @@ -214,7 +214,7 @@ void ClientSession::handleElement(std::shared_ptr<ToplevelElement> element) { | |||
| 214 | } | 214 | } |
| 215 | } | 215 | } |
| 216 | else if (StreamFeatures* streamFeatures = dynamic_cast<StreamFeatures*>(element.get())) { | 216 | else if (StreamFeatures* streamFeatures = dynamic_cast<StreamFeatures*>(element.get())) { |
| 217 | CHECK_STATE_OR_RETURN(State::Negotiating); | 217 | CHECK_STATE_OR_RETURN(State::Negotiating) |
| 218 | 218 | ||
| 219 | if (streamFeatures->hasStartTLS() && stream->supportsTLSEncryption() && useTLS != NeverUseTLS) { | 219 | if (streamFeatures->hasStartTLS() && stream->supportsTLSEncryption() && useTLS != NeverUseTLS) { |
| 220 | state = State::WaitingForEncrypt; | 220 | state = State::WaitingForEncrypt; |
| @@ -320,7 +320,7 @@ void ClientSession::handleElement(std::shared_ptr<ToplevelElement> element) { | |||
| 320 | } | 320 | } |
| 321 | } | 321 | } |
| 322 | else if (std::dynamic_pointer_cast<Compressed>(element)) { | 322 | else if (std::dynamic_pointer_cast<Compressed>(element)) { |
| 323 | CHECK_STATE_OR_RETURN(State::Compressing); | 323 | CHECK_STATE_OR_RETURN(State::Compressing) |
| 324 | state = State::WaitingForStreamStart; | 324 | state = State::WaitingForStreamStart; |
| 325 | stream->addZLibCompression(); | 325 | stream->addZLibCompression(); |
| 326 | stream->resetXMPPParser(); | 326 | stream->resetXMPPParser(); |
| @@ -343,7 +343,7 @@ void ClientSession::handleElement(std::shared_ptr<ToplevelElement> element) { | |||
| 343 | continueSessionInitialization(); | 343 | continueSessionInitialization(); |
| 344 | } | 344 | } |
| 345 | else if (AuthChallenge* challenge = dynamic_cast<AuthChallenge*>(element.get())) { | 345 | else if (AuthChallenge* challenge = dynamic_cast<AuthChallenge*>(element.get())) { |
| 346 | CHECK_STATE_OR_RETURN(State::Authenticating); | 346 | CHECK_STATE_OR_RETURN(State::Authenticating) |
| 347 | assert(authenticator); | 347 | assert(authenticator); |
| 348 | if (authenticator->setChallenge(challenge->getValue())) { | 348 | if (authenticator->setChallenge(challenge->getValue())) { |
| 349 | stream->writeElement(std::make_shared<AuthResponse>(authenticator->getResponse())); | 349 | stream->writeElement(std::make_shared<AuthResponse>(authenticator->getResponse())); |
| @@ -361,7 +361,7 @@ void ClientSession::handleElement(std::shared_ptr<ToplevelElement> element) { | |||
| 361 | } | 361 | } |
| 362 | } | 362 | } |
| 363 | else if (AuthSuccess* authSuccess = dynamic_cast<AuthSuccess*>(element.get())) { | 363 | else if (AuthSuccess* authSuccess = dynamic_cast<AuthSuccess*>(element.get())) { |
| 364 | CHECK_STATE_OR_RETURN(State::Authenticating); | 364 | CHECK_STATE_OR_RETURN(State::Authenticating) |
| 365 | assert(authenticator); | 365 | assert(authenticator); |
| 366 | if (!authenticator->setChallenge(authSuccess->getValue())) { | 366 | if (!authenticator->setChallenge(authSuccess->getValue())) { |
| 367 | finishSession(Error::ServerVerificationFailedError); | 367 | finishSession(Error::ServerVerificationFailedError); |
| @@ -378,7 +378,7 @@ void ClientSession::handleElement(std::shared_ptr<ToplevelElement> element) { | |||
| 378 | finishSession(Error::AuthenticationFailedError); | 378 | finishSession(Error::AuthenticationFailedError); |
| 379 | } | 379 | } |
| 380 | else if (dynamic_cast<TLSProceed*>(element.get())) { | 380 | else if (dynamic_cast<TLSProceed*>(element.get())) { |
| 381 | CHECK_STATE_OR_RETURN(State::WaitingForEncrypt); | 381 | CHECK_STATE_OR_RETURN(State::WaitingForEncrypt) |
| 382 | state = State::Encrypting; | 382 | state = State::Encrypting; |
| 383 | stream->addTLSEncryption(); | 383 | stream->addTLSEncryption(); |
| 384 | } | 384 | } |
| @@ -433,7 +433,7 @@ void ClientSession::sendCredentials(const SafeByteArray& password) { | |||
| 433 | 433 | ||
| 434 | void ClientSession::handleTLSEncrypted() { | 434 | void ClientSession::handleTLSEncrypted() { |
| 435 | if (!std::dynamic_pointer_cast<BOSHSessionStream>(stream)) { | 435 | if (!std::dynamic_pointer_cast<BOSHSessionStream>(stream)) { |
| 436 | CHECK_STATE_OR_RETURN(State::Encrypting); | 436 | CHECK_STATE_OR_RETURN(State::Encrypting) |
| 437 | } | 437 | } |
| 438 | 438 | ||
| 439 | std::vector<Certificate::ref> certificateChain = stream->getPeerCertificateChain(); | 439 | std::vector<Certificate::ref> certificateChain = stream->getPeerCertificateChain(); |
Swift