From owner-svn-ports-head@FreeBSD.ORG Sun Mar 22 01:24:48 2015 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 77C175DA; Sun, 22 Mar 2015 01:24:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5987C689; Sun, 22 Mar 2015 01:24:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2M1Omnf061062; Sun, 22 Mar 2015 01:24:48 GMT (envelope-from gerald@FreeBSD.org) Received: (from gerald@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2M1Ol1V061059; Sun, 22 Mar 2015 01:24:47 GMT (envelope-from gerald@FreeBSD.org) Message-Id: <201503220124.t2M1Ol1V061059@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gerald set sender to gerald@FreeBSD.org using -f From: Gerald Pfeifer Date: Sun, 22 Mar 2015 01:24:47 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r381884 - head/security/obfsclient/files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2015 01:24:48 -0000 Author: gerald Date: Sun Mar 22 01:24:46 2015 New Revision: 381884 URL: https://svnweb.freebsd.org/changeset/ports/381884 QAT: https://qat.redports.org/buildarchive/r381884/ Log: Improve portability and allow for building with GCC 4.9 and above. This backports some upstream fixes. PR: 197909 Submitted by: Fabian Keil (maintainer) Added: head/security/obfsclient/files/ head/security/obfsclient/files/patch-crypto-ctr.h (contents, props changed) head/security/obfsclient/files/patch-ext-optionparser.h (contents, props changed) head/security/obfsclient/files/patch-scramblesuit-client.cc (contents, props changed) Added: head/security/obfsclient/files/patch-crypto-ctr.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/security/obfsclient/files/patch-crypto-ctr.h Sun Mar 22 01:24:46 2015 (r381884) @@ -0,0 +1,42 @@ +From c91f7bbf3e0eedb080319ba3cfed7b47597b5aeb Mon Sep 17 00:00:00 2001 +From: Yawning Angel +Date: Sun, 20 Apr 2014 16:52:06 +0000 +Subject: Fix a potential bug found by clang's scan-build. + +With all current uses of Ctr, the conditional I was missing is never +triggered since the paramenters are guaranteed to be sane, but this is +not guaranteed to be true in the future. + +scan-build also points out a bunch of things in easylogging++ and gtest +but they don't look to be real problems. +--- + ChangeLog | 2 ++ [diff removed] + src/schwanenlied/crypto/ctr.h | 5 ++++- + 2 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/src/schwanenlied/crypto/ctr.h b/src/schwanenlied/crypto/ctr.h +index 79bb71b..92d932d 100644 +--- src/schwanenlied/crypto/ctr.h ++++ src/schwanenlied/crypto/ctr.h +@@ -91,6 +91,8 @@ class Ctr { + return false; + if (ctr_len == 0) + return false; ++ if ((iv == nullptr && iv_len != 0) || (iv != nullptr && iv_len == 0)) ++ return false; + if (ctr_len + iv_len != ecb_impl_.block_length()) + return false; + +@@ -100,7 +102,8 @@ class Ctr { + return false; + + iv_size_ = iv_len; +- ::std::memcpy(&ctr_[0], iv, iv_len); ++ if (iv != nullptr) ++ ::std::memcpy(&ctr_[0], iv, iv_len); + ::std::memcpy(&ctr_[iv_len], ctr, ctr_len); + + has_state_ = true; +-- +2.3.0 + Added: head/security/obfsclient/files/patch-ext-optionparser.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/security/obfsclient/files/patch-ext-optionparser.h Sun Mar 22 01:24:46 2015 (r381884) @@ -0,0 +1,31 @@ +From 85dd63b32a0b77c57cbae224f7862a5fb9c069a8 Mon Sep 17 00:00:00 2001 +From: Yawning Angel +Date: Sat, 14 Jun 2014 22:42:35 +0000 +Subject: Fix build on GCC 4.9.0. + +Just potentially uninitialized warnings in the 3rd party command line +option parsing code, probably spurious and should be ignored but, +initialize them for now. +--- + src/ext/optionparser.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/ext/optionparser.h b/src/ext/optionparser.h +index 17bf6ad..64e2dfc 100644 +--- src/ext/optionparser.h ++++ src/ext/optionparser.h +@@ -1554,9 +1554,9 @@ inline bool Parser::workhorse(bool gnu, const Descriptor usage[], int numargs, c + + do // loop over short options in group, for long options the body is executed only once + { +- int idx; ++ int idx = 0; + +- const char* optarg; ++ const char* optarg = 0; + + /******************** long option **********************/ + if (handle_short_options == false || try_single_minus_longopt) +-- +2.3.0 + Added: head/security/obfsclient/files/patch-scramblesuit-client.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/security/obfsclient/files/patch-scramblesuit-client.cc Sun Mar 22 01:24:46 2015 (r381884) @@ -0,0 +1,30 @@ +From 9c164b2afb666d0bcd26ba3eeb6da07a9fff551c Mon Sep 17 00:00:00 2001 +From: Yawning Angel +Date: Sat, 14 Jun 2014 23:09:08 +0000 +Subject: Suppress more useless warnings. + +Apparently I forgot to check the IAT code when I switched to building +wiht -Wextra, since no one should use it. +--- + src/schwanenlied/pt/scramblesuit/client.cc | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/schwanenlied/pt/scramblesuit/client.cc b/src/schwanenlied/pt/scramblesuit/client.cc +index e967b7b..c6e1a20 100644 +--- src/schwanenlied/pt/scramblesuit/client.cc ++++ src/schwanenlied/pt/scramblesuit/client.cc +@@ -468,8 +468,10 @@ bool Client::schedule_iat_transmit() { + // Lazy timer initialization + if (iat_timer_ev_ == nullptr) { + event_callback_fn cb = [](evutil_socket_t sock, +- short witch, ++ short which, + void* arg) { ++ (void)sock; ++ (void)which; + reinterpret_cast(arg)->on_iat_transmit(); + }; + iat_timer_ev_ = evtimer_new(base_, cb, this); +-- +2.3.0 +