diff options
author | Hubert Chathi <hubert@uhoreg.ca> | 2019-10-09 15:37:56 +0000 |
---|---|---|
committer | Hubert Chathi <hubert@uhoreg.ca> | 2019-10-09 15:37:56 +0000 |
commit | 387deeea8f66c93d84083790fd7b90bee0007ef9 (patch) | |
tree | c5dc092e5bb83b5a17863992396f0b82158c1e43 /include/olm | |
parent | 3568060570bb06eff022f49ab39cf34e387e382f (diff) | |
parent | fc423fad15ee3daaf236f211d67a25d03f63b560 (diff) |
Merge branch 'dbkr/olm_session_describe' into 'master'
Add olm_session_describe
See merge request matrix-org/olm!9
Diffstat (limited to 'include/olm')
-rw-r--r-- | include/olm/olm.h | 6 | ||||
-rw-r--r-- | include/olm/session.hh | 8 |
2 files changed, 14 insertions, 0 deletions
diff --git a/include/olm/olm.h b/include/olm/olm.h index 61ea07b..6a2b3fb 100644 --- a/include/olm/olm.h +++ b/include/olm/olm.h @@ -318,6 +318,12 @@ int olm_session_has_received_message( OlmSession *session ); +/** + * Write a null-terminated string describing the internal state of an olm + * session to the buffer provided for debugging and logging purposes. + */ +void olm_session_describe(OlmSession * session, char *buf, size_t buflen); + /** 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. The one_time_key_message buffer is destroyed. Returns 1 if diff --git a/include/olm/session.hh b/include/olm/session.hh index 9d44816..ce05fc8 100644 --- a/include/olm/session.hh +++ b/include/olm/session.hh @@ -131,6 +131,14 @@ struct Session { std::uint8_t const * message, std::size_t message_length, std::uint8_t * plaintext, std::size_t max_plaintext_length ); + + /** + * Write a string describing this session and its state (not including the + * private key) into the buffer provided. + * + * Takes a buffer to write to and the length of that buffer + */ + void describe(char *buf, size_t buflen); }; |