diff options
| author | Patrick | 2023-08-26 14:41:39 +0200 |
|---|---|---|
| committer | Patrick | 2023-08-26 14:41:39 +0200 |
| commit | 8d8ae609f0201ec4640738ff49b768e899695423 (patch) | |
| tree | 1e70b0cd59d503fa6b02bd3c84eb84ec46325ff0 /src/matrix.h | |
| parent | c7aba5979c820958aa08947903afb47ace496a16 (diff) | |
| download | matrix_esp_thesis-8d8ae609f0201ec4640738ff49b768e899695423.tar.gz matrix_esp_thesis-8d8ae609f0201ec4640738ff49b768e899695423.zip | |
able to send encrypted messages :)
Diffstat (limited to 'src/matrix.h')
| -rw-r--r-- | src/matrix.h | 48 |
1 files changed, 39 insertions, 9 deletions
diff --git a/src/matrix.h b/src/matrix.h index 3614b6a..b51d0e9 100644 --- a/src/matrix.h +++ b/src/matrix.h @@ -56,6 +56,7 @@ typedef struct MatrixDevice {
char deviceId[DEVICE_ID_SIZE];
char deviceKey[DEVICE_KEY_SIZE];
+ char signingKey[SIGNING_KEY_SIZE];
} MatrixDevice;
@@ -70,11 +71,27 @@ bool MatrixOlmAccountInit(
MatrixOlmAccount * account);
+bool
+MatrixOlmAccountUnpickle(
+ MatrixOlmAccount * account,
+ void * pickled, int pickledLen,
+ const void * key, int keyLen);
+
+bool
+MatrixOlmAccountGetDeviceKey(
+ MatrixOlmAccount * account,
+ char * key, int keyCap);
+
+bool
+MatrixOlmAccountGetSigningKey(
+ MatrixOlmAccount * account,
+ char * key, int keyCap);
+
// Matrix Olm Session
typedef struct MatrixOlmSession {
- const char * deviceId;
+ const char * deviceId; // TODO: char[]
int type;
OlmSession * session;
@@ -82,6 +99,13 @@ typedef struct MatrixOlmSession { } MatrixOlmSession;
bool
+MatrixOlmSessionUnpickle(
+ MatrixOlmSession * session,
+ const char * deviceId,
+ void * pickled, int pickledLen,
+ const void * key, int keyLen);
+
+bool
MatrixOlmSessionTo(
MatrixOlmSession * session,
OlmAccount * olmAccount,
@@ -151,8 +175,8 @@ typedef struct MatrixClient { MatrixDevice devices[NUM_DEVICES];
int numDevices;
- char deviceKey[DEVICE_KEY_SIZE];
- char signingKey[DEVICE_KEY_SIZE];
+ // char deviceKey[DEVICE_KEY_SIZE];
+ // char signingKey[DEVICE_KEY_SIZE];
char userId[USER_ID_SIZE];
char server[SERVER_SIZE];
@@ -204,7 +228,7 @@ MatrixClientUploadOnetimeKeys( MatrixClient * client);
bool
-MatrixClientUploadDeviceKeys(
+MatrixClientUploadDeviceKey(
MatrixClient * client);
bool
@@ -250,6 +274,7 @@ MatrixClientShareMegolmOutSession( bool
MatrixClientShareMegolmOutSessionTest(
MatrixClient * client,
+ const char * userId,
const char * deviceId,
MatrixMegolmOutSession * session);
@@ -294,21 +319,25 @@ MatrixClientSendToDeviceEncrypted( const char * msgType);
bool
-MatrixClientGetDeviceKey(
+MatrixClientRequestDeviceKey(
MatrixClient * client,
const char * deviceId,
char * outDeviceKey, int outDeviceKeyCap);
-
+
bool
-MatrixClientGetDeviceKey(
+MatrixClientRequestSigningKey(
MatrixClient * client,
const char * deviceId,
- char * outDeviceKey, int outDeviceKeyCap);
+ char * outSigningKey, int outSigningKeyCap);
bool
MatrixClientRequestDeviceKeys(
MatrixClient * client);
+bool
+MatrixClientDeleteDevice(
+ MatrixClient * client);
+
@@ -357,7 +386,8 @@ JsonEscape( const char * sIn, int sInLen,
char * sOut, int sOutCap);
-bool JsonSign(
+bool
+JsonSign(
MatrixClient * client,
const char * sIn, int sInLen,
char * sOut, int sOutCap);
|
