aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan S. Evans <evans@in.tum.de>2008-04-01 22:09:36 +0000
committerNathan S. Evans <evans@in.tum.de>2008-04-01 22:09:36 +0000
commitb6369ea8452cf1b3cbae60204408ed51471ae918 (patch)
tree28fe5f2d1bcacd497f681e5e41d7d0c41e09b731
parentb61c3a5ffb896344acc5d5ae27a499181fc5cb80 (diff)
downloadgnunet-gtk-b6369ea8452cf1b3cbae60204408ed51471ae918.tar.gz
gnunet-gtk-b6369ea8452cf1b3cbae60204408ed51471ae918.zip
-rw-r--r--src/plugins/chat/chat.c20
-rw-r--r--src/plugins/chat/chat.h2
2 files changed, 11 insertions, 11 deletions
diff --git a/src/plugins/chat/chat.c b/src/plugins/chat/chat.c
index 626b202e..2fe5f84e 100644
--- a/src/plugins/chat/chat.c
+++ b/src/plugins/chat/chat.c
@@ -28,9 +28,6 @@
28 28
29#include "chat.h" 29#include "chat.h"
30 30
31GNUNET_RSA_PublicKey pub_key;
32const struct GNUNET_RSA_PrivateKey *priv_key;
33
34static struct GNUNET_ClientServerConnection *sock; 31static struct GNUNET_ClientServerConnection *sock;
35 32
36static struct GNUNET_Mutex *lock; 33static struct GNUNET_Mutex *lock;
@@ -230,10 +227,9 @@ init_chat (struct GNUNET_GE_Context *ectx,
230 chat_cfg = cfg; 227 chat_cfg = cfg;
231 room_member_list = NULL; 228 room_member_list = NULL;
232 229
233 /*GNUNET_disable_entropy_gathering (); */ 230
234 /* FIXME: yes G, read key from disk */ 231 /*priv_key = GNUNET_RSA_create_key ();
235 priv_key = GNUNET_RSA_create_key (); 232 GNUNET_RSA_get_public_key (priv_key, &pub_key);*/
236 GNUNET_RSA_get_public_key (priv_key, &pub_key);
237 233
238 sock = GNUNET_client_connection_create (chat_ectx, chat_cfg); 234 sock = GNUNET_client_connection_create (chat_ectx, chat_cfg);
239 lock = GNUNET_mutex_create (GNUNET_NO); 235 lock = GNUNET_mutex_create (GNUNET_NO);
@@ -298,14 +294,16 @@ create_chat_room_tab (char *room_name, char *nick)
298 client = GNUNET_malloc (sizeof (struct GNUNET_CHAT_gui_chat_client)); 294 client = GNUNET_malloc (sizeof (struct GNUNET_CHAT_gui_chat_client));
299 client->room_name = GNUNET_malloc (strlen (room_name)); 295 client->room_name = GNUNET_malloc (strlen (room_name));
300 strcpy (client->room_name, room_name); 296 strcpy (client->room_name, room_name);
301 297
298 client->priv_key = NULL;
299 client->priv_key = GNUNET_CHAT_initPrivateKey (chat_ectx,chat_cfg,room_name,&client->pub_key);
302 300
303 /* We do a silly strdup later on member_info... either check for NULL or only pass "" for member_info!! */ 301 /* We do a silly strdup later on member_info... either check for NULL or only pass "" for member_info!! */
304 chatRoom = 302 chatRoom =
305 GNUNET_CHAT_join_room (chat_ectx, chat_cfg, nick, room_name, &pub_key, 303 GNUNET_CHAT_join_room (chat_ectx, chat_cfg, nick, room_name, &client->pub_key,
306 priv_key, "", &receive_callback, client, 304 client->priv_key, "", &receive_callback, client,
307 &member_list_callback, client); 305 &member_list_callback, client);
308 306
309 client->room = chatRoom; 307 client->room = chatRoom;
310 client->chatFrame = newChatWindow; 308 client->chatFrame = newChatWindow;
311 client->number = 309 client->number =
diff --git a/src/plugins/chat/chat.h b/src/plugins/chat/chat.h
index 0b9900a0..fd395176 100644
--- a/src/plugins/chat/chat.h
+++ b/src/plugins/chat/chat.h
@@ -45,6 +45,8 @@ struct GNUNET_CHAT_gui_chat_client
45{ 45{
46 struct GNUNET_CHAT_gui_chat_client *next; 46 struct GNUNET_CHAT_gui_chat_client *next;
47 struct GNUNET_CHAT_gui_chat_client *prev; 47 struct GNUNET_CHAT_gui_chat_client *prev;
48 GNUNET_RSA_PublicKey pub_key;
49 const struct GNUNET_RSA_PrivateKey *priv_key;
48 int number; 50 int number;
49 GtkWidget *chatFrame; 51 GtkWidget *chatFrame;
50 struct GNUNET_CHAT_Room *room; 52 struct GNUNET_CHAT_Room *room;