aboutsummaryrefslogtreecommitdiff
path: root/include/olm/olm.hh
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-07-16 10:45:10 +0100
committerMark Haines <mark.haines@matrix.org>2015-07-16 10:45:10 +0100
commit89d9b972a6d629648d18f4227a08596c65c3894d (patch)
tree8859231d4d4d73bb56d00c055bac82f05ad34e48 /include/olm/olm.hh
parent7523b700cf5c465a484519aabe0b428c54cb91a0 (diff)
Add versions of olm_session_create_inbound and olm_session_matches_inbound which take the curve25519 identity key of the remote device we think the message is from as an additional argument
Diffstat (limited to 'include/olm/olm.hh')
-rw-r--r--include/olm/olm.hh29
1 files changed, 29 insertions, 0 deletions
diff --git a/include/olm/olm.hh b/include/olm/olm.hh
index 64454e6..f08fb9f 100644
--- a/include/olm/olm.hh
+++ b/include/olm/olm.hh
@@ -242,6 +242,21 @@ size_t olm_create_inbound_session(
void * one_time_key_message, size_t message_length
);
+/** Create a new in-bound session for sending/receiving messages from an
+ * incoming PRE_KEY message. Returns olm_error() on failure. If the base64
+ * couldn't be decoded then olm_session_last_error will be "INVALID_BASE64".
+ * If the message was for an unsupported protocol version then
+ * olm_session_last_error() will be "BAD_MESSAGE_VERSION". If the message
+ * couldn't be decoded then then olm_session_last_error() will be
+ * "BAD_MESSAGE_FORMAT". If the message refers to an unknown one time
+ * key then olm_session_last_error() will be "BAD_MESSAGE_KEY_ID". */
+size_t olm_create_inbound_session_from(
+ OlmSession * session,
+ OlmAccount * account,
+ void const * their_identity_key, size_t their_identity_key_length,
+ void * one_time_key_message, size_t message_length
+);
+
/** Checks if the PRE_KEY message is for this in-bound session. This can happen
* if multiple messages are sent to this account before this account sends a
* message in reply. Returns olm_error() on failure. If the base64
@@ -255,6 +270,20 @@ size_t olm_matches_inbound_session(
void * one_time_key_message, size_t message_length
);
+/** Checks if the PRE_KEY message is for this in-bound session. This can happen
+ * if multiple messages are sent to this account before this account sends a
+ * message in reply. Returns olm_error() on failure. If the base64
+ * couldn't be decoded then olm_session_last_error will be "INVALID_BASE64".
+ * If the message was for an unsupported protocol version then
+ * olm_session_last_error() will be "BAD_MESSAGE_VERSION". If the message
+ * couldn't be decoded then then olm_session_last_error() will be
+ * "BAD_MESSAGE_FORMAT". */
+size_t olm_matches_inbound_session_from(
+ OlmSession * session,
+ void const * their_identity_key, size_t their_identity_key_length,
+ void * one_time_key_message, size_t message_length
+);
+
/** Removes the one time keys that the session used from the account. Returns
* olm_error() on failure. If the account doesn't have any matching one time
* keys then olm_account_last_error() will be "BAD_MESSAGE_KEY_ID". */