From 6f7ce3f48e2ac4ebe5e04492b11d3a70bed37fb2 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 28 Sep 2012 15:54:10 +0200 Subject: SSH: Work around issue with dynamic_cast. It has been observed that on MacOs, a dynamic_cast from Botan::Public_Key to Botan::RSA_PublicKey reproducibly fails even though it should definitely succeed. This happens with both gcc and clang on different Macs, but on no other platform. The problem could not be reproduced with an example project. The workaround is to move the allocation of the respective object from the client side to the Botan library itself. In addition, the following actions were taken to guard against similar problems in the future: - Also move to Botan the allocations of all other objects that are potentially dynamically cast. - Use shared pointers for these objects, so the deallocation also happens inside Botan. Change-Id: Ie595a56a239a41e2629b6ff631de59910b8244dd Reviewed-by: Eike Ziller --- src/libs/ssh/sshcryptofacility_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libs/ssh/sshcryptofacility_p.h') diff --git a/src/libs/ssh/sshcryptofacility_p.h b/src/libs/ssh/sshcryptofacility_p.h index 5b22429fe4..afd85fbcd0 100644 --- a/src/libs/ssh/sshcryptofacility_p.h +++ b/src/libs/ssh/sshcryptofacility_p.h @@ -117,7 +117,7 @@ private: QByteArray m_authKeyAlgoName; QByteArray m_authPubKeyBlob; QByteArray m_cachedPrivKeyContents; - QScopedPointer m_authKey; + QSharedPointer m_authKey; mutable Botan::AutoSeeded_RNG m_rng; }; -- cgit v1.2.1