projects
/
silc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
156b488
)
updates.
author
Pekka Riikonen
<priikone@silcnet.org>
Sat, 10 Nov 2001 19:40:47 +0000
(19:40 +0000)
committer
Pekka Riikonen
<priikone@silcnet.org>
Sat, 10 Nov 2001 19:40:47 +0000
(19:40 +0000)
CHANGES
patch
|
blob
|
history
TODO
patch
|
blob
|
history
apps/silcd/server.c
patch
|
blob
|
history
lib/silcclient/client.c
patch
|
blob
|
history
lib/silccore/silcpacket.c
patch
|
blob
|
history
lib/silccore/silcpacket.h
patch
|
blob
|
history
diff --git
a/CHANGES
b/CHANGES
index f9a63bd706e8a3eaa8190131096fe16292ab6502..f65dc8c9e78ccb36208910c7565f4cb6d20ef299 100644
(file)
--- a/
CHANGES
+++ b/
CHANGES
@@
-1,3
+1,10
@@
+Sat Nov 10 21:39:22 EET 2001 Pekka Riikonen <priikone@silcnet.org>
+
+ * If the incoming packet type is REKEY or REKEY_DONE process
+ that packet always synchronously. Fixes yet another MAC
+ failed error on slow (dialup) connections. Affected file
+ lib/silcclient/client.c and silcd/server.c.
+
Thu Nov 8 22:21:09 EET 2001 Pekka Riikonen <priikone@silcnet.org>
* Call check_version SKE callback for initiator too. Affected
Thu Nov 8 22:21:09 EET 2001 Pekka Riikonen <priikone@silcnet.org>
* Call check_version SKE callback for initiator too. Affected
diff --git
a/TODO
b/TODO
index 035446912190002358445d97af4d7081421380fe..15baff8534b2ec58e9ac57ba044da2f6af1e59b4 100644
(file)
--- a/
TODO
+++ b/
TODO
@@
-42,6
+42,10
@@
TODO/bugs In SILC Client Library
o WHOIS shows the formatted nickname wrong in some circumstances.
o WHOIS shows the formatted nickname wrong in some circumstances.
+ o Set incrorrect key and /MSG him, screen gets screwed.
+
+ o Crashes if lots of concurrent /PING's.
+
o JOIN command's argument handling is buggy. See the XXX in the code.
o JOIN command's argument handling is buggy. See the XXX in the code.
diff --git
a/apps/silcd/server.c
b/apps/silcd/server.c
index bfee9c32e593b76d31cab167d2683a20be55db53..3a227c50cd058ecd0871ccc805a4037836cf1962 100644
(file)
--- a/
apps/silcd/server.c
+++ b/
apps/silcd/server.c
@@
-1666,9
+1666,11
@@
bool silc_server_packet_parse(SilcPacketParserContext *parser_context,
process all packets synchronously, since there might be packets in
queue that we are not able to decrypt without first processing the
packets before them. */
process all packets synchronously, since there might be packets in
queue that we are not able to decrypt without first processing the
packets before them. */
- if (sock->protocol && sock->protocol->protocol &&
- (sock->protocol->protocol->type == SILC_PROTOCOL_SERVER_KEY_EXCHANGE ||
- sock->protocol->protocol->type == SILC_PROTOCOL_SERVER_REKEY)) {
+ if ((parser_context->packet->type == SILC_PACKET_REKEY ||
+ parser_context->packet->type == SILC_PACKET_REKEY_DONE) ||
+ (sock->protocol && sock->protocol->protocol &&
+ (sock->protocol->protocol->type == SILC_PROTOCOL_SERVER_KEY_EXCHANGE ||
+ sock->protocol->protocol->type == SILC_PROTOCOL_SERVER_REKEY))) {
silc_server_packet_parse_real(server->schedule, 0, sock->sock,
parser_context);
silc_server_packet_parse_real(server->schedule, 0, sock->sock,
parser_context);
@@
-3377,7
+3379,7
@@
void silc_server_announce_get_channels(SilcServer server,
(*channel_ids)[i] = NULL;
silc_server_announce_get_channel_users(server, channel,
channel_users,
(*channel_ids)[i] = NULL;
silc_server_announce_get_channel_users(server, channel,
channel_users,
-
channel_users_modes
[i]);
+
&(*channel_users_modes)
[i]);
(*channel_ids)[i] = channel->id;
i++;
(*channel_ids)[i] = channel->id;
i++;
diff --git
a/lib/silcclient/client.c
b/lib/silcclient/client.c
index 7ff149fd4a684fe6503c49a75d2aa1b2a9856211..687341ec03be261d633390be0c0b60943397176e 100644
(file)
--- a/
lib/silcclient/client.c
+++ b/
lib/silcclient/client.c
@@
-778,7
+778,7
@@
static bool silc_client_packet_parse(SilcPacketParserContext *parser_context,
SilcPacketContext *packet = parser_context->packet;
SilcPacketType ret;
SilcPacketContext *packet = parser_context->packet;
SilcPacketType ret;
- if (conn && conn->hmac_receive)
+ if (conn && conn->hmac_receive
&& conn->sock == sock
)
conn->psn_receive = parser_context->packet->sequence + 1;
/* Parse the packet immediately */
conn->psn_receive = parser_context->packet->sequence + 1;
/* Parse the packet immediately */
@@
-797,9
+797,10
@@
static bool silc_client_packet_parse(SilcPacketParserContext *parser_context,
process all packets synchronously, since there might be packets in
queue that we are not able to decrypt without first processing the
packets before them. */
process all packets synchronously, since there might be packets in
queue that we are not able to decrypt without first processing the
packets before them. */
- if (sock->protocol && sock->protocol->protocol &&
- (sock->protocol->protocol->type == SILC_PROTOCOL_CLIENT_KEY_EXCHANGE ||
- sock->protocol->protocol->type == SILC_PROTOCOL_CLIENT_REKEY)) {
+ if ((ret == SILC_PACKET_REKEY || ret == SILC_PACKET_REKEY_DONE) ||
+ (sock->protocol && sock->protocol->protocol &&
+ (sock->protocol->protocol->type == SILC_PROTOCOL_CLIENT_KEY_EXCHANGE ||
+ sock->protocol->protocol->type == SILC_PROTOCOL_CLIENT_REKEY))) {
/* Parse the incoming packet type */
silc_client_packet_parse_type(client, sock, packet);
/* Parse the incoming packet type */
silc_client_packet_parse_type(client, sock, packet);
diff --git
a/lib/silccore/silcpacket.c
b/lib/silccore/silcpacket.c
index 0791a70f590832ed7828b130dfac1457ff035e57..044c19652ae5fcada8f05884b2386b096101245c 100644
(file)
--- a/
lib/silccore/silcpacket.c
+++ b/
lib/silccore/silcpacket.c
@@
-332,7
+332,6
@@
void silc_packet_receive_process(SilcSocketConnection sock,
{
SilcPacketParserContext *parse_ctx;
int packetlen, paddedlen, mac_len = 0;
{
SilcPacketParserContext *parse_ctx;
int packetlen, paddedlen, mac_len = 0;
- int block_len = cipher ? silc_cipher_get_block_len(cipher) : 0;
bool cont = TRUE;
/* Do not process for disconnected connection */
bool cont = TRUE;
/* Do not process for disconnected connection */
@@
-379,6
+378,7
@@
void silc_packet_receive_process(SilcSocketConnection sock,
parse_ctx = silc_calloc(1, sizeof(*parse_ctx));
parse_ctx->packet = silc_packet_context_alloc();
parse_ctx->packet->buffer = silc_buffer_alloc(paddedlen + mac_len);
parse_ctx = silc_calloc(1, sizeof(*parse_ctx));
parse_ctx->packet = silc_packet_context_alloc();
parse_ctx->packet->buffer = silc_buffer_alloc(paddedlen + mac_len);
+ parse_ctx->packet->type = sock->inbuf->data[3];
parse_ctx->packet->padlen = sock->inbuf->data[4];
parse_ctx->packet->sequence = sequence++;
parse_ctx->sock = sock;
parse_ctx->packet->padlen = sock->inbuf->data[4];
parse_ctx->packet->sequence = sequence++;
parse_ctx->sock = sock;
@@
-390,7
+390,8
@@
void silc_packet_receive_process(SilcSocketConnection sock,
paddedlen + mac_len);
SILC_LOG_HEXDUMP(("Incoming packet (%d) (%dB decrypted), len %d",
paddedlen + mac_len);
SILC_LOG_HEXDUMP(("Incoming packet (%d) (%dB decrypted), len %d",
- sequence - 1, block_len, paddedlen + mac_len),
+ sequence - 1, SILC_PACKET_MIN_HEADER_LEN,
+ paddedlen + mac_len),
sock->inbuf->data, paddedlen + mac_len);
/* Check whether this is normal or special packet */
sock->inbuf->data, paddedlen + mac_len);
/* Check whether this is normal or special packet */
diff --git
a/lib/silccore/silcpacket.h
b/lib/silccore/silcpacket.h
index 54e5453c0a6805670c397896e4687a45f40c09e2..3bfd897fe36a389fdea2ebf39fd9af491c2c5404 100644
(file)
--- a/
lib/silccore/silcpacket.h
+++ b/
lib/silccore/silcpacket.h
@@
-174,21
+174,21
@@
typedef unsigned char SilcPacketFlags;
* Packet flags. Flags are defined above.
*
* unsigned char *src_id
* Packet flags. Flags are defined above.
*
* unsigned char *src_id
- * uint
16
src_id_len
+ * uint
8
src_id_len
* unsigned char src_id_type
*
* Source ID, its length and type. On packet reception retuned ID's
* are always the hash values of the ID's from the packet.
*
* unsigned char *dst_id;
* unsigned char src_id_type
*
* Source ID, its length and type. On packet reception retuned ID's
* are always the hash values of the ID's from the packet.
*
* unsigned char *dst_id;
- * uint
16
dst_id_len;
+ * uint
8
dst_id_len;
* unsigned char src_id_type;
*
* Destination ID, its length and type. On packet reception retuned
* ID's are always the hash values of the ID's from the packet.
*
* uint16 truelen
* unsigned char src_id_type;
*
* Destination ID, its length and type. On packet reception retuned
* ID's are always the hash values of the ID's from the packet.
*
* uint16 truelen
- * uint
16
padlen
+ * uint
8
padlen
*
* The true lenght of the packet and the padded length of the packet.
* These may be set by the caller before calling any of the
*
* The true lenght of the packet and the padded length of the packet.
* These may be set by the caller before calling any of the