From: mid Date: Wed, 25 Apr 2001 00:42:30 +0000 (+0000) Subject: - Tue Apr 24 17:36:03 PDT 2001 X-Git-Tag: rel_0_99_2~48 X-Git-Url: http://andersk.mit.edu/gitweb/libfaim.git/commitdiff_plain/d2698e035898b59fdff9e49da05904152cdedd03 - Tue Apr 24 17:36:03 PDT 2001 - Let Eric generate the hash if he wants. --- diff --git a/CHANGES b/CHANGES index 5488d4b..2632563 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ No release numbers ------------------ + - Tue Apr 24 17:36:03 PDT 2001 + - Let Eric generate the hash if he wants. + - Mon Apr 23 15:58:11 PDT 2001 - On a clear day, you can see forever. diff --git a/include/aim.h b/include/aim.h index 885dce6..5fd09ed 100644 --- a/include/aim.h +++ b/include/aim.h @@ -659,7 +659,11 @@ faim_export int aim_oft_getfile_end(struct aim_session_t *sess, struct aim_conn_ #define AIM_CAPS_SAVESTOCKS 0x80 faim_export int aim_0002_000b(struct aim_session_t *sess, struct aim_conn_t *conn, const char *sn); -faim_export int aim_sendmemblock(struct aim_session_t *sess, struct aim_conn_t *conn, unsigned long offset, unsigned long len, const unsigned char *buf); + +#define AIM_SENDMEMBLOCK_FLAG_ISREQUEST 0 +#define AIM_SENDMEMBLOCK_FLAG_ISHASH 1 + +faim_export int aim_sendmemblock(struct aim_session_t *sess, struct aim_conn_t *conn, unsigned long offset, unsigned long len, const unsigned char *buf, unsigned char flag); #define AIM_GETINFO_GENERALINFO 0x00001 #define AIM_GETINFO_AWAYMESSAGE 0x00003 diff --git a/src/login.c b/src/login.c index 7b36b97..e7c1f66 100644 --- a/src/login.c +++ b/src/login.c @@ -763,7 +763,7 @@ static void dumpbox(struct aim_session_t *sess, unsigned char *buf, int len) return; } -faim_export int aim_sendmemblock(struct aim_session_t *sess, struct aim_conn_t *conn, unsigned long offset, unsigned long len, const unsigned char *buf) +faim_export int aim_sendmemblock(struct aim_session_t *sess, struct aim_conn_t *conn, unsigned long offset, unsigned long len, const unsigned char *buf, unsigned char flag) { struct command_tx_struct *tx; int i = 0; @@ -779,7 +779,13 @@ faim_export int aim_sendmemblock(struct aim_session_t *sess, struct aim_conn_t * i = aim_putsnac(tx->data, 0x0001, 0x0020, 0x0000, sess->snac_nextid++); i += aimutil_put16(tx->data+i, 0x0010); /* md5 is always 16 bytes */ - if (buf && (len > 0)) { /* use input buffer */ + if ((flag == AIM_SENDMEMBLOCK_FLAG_ISHASH) && + buf && (len == 0x10)) { /* we're getting a hash */ + + memcpy(tx->data+i, buf, 0x10); + i += 0x10; + + } else if (buf && (len > 0)) { /* use input buffer */ md5_state_t state; md5_init(&state); diff --git a/utils/faimtest/faimtest.c b/utils/faimtest/faimtest.c index b5d9076..f01d265 100644 --- a/utils/faimtest/faimtest.c +++ b/utils/faimtest/faimtest.c @@ -881,13 +881,13 @@ static int faimtest_memrequest(struct aim_session_t *sess, struct command_rx_str if (aimbinarypath && (getaimdata(buf, len, offset, modname) == len)) { - aim_sendmemblock(sess, command->conn, offset, len, buf); + aim_sendmemblock(sess, command->conn, offset, len, buf, AIM_SENDMEMBLOCK_FLAG_ISREQUEST); } else { dvprintf("memrequest: unable to use AIM binary (\"%s/%s\"), sending defaults...\n", aimbinarypath, modname); - aim_sendmemblock(sess, command->conn, offset, len, NULL); + aim_sendmemblock(sess, command->conn, offset, len, NULL, AIM_SENDMEMBLOCK_FLAG_ISREQUEST); }