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 <eike.ziller@digia.com>
Showing
- src/libs/3rdparty/botan/botan.cpp 41 additions, 0 deletionssrc/libs/3rdparty/botan/botan.cpp
- src/libs/3rdparty/botan/botan.h 20 additions, 0 deletionssrc/libs/3rdparty/botan/botan.h
- src/libs/ssh/sshcryptofacility.cpp 6 additions, 9 deletionssrc/libs/ssh/sshcryptofacility.cpp
- src/libs/ssh/sshcryptofacility_p.h 1 addition, 1 deletionsrc/libs/ssh/sshcryptofacility_p.h
- src/libs/ssh/sshkeyexchange.cpp 9 additions, 14 deletionssrc/libs/ssh/sshkeyexchange.cpp
- src/libs/ssh/sshkeyexchange_p.h 2 additions, 1 deletionsrc/libs/ssh/sshkeyexchange_p.h
- src/libs/ssh/sshkeygenerator.cpp 2 additions, 2 deletionssrc/libs/ssh/sshkeygenerator.cpp
Loading
Please register or sign in to comment