From 64c0476fbd0338da14ab3a8df3edf6109756ddf6 Mon Sep 17 00:00:00 2001 From: William Budington Date: Mon, 20 Nov 2017 18:55:51 -0800 Subject: [PATCH] Fixing some dev dependency requirements for Debian 9 as well as Fedora. Only prompt once at the beginning, with a warning. Fixes #13597 --- install-dev-dependencies.sh | 32 +++++++++++++++---- .../https_everywhere_checker/http_client.py | 7 +--- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/install-dev-dependencies.sh b/install-dev-dependencies.sh index 9ce7446491be..ca6e6a020111 100755 --- a/install-dev-dependencies.sh +++ b/install-dev-dependencies.sh @@ -1,13 +1,30 @@ -#!/bin/bash -ex +#!/bin/bash # Install packages that are necessary and/or useful to build and debug # HTTPS Everywhere -set -o errexit -o xtrace +set -o errexit + +if [ "$1" != "--no-prompt" ]; then + echo + echo "Warning: Installing the development dependencies for HTTPS Everywhere" + echo "may alter your system, installing requirements both within the package" + echo "management system and also external binaries." + echo + echo -n "Are you sure you want to continue? [Y/n]: " + read CONTINUE + CONTINUE=`echo $CONTINUE | xargs | head -c 1 | awk '{print tolower($0)}'` + if [ "$CONTINUE" != "y" ]; then + exit + fi + echo +fi if [ $UID != 0 ]; then SUDO_SHIM=sudo fi if type apt-get >/dev/null ; then + $SUDO_SHIM apt-get update + $SUDO_SHIM apt-get install -y lsb-release BROWSERS="firefox chromium-browser" CHROMEDRIVER="chromium-chromedriver" if [[ "$(lsb_release -is)" == "Debian" ]]; then @@ -18,7 +35,7 @@ if type apt-get >/dev/null ; then CHROMEDRIVER="chromedriver" fi # In Debian, `python-` is assumed to be python 2.7, no need to specify - dkg - $SUDO_SHIM apt-get install libxml2-dev libxml2-utils libxslt1-dev \ + $SUDO_SHIM apt-get install -y libxml2-dev libxml2-utils libxslt1-dev \ python-dev $BROWSERS zip sqlite3 python-pip libcurl4-openssl-dev xvfb \ libssl-dev git curl $CHROMEDRIVER if ! type geckodriver >/dev/null; then @@ -29,6 +46,9 @@ if type apt-get >/dev/null ; then $SUDO_SHIM chown root /usr/bin/geckodriver $SUDO_SHIM chmod 755 /usr/bin/geckodriver fi + if [ ! -f /usr/lib/chromium/chromedriver ] && [ -f `which chromedriver` ]; then + ln -s `which chromedriver` /usr/lib/chromium/chromedriver + fi elif type brew >/dev/null ; then brew list python &>/dev/null || brew install python brew install libxml2 gnu-sed chromedriver @@ -36,9 +56,9 @@ elif type brew >/dev/null ; then echo '/usr/local/bin not found in $PATH, please add it.' fi elif type dnf >/dev/null ; then - $SUDO_SHIM dnf install firefox gcc git libcurl-devel libxml2-devel \ + $SUDO_SHIM dnf install -y firefox gcc git libcurl-devel libxml2-devel \ libxslt-devel python-devel redhat-rpm-config xorg-x11-server-Xvfb which \ - findutils procps openssl chromium GConf2 + findutils procps openssl openssl-devel chromium GConf2 rsync if ! type chromedriver >/dev/null; then if [ "`uname -m`" == "x86_64" ]; then ARCH=64 @@ -65,7 +85,7 @@ elif type dnf >/dev/null ; then if [ ! -f /var/lib/dbus/machine-id ]; then $SUDO_SHIM sh -c 'dbus-uuidgen > /var/lib/dbus/machine-id' fi - export PYCURL_SSL_LIBRARY=nss + export PYCURL_SSL_LIBRARY=openssl fi # Get the addon SDK submodule and rule checker diff --git a/test/rules/src/https_everywhere_checker/http_client.py b/test/rules/src/https_everywhere_checker/http_client.py index 422ce749acbf..f65e6d70b020 100644 --- a/test/rules/src/https_everywhere_checker/http_client.py +++ b/test/rules/src/https_everywhere_checker/http_client.py @@ -45,13 +45,8 @@ def getCAPath(self, platform): class FetchOptions(object): """HTTP fetcher options like timeouts.""" - # NSS cipher list from https://github.com/EFForg/https-everywhere/issues/5628#issuecomment-236050924 - _DEFAULT_CIPHERLIST_NSS = "rsa_3des_sha,rsa_des_sha,rsa_null_md5,rsa_null_sha,rsa_rc2_40_md5,rsa_rc4_128_md5,rsa_rc4_128_sha,rsa_rc4_40_md5,fips_des_sha,fips_3des_sha,rsa_des_56_sha,rsa_rc4_56_sha,rsa_aes_128_sha,rsa_aes_256_sha,rsa_aes_128_gcm_sha_256,dhe_rsa_aes_128_gcm_sha_256,ecdh_ecdsa_null_sha,ecdh_ecdsa_rc4_128_sha,ecdh_ecdsa_3des_sha,ecdh_ecdsa_aes_128_sha,ecdh_ecdsa_aes_256_sha,ecdhe_ecdsa_null_sha,ecdhe_ecdsa_rc4_128_sha,ecdhe_ecdsa_3des_sha,ecdhe_ecdsa_aes_128_sha,ecdhe_ecdsa_aes_256_sha,ecdh_rsa_null_sha,ecdh_rsa_128_sha,ecdh_rsa_3des_sha,ecdh_rsa_aes_128_sha,ecdh_rsa_aes_256_sha,echde_rsa_null,ecdhe_rsa_rc4_128_sha,ecdhe_rsa_3des_sha,ecdhe_rsa_aes_128_sha,ecdhe_rsa_aes_256_sha,ecdhe_ecdsa_aes_128_gcm_sha_256,ecdhe_rsa_aes_128_gcm_sha_256" - # The default list of cipher suites that ships with Firefox 51.0.1 - _DEFAULT_CIPHERLIST_OTHER = "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA:AES128-SHA:AES256-SHA:DES-CBC3-SHA" - - _DEFAULT_CIPHERLIST = _DEFAULT_CIPHERLIST_NSS if re.search('NSS/\d+\.\d+', pycurl.version) else _DEFAULT_CIPHERLIST_OTHER + _DEFAULT_CIPHERLIST = "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA:AES128-SHA:AES256-SHA:DES-CBC3-SHA" def __init__(self, config): """Parse options from [http] section