Roll in some fixes from upstream. From Brad.

- Packet engine: prevent divide by 0.
- SKE: Make sure failure received from remote is error status.
This commit is contained in:
sthen 2010-05-17 08:36:53 +00:00
parent 23ad3c22f7
commit 1a19f9bc82
3 changed files with 29 additions and 2 deletions

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.27 2009/10/12 17:29:34 sthen Exp $
# $OpenBSD: Makefile,v 1.28 2010/05/17 08:36:53 sthen Exp $
COMMENT= toolkit for the development of SILC applications
DISTNAME= silc-toolkit-1.1.10
PKGNAME= ${DISTNAME}p0
PKGNAME= ${DISTNAME}p1
CATEGORIES= devel
MASTER_SITES= http://www.silcnet.org/download/toolkit/sources/

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-lib_silccore_silcpacket_c,v 1.1 2010/05/17 08:36:53 sthen Exp $
--- lib/silccore/silcpacket.c.orig Sun May 16 20:15:15 2010
+++ lib/silccore/silcpacket.c Sun May 16 20:16:43 2010
@@ -2231,8 +2231,9 @@ static void silc_packet_read_process(SilcPacketStream
/* Padding sanity checks */
if (cipher && silc_cipher_get_mode(cipher) != SILC_CIPHER_MODE_CTR &&
- ((normal && paddedlen % block_len != 0) ||
- (!normal && silc_packet_special_len(header) % block_len != 0))) {
+ ((normal && block_len && paddedlen % block_len != 0) ||
+ (!normal && block_len &&
+ silc_packet_special_len(header) % block_len != 0))) {
SILC_LOG_DEBUG(("Packet length %d not multiple by cipher block length",
paddedlen));
silc_mutex_unlock(stream->lock);

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-lib_silcske_silcske_c,v 1.1 2010/05/17 08:36:53 sthen Exp $
--- lib/silcske/silcske.c.orig Sun May 16 20:13:58 2010
+++ lib/silcske/silcske.c Sun May 16 20:14:36 2010
@@ -2387,6 +2387,8 @@ SILC_FSM_STATE(silc_ske_st_responder_failure)
ske->packet = NULL;
}
ske->status = error;
+ if (ske->status == SILC_SKE_STATUS_OK)
+ ske->status = SILC_SKE_STATUS_ERROR;
silc_packet_stream_unlink(ske->stream, &silc_ske_stream_cbs, ske);
silc_schedule_task_del_by_context(ske->schedule, ske);