From 61413e7a613c3817baa941364f96e71948bf622c Mon Sep 17 00:00:00 2001 From: Markus Theil Date: Fri, 7 Nov 2025 09:09:20 +0100 Subject: [PATCH] fix build with Botan 3.10 This fixes a compiler error I got, when trying to build with Botan 3.10. A static_cast to RSA_PrivateKey was not possible, as the base class is virtual. Fix by using a dynamic_cast instead. Signed-off-by: Markus Theil --- src/keeshare/KeeShareSettings.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/keeshare/KeeShareSettings.cpp b/src/keeshare/KeeShareSettings.cpp index 4f53fc25f..fa500eb5d 100644 --- a/src/keeshare/KeeShareSettings.cpp +++ b/src/keeshare/KeeShareSettings.cpp @@ -363,7 +363,11 @@ namespace KeeShareSettings // Extract RSA key data to serialize an ssh-rsa public key. // ssh-rsa keys are currently not built into Botan - const auto rsaKey = static_cast(sign.certificate.key.data()); + // need a dynamic_cast here, because the base class is virtual + const auto rsaKey = dynamic_cast(sign.certificate.key.data()); + if (!rsaKey) { + return {}; + } std::vector rsaE(rsaKey->get_e().bytes()); rsaKey->get_e().binary_encode(rsaE.data());