From 6b020cb54b3cda27065eb06d8b0c9e4a9f4c7f10 Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Fri, 8 Sep 2023 10:25:01 +0200 Subject: [PATCH] clean code Signed-off-by: Matthieu Gallien --- src/libsync/clientsideencryption.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/libsync/clientsideencryption.cpp b/src/libsync/clientsideencryption.cpp index b90d8f9c89088..02af0bffb54f5 100644 --- a/src/libsync/clientsideencryption.cpp +++ b/src/libsync/clientsideencryption.cpp @@ -670,7 +670,6 @@ namespace internals { [[nodiscard]] std::optional decryptStringAsymmetricWithToken(ENGINE *sslEngine, PKCS11_KEY *privateKey, - EVP_PKEY *publicKey, const QByteArray &binaryData); } @@ -743,7 +742,6 @@ std::optional decryptStringAsymmetric(const ClientSideEncryption &en const auto decryptBase64Result = internals::decryptStringAsymmetricWithToken(encryptionEngine.sslEngine(), encryptionEngine.getTokenPrivateKey(), - PKCS11_get_public_key(encryptionEngine.getTokenPublicKey()), QByteArray::fromBase64(base64Data)); if (!decryptBase64Result) { qCWarning(lcCse()) << "decrypt failed"; @@ -1006,14 +1004,9 @@ std::optional encryptStringAsymmetricWithToken(ENGINE *sslEngine, std::optional decryptStringAsymmetricWithToken(ENGINE *sslEngine, PKCS11_KEY *privateKey, - EVP_PKEY *publicKey, const QByteArray &binaryData) { - const auto encryptedData = binaryData; - const auto initialLength = RSA_size(EVP_PKEY_get0_RSA(publicKey)); - QByteArray decryptedData{initialLength, 0}; - auto rsaPrivateKey = PKCS11_get_private_key(privateKey); - return decryptStringAsymmetric(sslEngine, rsaPrivateKey, RSA_PKCS1_PADDING, binaryData); + return decryptStringAsymmetric(sslEngine, PKCS11_get_private_key(privateKey), RSA_PKCS1_PADDING, binaryData); } }