This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch master in repository x2goclient. from 2ace014 src/onmainwindow.cpp: replace old code to modify the PATH value with the new add_to_path () function. new c788a14 src/{onmainwindow,sshmasterconnection}.{cpp,h}: add support for ANSI X9.9 OTP tokens. Fixes: #1027. new 128d498 src/{onmainwindow,sshmasterconnection}.cpp: refactoring and whitespace only changes following up the #1027 patch. The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Summary of changes: debian/changelog | 8 ++++++++ src/onmainwindow.cpp | 29 +++++++++++++++++++++++++++++ src/onmainwindow.h | 1 + src/sshmasterconnection.cpp | 17 ++++++++++++++--- src/sshmasterconnection.h | 1 + 5 files changed, 53 insertions(+), 3 deletions(-) -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository x2goclient. commit 128d4983740a03a14a638653617b60aab1a4c6c8 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed May 4 04:53:21 2016 +0200 src/{onmainwindow,sshmasterconnection}.cpp: refactoring and whitespace only changes following up the #1027 patch. --- debian/changelog | 2 ++ src/onmainwindow.cpp | 34 +++++++++++++++++----------------- src/sshmasterconnection.cpp | 15 ++++++++------- 3 files changed, 27 insertions(+), 24 deletions(-) diff --git a/debian/changelog b/debian/changelog index d418845..77f7d12 100644 --- a/debian/changelog +++ b/debian/changelog @@ -22,6 +22,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium entries to a PATH-like string if they do not exist in there yet. - src/onmainwindow.cpp: replace old code to modify the PATH value with the new add_to_path () function. + - src/{onmainwindow,sshmasterconnection}.cpp: refactoring and whitespace only + changes following up the #1027 patch. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 18ca368..925085b 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -2950,29 +2950,29 @@ void ONMainWindow::slotSshServerAuthPassphrase(SshMasterConnection* connection, } -void ONMainWindow::slotSshServerAuthChallengeResponse(SshMasterConnection* connection, QString Challenge) +void ONMainWindow::slotSshServerAuthChallengeResponse(SshMasterConnection* connection, QString challenge) { - bool ok; + bool ok = false; QString message; - message=Challenge; + message = challenge; - QString phrase=QInputDialog::getText(0,connection->getUser()+"@"+connection->getHost()+":"+QString::number(connection->getPort()), - message,QLineEdit::Password,QString::null, &ok); - if(!ok) - { - phrase=QString::null; + QString phrase = QInputDialog::getText (0, connection->getUser () + "@" + connection->getHost () + ":" + QString::number (connection->getPort ()), + message, QLineEdit::Password, QString::null, &ok); + if (!ok) { + phrase = QString::null; } - else - { - if(phrase==QString::null) - phrase=""; + else { + if (phrase == QString::null) { + phrase = ""; + } } - connection->setKeyPhrase(phrase); - if(isHidden()) - { - show(); - QTimer::singleShot(1, this, SLOT(hide())); + + connection->setKeyPhrase (phrase); + + if (isHidden ()) { + show (); + QTimer::singleShot (1, this, SLOT (hide ())); } } diff --git a/src/sshmasterconnection.cpp b/src/sshmasterconnection.cpp index 1d330a3..d85c730 100644 --- a/src/sshmasterconnection.cpp +++ b/src/sshmasterconnection.cpp @@ -884,17 +884,18 @@ bool SshMasterConnection::userChallengeAuth() bool need_to_display_auth_code_prompt = false; const std::size_t challenge_auth_code_prompts_size = (sizeof (challenge_auth_code_prompts_)/sizeof (*challenge_auth_code_prompts_)); - if( pr.contains("challenge", Qt::CaseInsensitive) ) { + if (pr.contains ("challenge", Qt::CaseInsensitive)) { x2goDebug << "prompt contains 'challenge': " << pr << endl; has_challenge_auth_code_prompt = true; need_to_display_auth_code_prompt = true; - } else { + } + else { for (std::size_t i = 0; i < challenge_auth_code_prompts_size; ++i) { - x2goDebug << "Checking against known prompt #" << i << ": " << challenge_auth_code_prompts_[i] << endl; - if (pr.startsWith (challenge_auth_code_prompts_[i])) { - has_challenge_auth_code_prompt = true; - break; - } + x2goDebug << "Checking against known prompt #" << i << ": " << challenge_auth_code_prompts_[i] << endl; + if (pr.startsWith (challenge_auth_code_prompts_[i])) { + has_challenge_auth_code_prompt = true; + break; + } } } -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository x2goclient. commit c788a1424ce7a270fd65e028da190d9f16586d05 Author: Tor Perkins <x2go34@noid.net> Date: Wed May 4 03:30:19 2016 +0200 src/{onmainwindow,sshmasterconnection}.{cpp,h}: add support for ANSI X9.9 OTP tokens. Fixes: #1027. For this to work correctly, the challenge string needs to be displayed to the user. --- debian/changelog | 6 ++++++ src/onmainwindow.cpp | 29 +++++++++++++++++++++++++++++ src/onmainwindow.h | 1 + src/sshmasterconnection.cpp | 26 ++++++++++++++++++-------- src/sshmasterconnection.h | 1 + 5 files changed, 55 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index 80d3c80..d418845 100644 --- a/debian/changelog +++ b/debian/changelog @@ -37,6 +37,12 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium * New upstream version (4.0.5.2): - misc {src/,x2goclient.pro}: port to Qt5. + [ Tor Perkins ] + * New upstream release (4.0.5.2): + - src/{onmainwindow,sshmasterconnection}.{cpp,h}: add support for ANSI + X9.9 OTP tokens. Fixes: #1027. For this to work correctly, the challenge + string needs to be displayed to the user. + -- X2Go Release Manager <git-admin@x2go.org> Thu, 24 Mar 2016 23:04:42 +0100 x2goclient (4.0.5.1-0x2go1) unstable; urgency=low diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index c7fffd7..18ca368 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -2825,6 +2825,8 @@ SshMasterConnection* ONMainWindow::startSshConnection ( QString host, QString po SLOT ( slotSshServerAuthError ( int,QString, SshMasterConnection* ) ) ); connect ( con, SIGNAL ( needPassPhrase(SshMasterConnection*, bool)),this, SLOT ( slotSshServerAuthPassphrase(SshMasterConnection*, bool)) ); + connect ( con, SIGNAL ( needChallengeResponse(SshMasterConnection*, QString)),this, + SLOT ( slotSshServerAuthChallengeResponse(SshMasterConnection*, QString)) ); connect ( con, SIGNAL ( userAuthError ( QString ) ),this,SLOT ( slotSshUserAuthError ( QString ) ) ); connect ( con, SIGNAL ( connectionError ( QString,QString ) ), this, SLOT ( slotSshConnectionError ( QString,QString ) ) ); @@ -2948,6 +2950,33 @@ void ONMainWindow::slotSshServerAuthPassphrase(SshMasterConnection* connection, } +void ONMainWindow::slotSshServerAuthChallengeResponse(SshMasterConnection* connection, QString Challenge) +{ + bool ok; + QString message; + + message=Challenge; + + QString phrase=QInputDialog::getText(0,connection->getUser()+"@"+connection->getHost()+":"+QString::number(connection->getPort()), + message,QLineEdit::Password,QString::null, &ok); + if(!ok) + { + phrase=QString::null; + } + else + { + if(phrase==QString::null) + phrase=""; + } + connection->setKeyPhrase(phrase); + if(isHidden()) + { + show(); + QTimer::singleShot(1, this, SLOT(hide())); + } +} + + void ONMainWindow::slotSshServerAuthError ( int error, QString sshMessage, SshMasterConnection* connection ) { if ( startHidden ) diff --git a/src/onmainwindow.h b/src/onmainwindow.h index 809fe5f..0962ac6 100644 --- a/src/onmainwindow.h +++ b/src/onmainwindow.h @@ -1036,6 +1036,7 @@ private slots: void slotSshConnectionError ( QString message, QString lastSessionError ); void slotSshServerAuthError ( int error, QString sshMessage, SshMasterConnection* connection ); void slotSshServerAuthPassphrase ( SshMasterConnection* connection, bool verificationCode ); + void slotSshServerAuthChallengeResponse( SshMasterConnection* connection, QString Challenge ); void slotSshUserAuthError ( QString error ); void slotSshConnectionOk(); void slotServSshConnectionOk(QString server); diff --git a/src/sshmasterconnection.cpp b/src/sshmasterconnection.cpp index 8ebac10..1d330a3 100644 --- a/src/sshmasterconnection.cpp +++ b/src/sshmasterconnection.cpp @@ -881,15 +881,21 @@ bool SshMasterConnection::userChallengeAuth() } bool has_challenge_auth_code_prompt = false; + bool need_to_display_auth_code_prompt = false; const std::size_t challenge_auth_code_prompts_size = (sizeof (challenge_auth_code_prompts_)/sizeof (*challenge_auth_code_prompts_)); - for (std::size_t i = 0; i < challenge_auth_code_prompts_size; ++i) { - x2goDebug << "Checking against known prompt #" << i << ": " << challenge_auth_code_prompts_[i] << endl; - - if (pr.startsWith (challenge_auth_code_prompts_[i])) { - has_challenge_auth_code_prompt = true; - break; - } + if( pr.contains("challenge", Qt::CaseInsensitive) ) { + x2goDebug << "prompt contains 'challenge': " << pr << endl; + has_challenge_auth_code_prompt = true; + need_to_display_auth_code_prompt = true; + } else { + for (std::size_t i = 0; i < challenge_auth_code_prompts_size; ++i) { + x2goDebug << "Checking against known prompt #" << i << ": " << challenge_auth_code_prompts_[i] << endl; + if (pr.startsWith (challenge_auth_code_prompts_[i])) { + has_challenge_auth_code_prompt = true; + break; + } + } } if (has_challenge_auth_code_prompt) { @@ -901,7 +907,11 @@ bool SshMasterConnection::userChallengeAuth() if(challengeAuthVerificationCode == QString::null) { keyPhraseReady=false; - emit needPassPhrase(this, true); + if (need_to_display_auth_code_prompt) { + emit needChallengeResponse(this, pr); + } else { + emit needPassPhrase(this, true); + } for(;;) { bool ready=false; diff --git a/src/sshmasterconnection.h b/src/sshmasterconnection.h index 0136ac4..79da49a 100644 --- a/src/sshmasterconnection.h +++ b/src/sshmasterconnection.h @@ -218,6 +218,7 @@ signals: void connectionOk( QString host); void needPassPhrase(SshMasterConnection*, bool verificationCode); + void needChallengeResponse(SshMasterConnection*, QString Challenge); }; -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git