Skip to content

Commit 0567e97

Browse files
committed
fix code configuring the asymetric crypto mechanisms
should allow usage of USB token based end-to-end encryption Signed-off-by: Matthieu Gallien <[email protected]>
1 parent 81fdd9c commit 0567e97

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/libsync/clientsideencryption.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -886,12 +886,12 @@ std::optional<QByteArray> decryptStringAsymmetric(ENGINE *sslEngine,
886886
return {};
887887
}
888888

889-
if (EVP_PKEY_CTX_set_rsa_oaep_md(ctx, EVP_sha256()) <= 0) {
889+
if (pad_mode != RSA_PKCS1_PADDING && EVP_PKEY_CTX_set_rsa_oaep_md(ctx, EVP_sha256()) <= 0) {
890890
qCInfo(lcCseDecryption()) << "Error setting OAEP SHA 256" << handleErrors();
891891
return {};
892892
}
893893

894-
if (EVP_PKEY_CTX_set_rsa_mgf1_md(ctx, EVP_sha256()) <= 0) {
894+
if (pad_mode != RSA_PKCS1_PADDING && EVP_PKEY_CTX_set_rsa_mgf1_md(ctx, EVP_sha256()) <= 0) {
895895
qCInfo(lcCseDecryption()) << "Error setting MGF1 padding" << handleErrors();
896896
return {};
897897
}
@@ -946,12 +946,12 @@ std::optional<QByteArray> encryptStringAsymmetric(ENGINE *sslEngine,
946946
return {};
947947
}
948948

949-
if (EVP_PKEY_CTX_set_rsa_oaep_md(ctx, EVP_sha256()) <= 0) {
949+
if (pad_mode != RSA_PKCS1_PADDING && EVP_PKEY_CTX_set_rsa_oaep_md(ctx, EVP_sha256()) <= 0) {
950950
qCInfo(lcCseEncryption()) << "Error setting OAEP SHA 256";
951951
return {};
952952
}
953953

954-
if (EVP_PKEY_CTX_set_rsa_mgf1_md(ctx, EVP_sha256()) <= 0) {
954+
if (pad_mode != RSA_PKCS1_PADDING && EVP_PKEY_CTX_set_rsa_mgf1_md(ctx, EVP_sha256()) <= 0) {
955955
qCInfo(lcCseEncryption()) << "Error setting MGF1 padding";
956956
return {};
957957
}

0 commit comments

Comments
 (0)