aboutsummaryrefslogtreecommitdiff
path: root/include/olm
diff options
context:
space:
mode:
Diffstat (limited to 'include/olm')
-rw-r--r--include/olm/olm.hh13
-rw-r--r--include/olm/session.hh6
2 files changed, 19 insertions, 0 deletions
diff --git a/include/olm/olm.hh b/include/olm/olm.hh
index f08fb9f..a5a50de 100644
--- a/include/olm/olm.hh
+++ b/include/olm/olm.hh
@@ -257,6 +257,19 @@ size_t olm_create_inbound_session_from(
void * one_time_key_message, size_t message_length
);
+/** The length of the buffer needed to return the id for this session. */
+size_t olm_session_id_length(
+ OlmSession * session
+);
+
+/** An identifier for this session. Will be the same for both ends of the
+ * conversation. If the id buffer is too small then olm_session_last_error()
+ * will be "OUTPUT_BUFFER_TOO_SMALL". */
+size_t olm_session_id(
+ OlmSession * session,
+ void * id, size_t id_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
diff --git a/include/olm/session.hh b/include/olm/session.hh
index b70ce6a..993a8da 100644
--- a/include/olm/session.hh
+++ b/include/olm/session.hh
@@ -54,6 +54,12 @@ struct Session {
std::uint8_t const * one_time_key_message, std::size_t message_length
);
+ std::size_t session_id_length();
+
+ std::size_t session_id(
+ std::uint8_t * id, std::size_t id_length
+ );
+
bool matches_inbound_session(
Curve25519PublicKey const * their_identity_key,
std::uint8_t const * one_time_key_message, std::size_t message_length