summaryrefslogtreecommitdiffstats
path: root/friendfinder/sender.c
diff options
context:
space:
mode:
authorPatrick Hornecker2010-02-19 13:54:27 +0100
committerPatrick Hornecker2010-02-19 13:54:27 +0100
commit0b6b032e0293ebd62c146f27622487bb87c7b773 (patch)
treea90a92c0683594d5bf38dfcd364b8a785d69b4f5 /friendfinder/sender.c
parenttex source (diff)
downloadfriendfinder-0b6b032e0293ebd62c146f27622487bb87c7b773.tar.gz
friendfinder-0b6b032e0293ebd62c146f27622487bb87c7b773.tar.xz
friendfinder-0b6b032e0293ebd62c146f27622487bb87c7b773.zip
few bugs fixed, redrawing of bubbels changed
Diffstat (limited to 'friendfinder/sender.c')
-rw-r--r--friendfinder/sender.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/friendfinder/sender.c b/friendfinder/sender.c
index 1d157cb..6f67730 100644
--- a/friendfinder/sender.c
+++ b/friendfinder/sender.c
@@ -7,6 +7,7 @@
#include "openssl/blowfish.h"
#include "sender.h"
#include "read_file.h"
+#include "cryptossl.h"
static irc_session_t *session;
irc_callbacks_t callbacks;
@@ -143,6 +144,12 @@ void send_position(irc_session_t * session, const char * event, const char * ori
unsigned char *crypted_lon_second = (char*) malloc(sizeof(char) * 9);
crypted_lon_second[0] = '\0';
+ unsigned char *crypted_lat_first_base64 = (char*) malloc(sizeof(char) * 50);
+ unsigned char *crypted_lat_second_base64 = (char*) malloc(sizeof(char) * 50);
+ unsigned char *crypted_lon_first_base64 = (char*) malloc(sizeof(char) * 50);
+ unsigned char *crypted_lon_second_base64 = (char*) malloc(sizeof(char) * 50);
+
+
if (first_send == 0)
{
@@ -179,14 +186,20 @@ void send_position(irc_session_t * session, const char * event, const char * ori
BF_ecb_encrypt(pos->lon_first, crypted_lon_first, &key, BF_ENCRYPT);
BF_ecb_encrypt(pos->lon_second, crypted_lon_second, &key, BF_ENCRYPT);
-
- irc_cmd_msg(session, "#test", crypted_lat_first);
+
+ to_base64(crypted_lat_first, strlen(crypted_lat_first), crypted_lat_first_base64, 50);
+ to_base64(crypted_lat_second, strlen(crypted_lat_second), crypted_lat_second_base64, 50);
+
+ to_base64(crypted_lon_first, strlen(crypted_lon_first), crypted_lon_first_base64, 50);
+ to_base64(crypted_lon_second, strlen(crypted_lon_second), crypted_lon_second_base64, 50);
+
+ irc_cmd_msg(session, "#test", crypted_lat_first_base64);
- irc_cmd_msg(session, "#test", crypted_lat_second);
+ irc_cmd_msg(session, "#test", crypted_lat_second_base64);
- irc_cmd_msg(session, "#test", crypted_lon_first);
+ irc_cmd_msg(session, "#test", crypted_lon_first_base64);
- irc_cmd_msg(session, "#test", crypted_lon_second);
+ irc_cmd_msg(session, "#test", crypted_lon_second_base64);
//increase counter variable, which counts number of send positions!
msg_count = msg_count + 2;