aboutsummaryrefslogtreecommitdiff
path: root/security/obfsclient
diff options
context:
space:
mode:
authorGerald Pfeifer <gerald@FreeBSD.org>2015-03-22 01:24:46 +0000
committerGerald Pfeifer <gerald@FreeBSD.org>2015-03-22 01:24:46 +0000
commitd877915549d85a2c50a6f5e8fb0867594aef809a (patch)
tree712b4fbcccbe6483fe8483e1f4b985cdb9a3ae75 /security/obfsclient
parentb18cecc4581cfd29ed94e53468c1a07ab9f7f3c8 (diff)
downloadports-d877915549d85a2c50a6f5e8fb0867594aef809a.tar.gz
ports-d877915549d85a2c50a6f5e8fb0867594aef809a.zip
Improve portability and allow for building with GCC 4.9 and above.
This backports some upstream fixes. PR: 197909 Submitted by: Fabian Keil <fk@fabiankeil.de> (maintainer)
Notes
Notes: svn path=/head/; revision=381884
Diffstat (limited to 'security/obfsclient')
-rw-r--r--security/obfsclient/files/patch-crypto-ctr.h42
-rw-r--r--security/obfsclient/files/patch-ext-optionparser.h31
-rw-r--r--security/obfsclient/files/patch-scramblesuit-client.cc30
3 files changed, 103 insertions, 0 deletions
diff --git a/security/obfsclient/files/patch-crypto-ctr.h b/security/obfsclient/files/patch-crypto-ctr.h
new file mode 100644
index 000000000000..525d9d623056
--- /dev/null
+++ b/security/obfsclient/files/patch-crypto-ctr.h
@@ -0,0 +1,42 @@
+From c91f7bbf3e0eedb080319ba3cfed7b47597b5aeb Mon Sep 17 00:00:00 2001
+From: Yawning Angel <yawning@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
+
diff --git a/security/obfsclient/files/patch-ext-optionparser.h b/security/obfsclient/files/patch-ext-optionparser.h
new file mode 100644
index 000000000000..0cc58e85ef58
--- /dev/null
+++ b/security/obfsclient/files/patch-ext-optionparser.h
@@ -0,0 +1,31 @@
+From 85dd63b32a0b77c57cbae224f7862a5fb9c069a8 Mon Sep 17 00:00:00 2001
+From: Yawning Angel <yawning@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
+
diff --git a/security/obfsclient/files/patch-scramblesuit-client.cc b/security/obfsclient/files/patch-scramblesuit-client.cc
new file mode 100644
index 000000000000..528b357405b7
--- /dev/null
+++ b/security/obfsclient/files/patch-scramblesuit-client.cc
@@ -0,0 +1,30 @@
+From 9c164b2afb666d0bcd26ba3eeb6da07a9fff551c Mon Sep 17 00:00:00 2001
+From: Yawning Angel <yawning@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
+