obfs4proxy: new packages (including dependencies)

obfs4proxy is a Tor pluggable transport proxy, implementing obfs4.

This commit also includes obfs4proxy's build time dependencies:

* golang-github-agl-ed25519: Go implementation of Ed25519 signature
  algorithm
* golang-github-dchest-siphash: Go implementation of SipHash-2-4
* golang-golang-x-crypto: Go supplementary cryptography libraries
* golang-golang-x-net: Go supplementary network libraries
* golang-golang-x-sys: Go packages for interaction with the OS
* golang-golang-x-text: Go text processing support
* golang-torproject-pluggable-transports-goptlib: Tor pluggable
  transports library for Go

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
This commit is contained in:
Jeffery To
2018-03-18 00:59:09 +08:00
parent de8e819f31
commit 9c6d03db9e
9 changed files with 465 additions and 0 deletions
+89
View File
@@ -0,0 +1,89 @@
#
# Copyright (C) 2018 Jeffery To
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=obfs4proxy
PKG_VERSION:=0.0.7
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://git.torproject.org/pluggable-transports/obfs4.git
PKG_SOURCE_VERSION:=8256fac93c2cf79742725e3aaced5bbe3380fd32
PKG_SOURCE_DATE:=20161115
PKG_MIRROR_HASH:=9c504337f7a2b46310083224cf0998fc7645f8af5d50657cf74358d39916eddc
PKG_LICENSE:=BSD-2-Clause
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
PKG_BUILD_DEPENDS:=golang/host
PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0
GO_PKG:=git.torproject.org/pluggable-transports/obfs4.git
include $(INCLUDE_DIR)/package.mk
include ../../lang/golang/golang-package.mk
define Package/obfs4proxy/Default
TITLE:=A Tor pluggable transport proxy, implementing obfs4
URL:=https://gitweb.torproject.org/pluggable-transports/obfs4.git/
DEPENDS:=$(GO_ARCH_DEPENDS)
endef
define Package/obfs4proxy
$(call Package/obfs4proxy/Default)
SECTION:=net
CATEGORY:=Network
endef
define Package/golang-torproject-pluggable-transports-obfs4-dev
$(call Package/obfs4proxy/Default)
$(call GoPackage/GoSubMenu)
TITLE+= (source files)
DEPENDS+= \
+golang-github-agl-ed25519-dev \
+golang-github-dchest-siphash-dev \
+golang-golang-x-crypto-dev \
+golang-golang-x-net-dev \
+golang-torproject-pluggable-transports-goptlib-dev
PKGARCH:=all
endef
define Package/obfs4proxy/Default/description
obfs4proxy is a tool that attempts to circumvent censorship by
transforming the Tor traffic between the client and the bridge. This way
censors, who usually monitor traffic between the client and the bridge,
will see innocent-looking transformed traffic instead of the actual Tor
traffic.
obfs4proxy implements the obfsucation protocols obfs2, obfs3, and obfs4.
It is written in Go and is compliant with the Tor pluggable transports
specification, and its modular architecture allows it to support
multiple pluggable transports.
endef
define Package/obfs4proxy/description
$(call Package/obfs4proxy/Default/description)
This package contains both the client and the bridge in a single
program.
endef
define Package/golang-torproject-pluggable-transports-obfs4-dev/description
$(call Package/obfs4proxy/Default/description)
This package provides the source files for the client/bridge program.
endef
$(eval $(call GoBinPackage,obfs4proxy))
$(eval $(call BuildPackage,obfs4proxy))
$(eval $(call GoSrcPackage,golang-torproject-pluggable-transports-obfs4-dev))
$(eval $(call BuildPackage,golang-torproject-pluggable-transports-obfs4-dev))
@@ -0,0 +1,40 @@
From af4824cb0b2c36a0eba4bc1590eb0737302e992e Mon Sep 17 00:00:00 2001
From: Yawning Angel <yawning@schwanenlied.me>
Date: Wed, 10 Jan 2018 15:11:44 +0000
Subject: Bug 24793: Send the correct authorization HTTP header for basic auth.
Apparently I didn't test the "connect via HTTP(s)" proxy with
authentication at all when I added that functionality, so it has been
broken for years.
This should fix it now.
---
obfs4proxy/proxy_http.go | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/obfs4proxy/proxy_http.go b/obfs4proxy/proxy_http.go
index 6f11790..a5c2100 100644
--- a/obfs4proxy/proxy_http.go
+++ b/obfs4proxy/proxy_http.go
@@ -29,6 +29,7 @@ package main
import (
"bufio"
+ "encoding/base64"
"fmt"
"net"
"net/http"
@@ -90,7 +91,9 @@ func (s *httpProxy) Dial(network, addr string) (net.Conn, error) {
}
req.Close = false
if s.haveAuth {
- req.SetBasicAuth(s.username, s.password)
+ // SetBasicAuth doesn't quite do what is appropriate, because
+ // the correct header is `Proxy-Authorization`.
+ req.Header.Set("Proxy-Authorization", base64.StdEncoding.EncodeToString([]byte(s.username + ":" + s.password)))
}
req.Header.Set("User-Agent", "")
--
cgit v1.1