Opened 6 years ago

Closed 6 years ago

#11143 closed defect (fixed)

Error when starting Obfsproxy with Scramblesuit on Raspbian

Reported by: fishbones Owned by: asn
Priority: Medium Milestone:
Component: Archived/Obfsproxy Version: Tor: 0.2.5.1-alpha
Severity: Keywords: scramblesuit
Cc: phw Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Hello,

I'm running an obfuscated bridge relay on a Raspberry Pi. I have tried to update obfsproxy to run scramblesuit, as requested on the blog, but I am running into a startup error. I have the latest Tor (compiled from source), and the latest obfsproxy. I have manually specified a password rather than have the system allocate one.

Everything is up to date.

Relevant info:

pi@raspberrypi ~/.tor $ uname -a
Linux raspberrypi 3.10.25+ #622 PREEMPT Fri Jan 3 18:41:00 GMT 2014
armv6l GNU/Linux

pi@raspberrypi ~/.tor $ tor --version
Tor version 0.2.5.2-alpha (git-745434d29a92da68).

pi@raspberrypi ~/.tor $ obfsproxy --version
0.2.6

pi@raspberrypi ~ $ python --version
Python 2.7.3

A sudo pip install obfsproxy --upgrade command will only update
setuptools to 2.2, but obfsproxy stays the same.

Obfsproxy logfile:

2014-02-18 19:08:54,757 [WARNING] Obfsproxy (version: 0.2.6) starting
up.
2014-02-18 19:08:54,770 [DEBUG] argv: ['/usr/local/bin/obfsproxy',
'--log-min-severity=debug', '--log-file=/home/pi/obfs.log', 'managed']
2014-02-18 19:08:54,772 [DEBUG] args: Namespace(data_dir=None,
log_file='/home/pi/obfs.log', log_min_severity='debug',
name='managed',
no_log=False, no_safe_logging=False)
2014-02-18 19:08:54,774 [INFO] Entering server managed-mode.
2014-02-18 19:08:54,896 [DEBUG] pyptlib gave us the following data:
'{'class': <class 'pyptlib.server.ServerTransportPlugin'>,
'config': {'ORPort': ('127.0.0.1', XXXXX),
'allTransportsEnabled': False,
'authCookieFile':
'/home/pi/.tor/extended_orport_auth_cookie',
'extendedORPort': ('127.0.0.1', XXXXX),
'managedTransportVer': 1?,
'serverBindAddr': {'obfs3': ('0.0.0.0', XXXXX),
'scramblesuit': ('0.0.0.0', XXXXX)},
'serverTransportOptions': {'scramblesuit': {'password':
'XXXXXXXXXXXXXXXXX'}},
'stateLocation': '/home/pi/.tor/pt_state/',
'transports': ['obfs3', 'scramblesuit']},
'served_transports': ['obfs3', 'scramblesuit'],
'served_version': '1',
'stdout': <open file '<stdout>', mode 'w' at 0xb6cbe078>}'
2014-02-18 19:08:54,927 [INFO] ExtORPortServerFactory starting on
XXXXX
2014-02-18 19:08:54,950 [INFO] Starting factory
<obfsproxy.network.extended_orport.ExtORPortServerFactory instance at
0x1e156c0>
2014-02-18 19:08:54,952 [DEBUG] fact_ext_s_0x1e156c0: Starting up
Extended ORPort server factory.
2014-02-18 19:08:54,954 [DEBUG] Successfully launched 'obfs3' at
'[scrubbed]'
2014-02-18 19:08:54,957 [DEBUG] Setting the state location to
`/home/pi/.tor/pt_state/scramblesuit/'.
2014-02-18 19:08:54,969 [ERROR] Incorrect padding
Traceback (most recent call last):
File
"/usr/local/lib/python2.7/dist-packages/obfsproxy/pyobfsproxy.py",
line
168, in run
pyobfsproxy()
File
"/usr/local/lib/python2.7/dist-packages/obfsproxy/pyobfsproxy.py",
line
140, in pyobfsproxy
do_managed_mode()
File
"/usr/local/lib/python2.7/dist-packages/obfsproxy/pyobfsproxy.py",
line
72, in do_managed_mode
managed_server.do_managed_server()
File
"/usr/local/lib/python2.7/dist-packages/obfsproxy/managed/server.py",
line 55, in do_managed_server
transport_class.setup(pt_config)
File
"/usr/local/lib/python2.7/dist-
packages/obfsproxy/transports/scramblesuit/scramblesuit.py",
line 121, in setup
cfgpassword?))
File "/usr/lib/python2.7/base64.py", line 198, in b32decode
raise TypeError('Incorrect padding')
TypeError: Incorrect padding

Child Tickets

Change History (2)

comment:1 Changed 6 years ago by yawning

Cc: phw added

This is because your ScrambleSuit password appears to be malformed.

The base32 decoder is complaining that padding is not appended when a well formed password will require no padding. Please double check that it is 32 bytes, and contains only A-Z, 2-7.

(The error message isn't all that useful, that probably could be improved).

comment:2 Changed 6 years ago by phw

Resolution: fixed
Status: newclosed

Yawning already explained what's wrong here.

To generate a strong and valid password, you can run:
python -c 'import base64, os; print base64.b32encode(os.urandom(20))'

Also, I improved the error messages which indeed suck. See commit 8f978aab.

Note: See TracTickets for help on using tickets.