Skip to content

Commit 820e33a

Browse files
committed
start using OpenSSL API for hardware token
Signed-off-by: Matthieu Gallien <[email protected]>
1 parent 2b814ce commit 820e33a

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/libsync/clientsideencryption.cpp

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#include "clientsideencryption.h"
22

3+
#define OPENSSL_SUPPRESS_DEPRECATED
4+
35
#include <openssl/rsa.h>
46
#include <openssl/evp.h>
57
#include <openssl/pem.h>
@@ -34,6 +36,8 @@
3436
#include <QRandomGenerator>
3537
#include <QCryptographicHash>
3638

39+
#include <openssl/provider.h>
40+
3741
#include <map>
3842
#include <string>
3943
#include <algorithm>
@@ -874,7 +878,15 @@ QByteArray encryptStringAsymmetric(EVP_PKEY *publicKey, const QByteArray& data)
874878
}
875879

876880

877-
ClientSideEncryption::ClientSideEncryption() = default;
881+
ClientSideEncryption::ClientSideEncryption()
882+
{
883+
auto defaultProvider = OSSL_PROVIDER_load(NULL, "default");
884+
885+
qCInfo(lcCse()) << "loaded provider" << defaultProvider;
886+
887+
_sslEngine = ENGINE_new();
888+
qCInfo(lcCse()) << "ssl engine" << _sslEngine;
889+
}
878890

879891
const QSslKey &ClientSideEncryption::getPublicKey() const
880892
{

src/libsync/clientsideencryption.h

+2
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,8 @@ private slots:
222222
bool _newMnemonicGenerated = false;
223223

224224
bool isInitialized = false;
225+
226+
ENGINE *_sslEngine = nullptr;
225227
};
226228

227229
/* Generates the Metadata for the folder */

0 commit comments

Comments
 (0)