SSH: Catch std::exception rather than Botan-specific ones

In particular, the existence of Botan::Exception wrongly suggests that
it is the parent class of all Botan-specific exceptions. This
assumption, combined with a different bug that will be fixed in a
follow-up commit, caused a crash in the key generator.

Change-Id: I0aafb761052d185051df217c9914010235a7c77b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
Christian Kandeler
2017-05-05 09:55:01 +02:00
parent 7e38b54525
commit 3691fbb8f8
9 changed files with 13 additions and 19 deletions

View File

@@ -199,7 +199,7 @@ int SshConnection::closeAllChannels()
{
try {
return d->m_channelManager->closeAllChannels(Internal::SshChannelManager::CloseAllRegular);
} catch (const Botan::Exception &e) {
} catch (const std::exception &e) {
qCWarning(Internal::sshLog, "%s: %s", Q_FUNC_INFO, e.what());
return -1;
}
@@ -344,7 +344,7 @@ void SshConnectionPrivate::handleIncomingData()
} catch (const SshClientException &e) {
closeConnection(SSH_DISCONNECT_BY_APPLICATION, e.error, "",
e.errorString);
} catch (const Botan::Exception &e) {
} catch (const std::exception &e) {
closeConnection(SSH_DISCONNECT_BY_APPLICATION, SshInternalError, "",
tr("Botan library exception: %1").arg(QString::fromLatin1(e.what())));
}