summaryrefslogtreecommitdiff
path: root/src/cmumble.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmumble.c')
-rw-r--r--src/cmumble.c35
1 files changed, 13 insertions, 22 deletions
diff --git a/src/cmumble.c b/src/cmumble.c
index 00e7afa..844a4d3 100644
--- a/src/cmumble.c
+++ b/src/cmumble.c
@@ -93,28 +93,19 @@ recv_server_sync(MumbleProto__ServerSync *sync, struct cmumble_context *ctx)
static void
recv_crypt_setup(MumbleProto__CryptSetup *crypt, struct cmumble_context *ctx)
{
-#if 0
- int i;
-
- if (crypt->has_key) {
- g_print("key: 0x");
- for (i = 0; i < crypt->key.len; ++i)
- g_print("%x", crypt->key.data[i]);
- g_print("\n");
- }
- if (crypt->has_client_nonce) {
- g_print("client nonce: 0x");
- for (i = 0; i < crypt->client_nonce.len; ++i)
- g_print("%x", crypt->client_nonce.data[i]);
- g_print("\n");
- }
- if (crypt->has_server_nonce) {
- g_print("server nonce: 0x");
- for (i = 0; i < crypt->server_nonce.len; ++i)
- g_print("%x", crypt->server_nonce.data[i]);
- g_print("\n");
- }
-#endif
+ /* FIXME: require all data lengths to be 16? */
+
+ ctx->ocb_key = g_memdup(crypt->key.data,
+ crypt->key.len);
+ ctx->ocb_client_nonce = g_memdup(crypt->client_nonce.data,
+ crypt->client_nonce.len);
+ ctx->ocb_server_nonce = g_memdup(crypt->server_nonce.data,
+ crypt->server_nonce.len);
+
+ ctx->ocb = ocb_aes_init(ctx->ocb_key, 16, NULL);
+ g_assert(ctx->ocb);
+
+ cmumble_connection_udp_init(ctx);
}
static void