diff options
author | Alexey Andreyev <aa13q@ya.ru> | 2021-01-28 23:51:56 +0300 |
---|---|---|
committer | Tobias Fella <fella@posteo.de> | 2021-12-01 21:34:52 +0100 |
commit | d72f220e3e3a3b243fdafd93d1405f8207dc516a (patch) | |
tree | f4306b6397e39d6842a29f9a31fe5c858be8a4af /lib/crypto/qolminboundsession.cpp | |
parent | 9f71b2a79fba7c5d5ce09ebfdd482c8c470203d9 (diff) | |
download | libquotient-d72f220e3e3a3b243fdafd93d1405f8207dc516a.tar.gz libquotient-d72f220e3e3a3b243fdafd93d1405f8207dc516a.zip |
E2EE: initial port to internal olm wrapper
Remove qtolm git module. Update CMakeLists.txt.
Rename olm to crypto subdir to prevent disambiguation. Rename internal
files accordingly. Comment out not ported E2EE API usage.
Diffstat (limited to 'lib/crypto/qolminboundsession.cpp')
-rw-r--r-- | lib/crypto/qolminboundsession.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/crypto/qolminboundsession.cpp b/lib/crypto/qolminboundsession.cpp index 539fdc51..8f5056d8 100644 --- a/lib/crypto/qolminboundsession.cpp +++ b/lib/crypto/qolminboundsession.cpp @@ -8,7 +8,7 @@ #include <cstring> using namespace Quotient; -OlmError lastError(OlmInboundGroupSession *session) { +QOlmError lastError(OlmInboundGroupSession *session) { const std::string error_raw = olm_inbound_group_session_last_error(session); std::cout << error_raw; @@ -75,7 +75,7 @@ QByteArray QOlmInboundGroupSession::pickle(const PicklingMode &mode) const return pickledBuf; } -std::variant<std::unique_ptr<QOlmInboundGroupSession>, OlmError> QOlmInboundGroupSession::unpickle(QByteArray &pickled, const PicklingMode &mode) +std::variant<std::unique_ptr<QOlmInboundGroupSession>, QOlmError> QOlmInboundGroupSession::unpickle(QByteArray &pickled, const PicklingMode &mode) { QByteArray pickledBuf = pickled; const auto groupSession = olm_inbound_group_session(new uint8_t[olm_inbound_group_session_size()]); @@ -90,7 +90,7 @@ std::variant<std::unique_ptr<QOlmInboundGroupSession>, OlmError> QOlmInboundGrou return std::make_unique<QOlmInboundGroupSession>(groupSession); } -std::variant<std::pair<QString, uint32_t>, OlmError> QOlmInboundGroupSession::decrypt(const QByteArray &message) +std::variant<std::pair<QString, uint32_t>, QOlmError> QOlmInboundGroupSession::decrypt(const QByteArray &message) { // This is for capturing the output of olm_group_decrypt uint32_t messageIndex = 0; @@ -122,7 +122,7 @@ std::variant<std::pair<QString, uint32_t>, OlmError> QOlmInboundGroupSession::de return std::make_pair<QString, qint32>(QString(output), messageIndex); } -std::variant<QByteArray, OlmError> QOlmInboundGroupSession::exportSession(uint32_t messageIndex) +std::variant<QByteArray, QOlmError> QOlmInboundGroupSession::exportSession(uint32_t messageIndex) { const auto keyLen = olm_export_inbound_group_session_length(m_groupSession); QByteArray keyBuf(keyLen, '0'); |