Age | Commit message (Collapse) | Author |
|
|
|
Prepare changelog for v1.2.0
|
|
|
|
Sign megolm messages
|
|
Add ed25519 keys to the inbound and outbound sessions, and use them to sign and
verify megolm messages.
We just stuff the ed25519 public key in alongside the megolm session key (and
add a version byte), to save adding more boilerplate to the JS/python/etc
layers.
|
|
Remove redundant args from some js funcs, and fix a comment typo
|
|
Convert ed25519 pickling functions to C
|
|
Fix error handling for group sessions
|
|
Fix a couple of places where we were using the wrong method to get the last
error.
|
|
|
|
|
|
|
|
... so that I can use them from the group session bits.
|
|
... because OSX doesn't support it.
|
|
Convert crypto.hh into C-compatible interface
|
|
|
|
|
|
OlmSession.has_received_message
|
|
Fix megolm decryption of UTF-8
|
|
Create new constants for key lengths, etc
|
|
Repeat the fix from b10f90d for megolm messages.
It turns out that the 'length' argument to 'Pointer_stringify' doesn't work if
the input includes characters >= 128.
Rather than try to figure out which methods can return UTF-8, and which always
return plain ascii, replace all uses of Pointer_stringify with a 'length'
argument with the version that expects a NULL-terminated input, and extend the
buffer by a byte to allow space for a null-terminator.
In the case of decrypt, we need to add the null ourself.
Fixes https://github.com/vector-im/vector-web/issues/2078.
|
|
I find myself wanting to know if an OlmSession is in the pre-key state or not,
to help debugging at the application level.
|
|
We were using olm::KEY_LENGTH for everything under the sun which happened to be
32 bytes long, and making a bunch of assumptions in the process. Create a bunch
of new constants (as C #defines rather than C++ consts so that I can use them
in another forthcoming refactor).
|
|
... to match the Makefile
|
|
|
|
|
|
pre-1.0.0 was broken too
|
|
Ed25519 private keys, it turns out, have 64 bytes, not 32.
We were previously generating only 32 bytes (which is all that is required to
generate the public key), and then using the public key as the upper 32 bytes
when generating the per-message session key. This meant that everything
appeared to work, but the security of the private key was severely compromised.
By way of fixes:
* Use the correct algorithm for generating the Ed25519 private key, and store
all 512 bits of it.
* Update the account pickle format and refuse to load the old format (since we
should consider it compromised).
* Bump the library version, and add a function to retrieve the library
version, so that applications can verify that they are linked against a
fixed version of the library.
* Remove the curve25519_{sign, verify} functions which were unused and of
dubious quality.
|
|
|
|
|
|
|
|
|
|
|
|
It turns out that the 'length' argument to 'Pointer_stringify' doesn't work if
the input includes characters >= 128.
Rather than try to figure out which methods can return UTF-8, and which always
return plain ascii, replace all uses of Pointer_stringify with a 'length'
argument with the version that expects a NULL-terminated input, and extend the
buffer by a byte to allow space for a null-terminator.
In the case of decrypt, we need to add the null ourself.
Fixes https://github.com/vector-im/vector-web/issues/1719.
|
|
This makes the user able to use the familiar `make install` syntax, and
allows overriding of the default directories using the DESTDIR and
PREFIX variables, for example:
make DESTDIR=packaging PREFIX=/usr install
|
|
This provides users of this library the guarantee that the ABI will
stay stable when MAJOR will reach 1, and will stay backwards compatible
for the entire duration of the 1.x.y branch.
It does require the maintainers to always update the version in the
Makefile at every ABI change.
|
|
* write V1 pickles on the master branch
* the logging branch is going to write v0x80000001
|
|
Keeping track of the chain index is a useful thing to do, but is only required
if we've enabled diagnostics. Extend the session pickle format to make a space
for it, so that pickles can be transferred between the logging_enabled branch
and the master branch without loss of information.
Also add some tests for session pickling which explicitly check that we can
unpickle both formats of pickle.
|
|
This was introduced when I was experimenting with support for logging progress
in Olm. That is now relegated to the logging_enabled branch, so this should
probably be removed.
This also fixes the incompatibility of session pickles from the current master
branch with those from olm 0.1.0.
|
|
It's important that group messages be signed by the sender, rather than by a
secret derived from the shared secret.
|
|
To make sure that we don't sneakily use methods which we wouldn't be able to
for remote users, expose an interface object which contains the remote
interface.
|
|
|
|
message.length counts codepoints; we need bytes.
|
|
|
|
|
|
|
|
|
|
Putting the session_id inside the packed message body makes it hard to extract
so that we can decide which session to use. We don't think there is any
advantage to having thes sesion_id protected by the HMACs, so we're going to
move it to the JSON framing.
|
|
sha256.c and aes.c contain conflicting declarations, so we need to compile them
as separate units. This requires a bit more Makefile-shuffling; the build
directory now includes 'src' or 'lib' as appropriate, and we just mkdir -p
before each compilation.
|
|
|