svn commit: r381884 - head/security/obfsclient/files
Gerald Pfeifer
gerald at FreeBSD.org
Sun Mar 22 01:24:48 UTC 2015
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 <fk at fabiankeil.de> (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 <yawning at torproject.org>
+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 <yawning at torproject.org>
+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 <yawning at torproject.org>
+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<Client*>(arg)->on_iat_transmit();
+ };
+ iat_timer_ev_ = evtimer_new(base_, cb, this);
+--
+2.3.0
+
More information about the svn-ports-all
mailing list