From: Dirk Wagner Date: Mon, 9 Jun 2014 10:20:21 +0000 (+0200) Subject: Added patch for https://issues.asterisk.org/jira/browse/ASTERISK-18345 X-Git-Tag: v2.17-core89~103 X-Git-Url: http://git.ipfire.org/?p=ipfire-2.x.git;a=commitdiff_plain;h=5e55b70d26799f9002c9e75e0786c867f485f322 Added patch for https://issues.asterisk.org/jira/browse/ASTERISK-18345 --- diff --git a/lfs/asterisk b/lfs/asterisk index 54c3d5df13..5743c18862 100755 --- a/lfs/asterisk +++ b/lfs/asterisk @@ -37,19 +37,19 @@ DEPS = "sqlite" ############################################################################### objects = $(DL_FILE) \ - srtp-1.4.2.tar.gz \ + libsrtp-1.4.5-99426a54.tar.gz \ asterisk-1.4-de-prompts.tar.gz \ asterisk-extra-sounds-en-gsm-1.4.14.tar.gz \ asterisk-moh-opsound-gsm-2.03.tar.gz $(DL_FILE) = $(DL_FROM)/$(DL_FILE) -srtp-1.4.2.tar.gz = $(URL_IPFIRE)/srtp-1.4.2.tar.gz +libsrtp-1.4.5-99426a54.tar.gz = $(URL_IPFIRE)/libsrtp-1.4.5-99426a54.tar.gz asterisk-extra-sounds-en-gsm-1.4.14.tar.gz = $(URL_IPFIRE)/asterisk-extra-sounds-en-gsm-1.4.14.tar.gz asterisk-moh-opsound-gsm-2.03.tar.gz = $(URL_IPFIRE)/asterisk-moh-opsound-gsm-2.03.tar.gz asterisk-1.4-de-prompts.tar.gz = $(URL_IPFIRE)/asterisk-1.4-de-prompts.tar.gz $(DL_FILE)_MD5 = 743e7dc0112e24f794453443b17ce42b -srtp-1.4.2.tar.gz_MD5 = 7b0ffbfad9bbaf33d397027e031cb35a +libsrtp-1.4.5-99426a54.tar.gz_MD5 = 05bfbe63a2a27343889c2436c836110a asterisk-extra-sounds-en-gsm-1.4.14.tar.gz_MD5 = ffc2e0ffd783c03fef5b75277dba0896 asterisk-moh-opsound-gsm-2.03.tar.gz_MD5 = 09066f55f1358f298bc1a6e4678a3ddf asterisk-1.4-de-prompts.tar.gz_MD5 = 626a2b95071a5505851e43874dfbfd5c @@ -86,15 +86,16 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @$(PREBUILD) # build srtp - @rm -rf $(DIR_SRC)/srtp && cd $(DIR_SRC) && tar zxf $(DIR_DL)/srtp-1.4.2.tar.gz - cd $(DIR_SRC)/srtp && ./configure --prefix=/usr && make uninstall && make && make install + @rm -rf $(DIR_SRC)/srtp && cd $(DIR_SRC) && tar zxf $(DIR_DL)/libsrtp-1.4.5-99426a54.tar.gz + cd $(DIR_SRC)/libsrtp-1.4.5 && ./configure --prefix=/usr && make uninstall && make && make install # remove old directories and extract asterisk @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE) # patch asterisk cd $(DIR_APP) && patch -p4 < $(DIR_SRC)/src/patches/asterisk-no-ffmpeg.patch - + cd $(DIR_APP) && patch -p1 < $(DIR_SRC)/src/patches/asterisk-ssl-reader-should-block.patch + # configure asterisk cd $(DIR_APP) && ./configure --prefix=/usr --sysconfdir=/var/ipfire \ --without-oss \ @@ -148,7 +149,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) ln -f -s /var/ipfire/asterisk/wakeup/wakeup.sh /etc/fcron.minutely/wakeup.sh # be sure all source is removed - @rm -rf $(DIR_APP) $(DIR_SRC)/asterisk-* + @rm -rf $(DIR_APP) $(DIR_SRC)/asterisk-* $(DIR_SRC)/libsrtp* # remember backup-location install -v -m 644 $(DIR_SRC)/config/backup/includes/asterisk /var/ipfire/backup/addons/includes/asterisk diff --git a/src/patches/asterisk-ssl-reader-should-block.patch b/src/patches/asterisk-ssl-reader-should-block.patch new file mode 100644 index 0000000000..3b2f0ed545 --- /dev/null +++ b/src/patches/asterisk-ssl-reader-should-block.patch @@ -0,0 +1,28 @@ +Upstream issue 18345 +Link: https://issues.asterisk.org/jira/browse/ASTERISK-18345 +Patch-By: Filip Jenicek + +Submitted upstream: 2012-05-31 09:12 +For Asterisk version: 1.8.4 + +The HOOK_T ssl_read function should behave the same way as the system read function +by blocking and waiting for (more) data from the SSL subsystem. Failure to do this +will drop data on the floor and ultimately disconnect SSL clients. + +--- asterisk/main/tcptls.c ++++ asterisk/main/tcptls.c +@@ -55,6 +55,14 @@ + static HOOK_T ssl_read(void *cookie, char *buf, LEN_T len) + { + int i = SSL_read(cookie, buf, len-1); ++ ++ /* ssl_read should block and wait for the SSL layer to provide all data */ ++ while (i < 0 && SSL_get_error(cookie, i) == SSL_ERROR_WANT_READ) { ++ ast_debug(1, "SSL_read - data not ready.\n"); ++ if (ast_wait_for_input(SSL_get_fd(cookie), 5000) <= 0) return 0; ++ i = SSL_read(cookie, buf, len-1); ++ } ++ + #if 0 + if (i >= 0) + buf[i] = '\0';