Age | Commit message (Collapse) | Author |
|
Since this object has to be verified against a signature it also carries
there's a rather specific procedure described in The Spec for that.
That procedure basically assumes handling the signed one-time key
object as a JSON object, not as a C++ object. And originally Quotient
E2EE code was exactly like that (obtaining the right QJsonObject from
the job result and handling it as specced) but then one enthusiastic
developer (me) decided it's better to use a proper C++ structure -
breaking the verification logic along the way. After a couple attempts
to fix it, here we are again: SignedOneTimeKey is a proper QJsonObject,
and even provides a method returning its JSON in the form prepared for
verification (according to the spec).
|
|
|
|
Now there's only 1 instead of 5 lookups of the same EncryptionEvent,
and the code is shorter.
|
|
In keyverificationevent.*, this massively shortens repetitive getter
definitions; the remaining few non-trivial ones are moved to
keyverificationevent.h, dropping the respective .cpp file and therefore
the dedicated translation unit. In roomkeyevent.h, it's just shorter.
|
|
|
|
toJson(SignedOneTimeKey) incorrectly generated a "signatures" key
mapped to an empty object when no signatures were in the C++ value.
Also: fallback keys have an additional flag that also has to be taken
into account when verifying signatures.
|
|
Honestly, it was quite intuitive even without that, but in reality
there are implicit conversion under the wraps. This commit makes them
explicit, for clarity.
|
|
Also: leave a link at the place in the spec with power level defaults
to make it clear they are not invented out of thin air.
|
|
|
|
Also: make ImplPtr more flexible.
|
|
|
|
|
|
...instead of tucking the template in filesourceinfo.cpp where it surely
will be forgotten.
|
|
|
|
|
|
This pertains to QUO_IMPLICIT and DECL_DEPRECATED_ENUMERATOR - both can
be used with no connection to Qt meta-type system (which is what
quotient_common.h is for).
|
|
make_array() has been introduced to cover for shortcomings on macOS and
Windows. These shortcomings are no more there, so we can just use the
standardrlibrary.
|
|
|
|
|
|
Also: build with Qt 6 first, so that it fails sooner.
|
|
Although Qt 5 didn't complain about that, you could never really use
sendToDevices() in its slot (or even invocable) capacity because
Qt's meta-type system could not handle move-only UsersToDevicesToEvents.
Qt 6 is more stringent; the build fails at trying to instantiate
QMetaType for that type (with a rather unhelpful error message thrown
by Clang, and more helpful but very verbose diagnostic from MSVC)
because it does not provide a copy constructor.
However, sendToDevice doesn't really need to have full-blown events
in that parameter; just the content of the event is equally fine.
This commit does exactly that: replaces UsersToDevicesToEvents with
UsersToDevicesToContent that contains QJsonObject's instead of
EventPtr's. The code around is updated accordingly.
Also: factor out the key event JSON creation from
makeMessageEventForSessionKey() because it's the same JSON for each
target device; the function therefore is called encryptSessionKeyEvent()
now.
|
|
New:
- refresh tokens support (changes in login.* and registration.*;
RefreshJob);
- GetRelatingEvents[WithRelType[AndEventType]]Job
Changed space_hierarchy.*:
- childrenState is of type StateEvents now; limit and maxDepth are
(omittable) integers, not doubles.
- no more unused `stripped_state.h` file inclusion.
|
|
The latest GTAD no more emits public_rooms_chunk.h
(public_rooms_response.h already has the same definition), and skips on
PublicRoomsResponse structure that is never used.
|
|
This reimplements #558 in a more reliable way. Deconstruction of
AccountRegistry may (or may not, yay for static initialisation) occur
after deconstruction of QCoreApplication, in which case an attempt
to determine the directory for the state fails because it depends on
the application object existence.
|
|
This only updates 3 files affected by the change in the previous commit.
|
|
|
|
|
|
deferring until sending event
|
|
|
|
|
|
|
|
|
|
|
|
There was a fairly nasty change where `from` parameter in /messages
became optional and that led to two QString parameters (`from` and `dir)
switching positions. Because they have the same type, the problem only
shows at runtime. This commit fixes Room::getPreviousContent() to pass
the parameters at right positions; client code won't feel anything
(unless it uses GetRoomEventsJob directly).
|
|
This is mainly to plug the definition of a string-to-variant map
for one-time keys (see
https://spec.matrix.org/v1.2/client-server-api/#key-algorithms) into
the CS API generated code (see the "shortcut OneTimeKeys" commit for
gtad.yaml); but along with it came considerable streamlining of code
in qolmaccount.cpp. Using std::variant to store that map also warranted
converters.h to gain support for that type (even wider than toJson()
that is already in dev - a non-trivial merge from dev is in order).
|
|
|
|
|
|
On Debug builds this would lead to an assertion failure inside Qt.
|
|
|
|
|
|
...not before.
|
|
Load and store accounts in the keychain
|
|
|
|
|
|
Co-authored-by: Alexey Rusakov <Kitsune-Ral@users.sf.net>
|
|
Functions (Room::Private::)createOlmSession, payloadForUserDevice
and sendRoomKeyToDevices don't have a lot to do with the given Room
object but deal with quite a few things stored in Connection. This
commit moves them to Connection::Private, exposing
sendSessionKeyToDevices (the new name for sendRoomKeyToDevices) in
Connection so that Room could call it from Room::P::sendMegolmSession().
While moving these over, a few additional things were adjusted:
- more functions marked as const
- a few functions could be moved now from Connection
to Connection::Private
- false slots in Connection (such as picklingMode) are moved out of
the slots block
- keys.yml in Matrix CS API definitions has been adjusted to match
the real structure of `/claim` response (see quotient-im/matrix-spec
repo); csapi/keys.h has been regenerated accordingly.
|
|
Notably, replace a multi-level hash map with QMultiHash and factor out
Room::P::createOlmSession().
|
|
|
|
|
|
These are not operations on EncryptedFileMetadata but rather on
a combination of EncryptedFileMetadata and ciphertext. If C++ had
multimethods these could be bound to such a combination.
|