Age | Commit message (Collapse) | Author |
|
Also fix a leftover data/ prefix in adjust-config.sh
|
|
|
|
Mainly the change is about eliminating the checks for an exact number
of key-value pairs inside `one_time_key_counts` - these checks started
failing with new Synapse throwing `signed_curve25519: 0` into this dict.
|
|
run-tests.sh now uses the latest version of Synapse and has less
repetitive code; adjust-config.sh moved to autotests/ (it had nothing
specific to CI, after all), works with the newest Synapse (that has
an additional enable_registration_without_verification safeguard) and
no more depends on the config directory being called "data" but rather
should be called from inside that directory (for the case when it is
used separately from run-tests.sh and the config directory is not
called "data").
|
|
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.
|
|
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.
|
|
Besides having a misleading name (and it goes back to the spec),
EncryptedFile under `file` key preempts the `url` (or `thumbnail_url`)
string value so only one of the two should exist. This is a case for
using std::variant<> - despite its clumsy syntax, it can actually
simplify and streamline code when all the necessary bits are in place
(such as conversion to JSON and getting the common piece - the URL -
out of it). This commit replaces `FileInfo::url` and `FileInfo::file`
with a common field `source` of type `FileSourceInfo` that is an alias
for a variant type covering both underlying types; and `url()` is
reintroduced as a function instead, to allow simplified access
to whichever URL is available inside the variant.
Oh, and EncryptedFile is EncryptedFileMetadata now, to clarify that it
does not represent the file payload itself but rather the data necessary
to obtain that payload.
|
|
Co-authored-by: Alexey Rusakov <Kitsune-Ral@users.sf.net>
|
|
The ciphertext for AES CTR is exactly as large as the plaintext (not
necessarily a multiple of the blocksize!). By truncating the ciphertext,
we do not send bytes that will be decrypted to gibberish.
As a side node, we probably do not need to initialize the ciphertext
buffer larger than the plaintext size at all, but the OpenSSL docs are a
bit vague about that.
|
|
|
|
Co-authored-by: Tobias Fella <9750016+TobiasFella@users.noreply.github.com>
|
|
As mentioned in the commit introducing `Expected`, `QOlmExpected` is
simply an alias for `Expected<T, QOlmError>`. This simplifies quite
a few function signatures in `QOlm*` classes and collapses unwieldy
`std::holds_alternative<>`/`std::get<>` constructs into a neat
contextual bool cast and an invocation of `operator*` or
`value()`/`error()` accessors that don't need to specify the type.
While refactoring the code, I found a couple of cases of mismatching
`uint32_t` and `qint32_t` in return values; a couple of cases where
`decrypt()` returns `QString` which is in fact `QByteArray` (e.g., in
`QOlmSession::decrypt()`); there's a repetitive algorithm in
`Connection::Private::sessionDecryptPrekey()` and
`sessionDecryptGeneral()`
|
|
There's no particular use in letting `QOlmError` out, only to confirm
that, well, `QOlmError` is just another form of no-match.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
It would probably be even better to pass the homeserver address in
the environment but that's a bigger endeavour.
Also: reformatted CREATE_CONNECTION macro.
|
|
|
|
This both is more reliable (GHA executes scripts in fail-fast mode) and
ensures that the return value is that of ctest.
|
|
QEventLoop refuses to work without an application object instance.
|
|
To use this in CI required extending/fixing autotests/run-tests.sh:
it can now accept arguments that are further passed to ctest invocation,
and it no more cd's to the build directory because build directories
can be in all kinds of places, expecting the caller to pick
the directory upfront.
|
|
|
|
QKeyValueIterator::operator->() only arrived in Qt 5.15.
|
|
The result is FTBFS as yet; next commits will fix that, along with a few
other things.
|
|
|
|
Co-authored-by: Alexey Rusakov <Kitsune-Ral@users.sf.net>
|
|
Co-authored-by: Alexey Rusakov <Kitsune-Ral@users.sf.net>
|
|
These are not required to build libQuotient, and omittable.cpp entirely
consisted of them.
|
|
|
|
|
|
|
|
|
|
Those tests don't even need an event loop.
|
|
Co-authored-by: Alexey Rusakov <Kitsune-Ral@users.sf.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Co-authored-by: Tobias Fella <9750016+TobiasFella@users.noreply.github.com>
|
|
|
|
|