| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Pass the received image data through gcrypt to do the decryption
using the previously received keys.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
|
|
|
| |
m.image messages in the e2e world have a different format and
include keys. Decode the extra structures.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
|
|
|
|
| |
For encrypted images the decrypted message contains key information
to decrypt the actual media once received.
Add a structure and a parser to extract the information from the JSON.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
|
|
|
| |
JSON web signatures almost use base64 but with a slightly odd encoding;
decoding a JWS to base64.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
|
|
|
| |
Add a purple action (i.e. thing on the accounts->matrix-> menu)
to display the device ID and public key.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
|
|
| |
Cleanup on closing the plugin or leaving a conversation.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
|
|
| |
Update sessions stored in the db after starting sessions.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
| |
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
|
|
|
| |
Keep a hash/list of olm sessions in memory and load them from the db
if we find we haven't got one.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
|
|
| |
Parse the decrypted JSON and route it back up to the room code.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
|
|
|
| |
Decrypt m.room.encrypted messages sent to a room;
these come out with normal events.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
|
|
|
| |
Decrypted olm messages of type m.room_key create inbound megolm
sessions.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
|
|
|
|
| |
Attach to the room storage for inbound megolm sessions.
TODO: Store to db
TODO: Clean up this list in matrix_room_create_conversation
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
|
|
|
| |
Check the decrypted messages have matching keys/devices etc
before parsing them any further.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
|
|
|
| |
Create an olm inbound session and use it to decrypt the message.
Later patches will handle storing/retrieving the OLM sessions.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
|
|
| |
Parse the top level of m.room.encrypted messages.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
|
|
|
| |
Route the count of remaining one time keys out of the sync result.
We need the newer (v2?) API for this.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
|
|
|
|
|
| |
Parse the device-2-device messages in a sync.
We have to get the order right since we need the rooms created before
parsing the d2d messages, but we may need to have processed the d2d
messages to decrypt events in the room.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
|
|
|
|
|
| |
We're going to need a:
database of olm sessions
a device trust database
a database of megaolm sessions
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
|
|
|
| |
Parse the key upload return to see if we need to send any one time
keys.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
| |
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The server returns the count of one-time-keys that it has,
we parse that and detect if we need to send more.
It's a little tricky in that a server that doesn't have
any keys will send an empty response, so force sending in
that case.
If we get to the point of multiple types of keys this will
need reworking to make sure we only send the key types needed.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
|
|
|
|
| |
If we've got a previously stored olm account state then use it,
else create us a new one.
Either way, upload the device keys to the server.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Parse the output of olm_account_identity_keys to get a list of
algorithms and the keys for them.
There really should be a better way; the algorithm names in here
match what we need in the keys section, but we have to append
the device id later, so it's a pain that it returns (undocumented)
JSON.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
|
|
|
| |
Allocate a blob of memory and fill it with random data.
(There must be some existing portable function for this?!)
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
| |
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
|
|
|
|
|
|
|
| |
The OLM account state can be 'pickled'; we store this in Purple's
account data store as a JSON string.
Note; OLM lets us encrypt the pickle, but we've got no key to encrypt
it with; I don't think Purple has anything for wiring into the
system key store.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
|
|
|
| |
We can't rely on having memset_s, so add our own equivalent that
declares itself volatile.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
| |
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
|
|
|
| |
Given a JsonObject, produce a canonical json blob, sign it and
add the signature back into the JsonObject.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
|
|
| |
Somewhere for the e2e magic to happen.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
|
|
|
| |
Add api call for uploading device and one time keys.
It expects the json blobs to be presigned.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
|
|
|
| |
Matrix signing relies on signing Json formatted to be 'canonical'
as per https://matrix.org/speculator/spec/drafts%2Fe2e/appendices.html#canonical-json
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
|
|
| |
Make matrix-json use spaces rather than tabs.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|
|
|
|
|
|
|
|
|
| |
Windows build not tested.
Note that libolm doesn't currently have the pkgconf magic.
Compile with make -DMATRIX_NO_E2E to disable olm linking
and e2e in general.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|\
| |
| | |
Handle media messages (m.video, m.audio, m.file)
|
| |
| |
| |
| |
| |
| |
| |
| | |
With r0.3.0 thumbnail_info and thumbnail_url for m.image and m.file have
been moved from content to content.info. With this commit those objects
are looked for at the new location and if they're not found, the old
location is checked. Furthermore, if the thumbnail provided is too big,
we ask the server to make a thumbnail of it.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Handle m.video, m.file, m.audio and m.image in _handle_incoming_media.
Remove _handle incoming_image. On incoming media, always print a chat
message with the download link and mimetype/size. If a thumbnail_url is
available and the thumbnail size is small, download and show that. Otherwise,
only for m_image, ask for a server generated thumbnail.
|
|\ \
| | |
| | | |
Join by alias or id; the one remaining commit to use the /join/ api looks like it works
|
| |/ |
|
|\ \
| | |
| | | |
[README] Add Ubuntu pre-built binaries. Fixes #58
|
| |/ |
|
|\ \
| | |
| | |
| | |
| | | |
typing: Fix crash on typing notification to someone not present
(Eion OK'd via Purple on Matrix.org)
|
| |/
| |
| |
| |
| |
| |
| |
| |
| | |
I've seen a crash where the user_id doesn't appear to be a member
of the room; I'm guessing they just left or only just arrived and
we got the typing notification after/before.
Fixes: 61ee52f3230724b5c1e8f81caeb16ce7887d183c
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|
|\ \
| |/
|/| |
[Makefile] Change fixed pkg-config into variable PKG_CONFIG
|
|/ |
|
|\
| |
| | |
[README] Add xenial-specific libglib package
|
|/ |
|
|\
| |
| | |
bump up max reply size
|
|/
|
|
|
|
|
|
|
|
| |
Initial sync's are getting huge, we really need to fix that,
but in the mean time bump the max size up.
I've seen matrix HQ giving out a 5MB reply in the initial sync.
see issue #28.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
|