kumquat-buildroot/package/asterisk/asterisk.mk
Peter Korsgaard 3f1d2c6c74 asterisk: security bump to version 14.6.2
Fixes the following security issues:

14.6.1:

* AST-2017-005 (applied to all released versions): The "strictrtp" option in
  rtp.conf enables a feature of the RTP stack that learns the source address
  of media for a session and drops any packets that do not originate from
  the expected address.  This option is enabled by default in Asterisk 11
  and above.  The "nat" and "rtp_symmetric" options for chan_sip and
  chan_pjsip respectively enable symmetric RTP support in the RTP stack.
  This uses the source address of incoming media as the target address of
  any sent media.  This option is not enabled by default but is commonly
  enabled to handle devices behind NAT.

  A change was made to the strict RTP support in the RTP stack to better
  tolerate late media when a reinvite occurs.  When combined with the
  symmetric RTP support this introduced an avenue where media could be
  hijacked.  Instead of only learning a new address when expected the new
  code allowed a new source address to be learned at all times.

  If a flood of RTP traffic was received the strict RTPsupport would allow
  the new address to provide media and with symmetric RTP enabled outgoing
  traffic would be sent to this new address, allowing the media to be
  hijacked.  Provided the attacker continued to send traffic they would
  continue to receive traffic as well.

* AST-2017-006 (applied to all released versions): The app_minivm module has
  an “externnotify” program configuration option that is executed by the
  MinivmNotify dialplan application.  The application uses the caller-id
  name and number as part of a built string passed to the OS shell for
  interpretation and execution.  Since the caller-id name and number can
  come from an untrusted source, a crafted caller-id name or number allows
  an arbitrary shell command injection.

* AST-2017-007 (applied only to 13.17.1 and 14.6.1): A carefully crafted URI
  in a From, To or Contact header could cause Asterisk to crash

For more details, see the announcement:
https://www.asterisk.org/downloads/asterisk-news/asterisk-11252-13171-1461-116-cert17-1313-cert5-now-available-security

14.6.2:

* AST-2017-008: Insufficient RTCP packet validation could allow reading
  stale buffer contents and when combined with the “nat” and “symmetric_rtp”
  options allow redirecting where Asterisk sends the next RTCP report.

  The RTP stream qualification to learn the source address of media always
  accepted the first RTP packet as the new source and allowed what
  AST-2017-005 was mitigating.  The intent was to qualify a series of
  packets before accepting the new source address.

For more details, see the announcement:
https://www.asterisk.org/downloads/asterisk-news/asterisk-11253-13172-1462-116-cert18-1313-cert6-now-available-security

Drop 0004-configure-in-cross-complation-assimne-eventfd-are-av.patch as this
is now handled differently upstream (by disabling eventfd for cross
compilation, see commit 2e927990b3d2 (eventfd: Disable during cross
compilation)).  If eventfd support is needed then this should be submitted
upstream.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2018-01-07 23:47:44 +01:00

317 lines
8.0 KiB
Makefile

################################################################################
#
# asterisk
#
################################################################################
ASTERISK_VERSION = 14.6.2
# Use the github mirror: it's an official mirror maintained by Digium, and
# provides tarballs, which the main Asterisk git tree (behind Gerrit) does not.
ASTERISK_SITE = $(call github,asterisk,asterisk,$(ASTERISK_VERSION))
ASTERISK_SOUNDS_BASE_URL = http://downloads.asterisk.org/pub/telephony/sounds/releases
ASTERISK_EXTRA_DOWNLOADS = \
$(ASTERISK_SOUNDS_BASE_URL)/asterisk-core-sounds-en-gsm-1.5.tar.gz \
$(ASTERISK_SOUNDS_BASE_URL)/asterisk-moh-opsound-wav-2.03.tar.gz
ASTERISK_LICENSE = GPL-2.0, BSD-3c (SHA1, resample), BSD-4c (db1-ast)
ASTERISK_LICENSE_FILES = \
COPYING \
main/sha1.c \
codecs/speex/speex_resampler.h \
utils/db1-ast/include/db.h
# For patches 0001, 0003 and 0004
ASTERISK_AUTORECONF = YES
ASTERISK_AUTORECONF_OPTS = -Iautoconf -Ithird-party -Ithird-party/pjproject
ASTERISK_DEPENDENCIES = \
host-asterisk \
jansson \
libcurl \
libxml2 \
ncurses \
sqlite \
util-linux
# Asterisk wants to run its menuselect tool (a highly tweaked derivative of
# kconfig), but builds it using the target tools. So we build it in the host
# variant (see below), and copy the full build tree of menuselect.
define ASTERISK_COPY_MENUSELECT
rm -rf $(@D)/menuselect
cp -a $(HOST_ASTERISK_DIR)/menuselect $(@D)/menuselect
endef
ASTERISK_PRE_CONFIGURE_HOOKS += ASTERISK_COPY_MENUSELECT
ASTERISK_CONF_OPTS = \
--disable-xmldoc \
--disable-internal-poll \
--disable-asteriskssl \
--disable-rpath \
--without-bfd \
--without-cap \
--without-cpg \
--without-curses \
--without-gtk2 \
--without-gmime \
--without-h323 \
--without-hoard \
--without-iconv \
--without-iksemel \
--without-imap \
--without-inotify \
--without-iodbc \
--without-isdnnet \
--without-jack \
--without-uriparser \
--without-kqueue \
--without-libedit \
--without-libxslt \
--without-ltdl \
--without-lua \
--without-misdn \
--without-mysqlclient \
--without-nbs \
--without-neon29 \
--without-newt \
--without-openr2 \
--without-osptk \
--without-oss \
--without-postgres \
--without-pjproject \
--without-popt \
--without-pwlib \
--without-resample \
--without-sdl \
--without-SDL_image \
--without-spandsp \
--without-sqlite \
--without-suppserv \
--without-tds \
--without-termcap \
--without-timerfd \
--without-tinfo \
--without-unbound \
--without-unixodbc \
--without-vpb \
--without-x11 \
--with-crypt \
--with-jansson \
--with-libcurl \
--with-ilbc \
--with-libxml2 \
--with-ncurses="$(STAGING_DIR)/usr" \
--with-sqlite3="$(STAGING_DIR)/usr" \
--with-sounds-cache=$(BR2_DL_DIR)
# avcodec are from ffmpeg. There is virtually zero chance this could
# even work; asterisk is looking for ffmpeg/avcodec.h which has not
# been installed in this location since early 2007 (~10 years ago at
# the time of this writing).
ASTERISK_CONF_OPTS += --without-avcodec
ASTERISK_CONF_ENV = \
ac_cv_path_CONFIG_LIBXML2=$(STAGING_DIR)/usr/bin/xml2-config
ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y)
ASTERISK_CONF_OPTS += --with-execinfo
else
ASTERISK_CONF_OPTS += --without-execinfo
endif
ifeq ($(BR2_PACKAGE_LIBGSM),y)
ASTERISK_DEPENDENCIES += libgsm
ASTERISK_CONF_OPTS += --with-gsm
else
ASTERISK_CONF_OPTS += --without-gsm
endif
ifeq ($(BR2_PACKAGE_ALSA_LIB),y)
ASTERISK_DEPENDENCIES += alsa-lib
ASTERISK_CONF_OPTS += --with-asound
else
ASTERISK_CONF_OPTS += --without-asound
endif
ifeq ($(BR2_PACKAGE_BLUEZ_UTILS),y)
ASTERISK_DEPENDENCIES += bluez_utils
ASTERISK_CONF_OPTS += --with-bluetooth
else
ASTERISK_CONF_OPTS += --without-bluetooth
endif
ifeq ($(BR2_PACKAGE_LIBICAL),y)
ASTERISK_DEPENDENCIES += libical
ASTERISK_CONF_OPTS += --with-ical
else
ASTERISK_CONF_OPTS += --without-ical
endif
ifeq ($(BR2_PACKAGE_OPENLDAP),y)
ASTERISK_DEPENDENCIES += openldap
ASTERISK_CONF_OPTS += --with-ldap
else
ASTERISK_CONF_OPTS += --without-ldap
endif
ifeq ($(BR2_PACKAGE_NEON),y)
ASTERISK_DEPENDENCIES += neon
ASTERISK_CONF_OPTS += --with-neon
ASTERISK_CONF_ENV += \
ac_cv_path_CONFIG_NEON=$(STAGING_DIR)/usr/bin/neon-config
else
ASTERISK_CONF_OPTS += --without-neon
endif
ifeq ($(BR2_PACKAGE_NETSNMP),y)
ASTERISK_DEPENDENCIES += netsnmp
ASTERISK_CONF_OPTS += --with-netsnmp=$(STAGING_DIR)/usr
else
ASTERISK_CONF_OPTS += --without-netsnmp
endif
ifeq ($(BR2_PACKAGE_LIBOGG),y)
ASTERISK_DEPENDENCIES += libogg
ASTERISK_CONF_OPTS += --with-ogg
else
ASTERISK_CONF_OPTS += --without-ogg
endif
ifeq ($(BR2_PACKAGE_OPUS),y)
ASTERISK_DEPENDENCIES += opus
ASTERISK_CONF_OPTS += --with-opus
else
ASTERISK_CONF_OPTS += --without-opus
endif
ifeq ($(BR2_PACKAGE_PORTAUDIO),y)
ASTERISK_DEPENDENCIES += portaudio
ASTERISK_CONF_OPTS += --with-portaudio
else
ASTERISK_CONF_OPTS += --without-portaudio
endif
ifeq ($(BR2_PACKAGE_FREERADIUS_CLIENT),y)
ASTERISK_DEPENDENCIES += freeradius-client
ASTERISK_CONF_OPTS += --with-radius
else
ASTERISK_CONF_OPTS += --without-radius
endif
ifeq ($(BR2_PACKAGE_DAHDI_LINUX)$(BR2_PACKAGE_DAHDI_TOOLS),yy)
ASTERISK_DEPENDENCIES += dahdi-linux dahdi-tools
ASTERISK_CONF_OPTS += --with-dahdi --with-tonezone
ifeq ($(BR2_PACKAGE_LIBPRI),y)
ASTERISK_DEPENDENCIES += libpri
ASTERISK_CONF_OPTS += --with-pri
else
ASTERISK_CONF_OPTS += --without-pri
endif # PRI
ifeq ($(BR2_PACKAGE_LIBSS7),y)
ASTERISK_DEPENDENCIES += libss7
ASTERISK_CONF_OPTS += --with-ss7
else
ASTERISK_CONF_OPTS += --without-ss7
endif # SS7
else
ASTERISK_CONF_OPTS += \
--without-dahdi --without-tonezone \
--without-pri --without-ss7
endif # DAHDI
ifeq ($(BR2_PACKAGE_OPENSSL),y)
ASTERISK_DEPENDENCIES += openssl
ASTERISK_CONF_OPTS += --with-ssl
else
ASTERISK_CONF_OPTS += --without-ssl
endif
ifeq ($(BR2_PACKAGE_SPEEX),y)
ASTERISK_DEPENDENCIES += speex
ASTERISK_CONF_OPTS += --with-speex --with-speexdsp
else
ASTERISK_CONF_OPTS += --without-speex --without-speexdsp
endif
ifeq ($(BR2_PACKAGE_LIBSRTP),y)
ASTERISK_DEPENDENCIES += libsrtp
ASTERISK_CONF_OPTS += --with-srtp
else
ASTERISK_CONF_OPTS += --without-srtp
endif
ifeq ($(BR2_PACKAGE_LIBVORBIS),y)
ASTERISK_DEPENDENCIES += libvorbis
ASTERISK_CONF_OPTS += --with-vorbis
else
ASTERISK_CONF_OPTS += --without-vorbis
endif
ifeq ($(BR2_PACKAGE_ZLIB),y)
ASTERISK_DEPENDENCIES += zlib
ASTERISK_CONF_OPTS += --with-z
else
ASTERISK_CONF_OPTS += --without-z
endif
ASTERISK_DIRS = \
ASTVARLIBDIR="/usr/lib/asterisk" \
ASTDATADIR="/usr/lib/asterisk" \
ASTKEYDIR="/usr/lib/asterisk" \
ASTDBDIR="/usr/lib/asterisk"
ASTERISK_MAKE_OPTS = $(ASTERISK_DIRS)
# We want to install sample configuration files, too.
ASTERISK_INSTALL_TARGET_OPTS = \
$(ASTERISK_DIRS) \
DESTDIR=$(TARGET_DIR) \
LDCONFIG=true \
install samples
$(eval $(autotools-package))
#-------------------------------------------------------------------------------
# This part deals with building the menuselect tool as a host package
HOST_ASTERISK_DEPENDENCIES = host-pkgconf host-libxml2 host-ncurses
HOST_ASTERISK_SUBDIR = menuselect
HOST_ASTERISK_LICENSE = GPL-2.0
HOST_ASTERISK_LICENSE_FILES = COPYING
# No need to autoreconf for the host variant,
# so do not inherit the target setup.
HOST_ASTERISK_AUTORECONF = NO
HOST_ASTERISK_CONF_ENV = CONFIG_LIBXML2=$(HOST_DIR)/usr/bin/xml2-config
HOST_ASTERISK_CONF_OPTS = \
--without-newt \
--without-curses \
--with-ncurses=$(HOST_DIR)/usr
# Not an automake package, so does not inherit LDFLAGS et al. from
# the configure run.
HOST_ASTERISK_MAKE_ENV = $(HOST_CONFIGURE_OPTS)
# Even though menuselect is an autotools package, it is not an automake
# package and does not have an 'install' rule, as asterisk does expect
# it to be in a sub-directory of its source tree. We do so by copying
# the full menuselect build tree as a pre-configure hook in the target
# variant.
# However, the sanity checks on host packages are not run on menuselect.
# But we still want to catch that menuselect has the proper rpath set,
# for example, as it uses host libraries that we do build, like
# host-libxml2.
# So we do manually install the menuselect tool.
define HOST_ASTERISK_INSTALL_CMDS
$(INSTALL) -D -m 0755 $(@D)/menuselect/menuselect \
$(HOST_DIR)/bin/asterisk-menuselect
endef
$(eval $(host-autotools-package))