debian/0000775000000000000000000000000012316371757007204 5ustar debian/source/0000775000000000000000000000000012241227737010477 5ustar debian/source/format0000664000000000000000000000001412241227737011705 0ustar 3.0 (quilt) debian/copyright0000664000000000000000000000254712247373235011143 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: srp Upstream-Contact: Tom Cocagne Source: http://pypi.python.org/pypi/srp/ Files: * Copyright: 2012, Tom Cocagne License: Expat Files: debian/* Copyright: 2013 Ben Carrillo License: Expat License: Expat Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: . The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. . THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. debian/changelog0000664000000000000000000000171512316371756011061 0ustar python-srp (1.0.4-1ubuntu2) trusty; urgency=medium * No change rebuild to drop python3.3 compiled extension. -- Dimitri John Ledkov Tue, 01 Apr 2014 00:02:06 +0100 python-srp (1.0.4-1ubuntu1) trusty; urgency=low * Add macros for Python 3 compatibility, resolving FTBFS on amd64. -- Daniel T Chen Sun, 29 Dec 2013 15:26:31 -0500 python-srp (1.0.4-1) unstable; urgency=low [ Micah Anderson ] * Upgrade to 1.0.4 * Update debian/control VCS fields for new upstream location * Add myself to Uploaders [ Ben Carrillo ] * Change debian/* license to Expat. -- Ben Carrillo Mon, 11 Nov 2013 18:27:00 -0200 python-srp (1.0.2-2) unstable; urgency=low * Python3 package. -- Ben Carrillo Wed, 30 Oct 2013 03:13:44 -0200 python-srp (1.0.2-1) unstable; urgency=low * Initial release. Closes: 699122 -- Ben Carrillo Mon, 28 Jan 2013 06:37:21 +0900 debian/gbp.conf0000664000000000000000000000003612241227737010615 0ustar [DEFAULT] pristine-tar = True debian/control0000664000000000000000000000625312260037631010601 0ustar Source: python-srp Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Ben Carrillo Uploaders: Micah Anderson Section: python Priority: optional Build-Depends: python-all-dev (>= 2.6.6-3), python3-all-dev, debhelper (>= 9), python-sphinx (>= 1.0.7+dfsg), libssl-dev Standards-Version: 3.9.4 X-Python-Version: >= 2.6 X-Python3-Version: >= 3.0 Vcs-Git: https://github.com/cocagne/pysrp.git Vcs-Browser: https://github.com/cocagne/pysrp Homepage: http://code.google.com/p/pysrp/ Package: python-srp Architecture: any Depends: ${misc:Depends}, ${python:Depends}, ${shlibs:Depends}, ${sphinxdoc:Depends}, libssl1.0.0 Description: Secure Remote Password protocol implementation This package provides an implementation of the Secure Remote Password protocol (SRP). SRP is a cryptographically strong authentication protocol for password-based, mutual authentication over an insecure network connection. . Unlike other common challenge-response autentication protocols, such as Kereros and SSL, SRP does not rely on an external infrastructure of trusted key servers or certificate management. Instead, SRP server applications use verification keys derived from each user's password to determine the authenticity of a network connection. . SRP provides mutual-authentication in that successful authentication requires both sides of the connection to have knowledge of the user's password. If the client side lacks the user's password or the server side lacks the proper verification key, the authentication will fail. . Unlike SSL, SRP does not directly encrypt all data flowing through the authenticated connection. However, successful authentication does result in a cryptographically strong shared key that can be used for symmetric-key encryption. Package: python3-srp Architecture: any Depends: ${misc:Depends}, ${python3:Depends}, ${shlibs:Depends}, ${sphinxdoc:Depends}, libssl1.0.0 Description: Secure Remote Password protocol implementation This package provides an implementation of the Secure Remote Password protocol (SRP). SRP is a cryptographically strong authentication protocol for password-based, mutual authentication over an insecure network connection. . Unlike other common challenge-response autentication protocols, such as Kereros and SSL, SRP does not rely on an external infrastructure of trusted key servers or certificate management. Instead, SRP server applications use verification keys derived from each user's password to determine the authenticity of a network connection. . SRP provides mutual-authentication in that successful authentication requires both sides of the connection to have knowledge of the user's password. If the client side lacks the user's password or the server side lacks the proper verification key, the authentication will fail. . Unlike SSL, SRP does not directly encrypt all data flowing through the authenticated connection. However, successful authentication does result in a cryptographically strong shared key that can be used for symmetric-key encryption. This package contains the python3 version. . This package provides the python 3 version. debian/rules0000775000000000000000000000275612241234723010262 0ustar #!/usr/bin/make -f # -*- makefile -*- # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # Prevent setuptools/distribute from accessing the internet. export http_proxy = http://127.0.0.1:9 export DEB_CFLAGS_MAINT_APPEND = -Wl,-z,relro PYVERS := $(shell pyversions -r) PY3VERS = $(shell py3versions -r) package=python-srp package3=python3-srp %: dh $@ --with python2,python3,sphinxdoc --buildsystem=python_distutils override_dh_auto_build: sphinx-build $(CURDIR)/srp/doc $(CURDIR)/srp/doc/build set -ex; \ for python in $(PYVERS) $(PY3VERS); do \ $$python setup.py build; \ done override_dh_auto_install: set -ex; \ for python in $(PYVERS); do \ $$python setup.py install --skip-build \ --root debian/$(package)\ --install-layout deb; \ done set -ex; \ for python in $(PY3VERS); do \ $$python setup.py install --skip-build \ --root debian/$(package3)\ --install-layout deb; \ done override_dh_install: dh_install -Xsrp/doc/ override_dh_installdocs: mkdir -p debian/$(package)/usr/share/doc/$(package) mkdir -p debian/$(package3)/usr/share/doc/$(package3) cp debian/copyright debian/$(package)/usr/share/doc/$(package)/ cp debian/copyright debian/$(package3)/usr/share/doc/$(package3)/ override_dh_sphinxdoc: cp -r srp/doc/build/* debian/$(package)/usr/share/doc/$(package)/ dh_sphinxdoc usr/share/doc/$(package)/ override_dh_auto_clean: dh_auto_clean rm -rf srp/doc/build rm -rf build rm -rf *.egg-info find \( -name '._*' -o -name '*.pyc' \) -delete debian/watch0000664000000000000000000000011212241227737010222 0ustar version=3 http://pypi.python.org/packages/source/s/srp/srp-(.*)\.tar\.gz debian/patches/0000775000000000000000000000000012260103723010613 5ustar debian/patches/py3_support0000664000000000000000000001720512260103723013052 0ustar Index: python-srp-1.0.4/srp/_srp.c =================================================================== --- python-srp-1.0.4.orig/srp/_srp.c 2013-08-31 14:16:23.000000000 -0400 +++ python-srp-1.0.4/srp/_srp.c 2013-12-29 15:36:34.891181947 -0500 @@ -869,6 +869,13 @@ * *****************************************************************************/ +#if PY_MAJOR_VERSION >= 3 +#define PyString_Check PyBytes_Check +#define PyString_FromStringAndSize PyBytes_FromStringAndSize +#define PyString_FromString PyBytes_FromString +#define PyString_AsStringAndSize PyBytes_AsStringAndSize +#endif + typedef struct { PyObject_HEAD @@ -895,7 +902,7 @@ if ( self->bytes_s != NULL ) free( (char *)self->bytes_s ); - self->ob_type->tp_free( (PyObject *) self ); + Py_TYPE(self)->tp_free( (PyObject *) self ); } @@ -903,7 +910,7 @@ { if ( self->usr != NULL ) srp_user_delete( self->usr ); - self->ob_type->tp_free( (PyObject *) self ); + Py_TYPE(self)->tp_free( (PyObject *) self ); } @@ -1401,6 +1408,20 @@ {NULL} /* Sentinel */ }; +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef moduledef = +{ + PyModuleDef_HEAD_INIT, + "srp._srp", + "SRP-6a implementation", + -1, + srp_module_methods, + NULL, + NULL, + NULL, + NULL, +}; +#endif static PyTypeObject PyVerifier_Type = { PyVarObject_HEAD_INIT(NULL, 0) @@ -1541,7 +1562,11 @@ if (PyType_Ready(&PyVerifier_Type) < 0 || PyType_Ready(&PyUser_Type) < 0) return; +#if PY_MAJOR_VERSION >= 3 + m = PyModule_Create(&moduledef); +#else m = Py_InitModule3("srp._srp", srp_module_methods,"SRP-6a implementation"); +#endif if (m == NULL) return; Index: python-srp-1.0.4/srp/test_srp.py =================================================================== --- python-srp-1.0.4.orig/srp/test_srp.py 2013-08-31 14:16:23.000000000 -0400 +++ python-srp-1.0.4/srp/test_srp.py 2013-12-29 10:27:37.000000000 -0500 @@ -1,4 +1,5 @@ #!/usr/bin/env python +from __future__ import print_function import unittest import os.path @@ -7,18 +8,19 @@ import time import thread + this_dir = os.path.dirname( os.path.abspath(__file__) ) - + build_dir = os.path.join( os.path.dirname(this_dir), 'build' ) if not os.path.exists( build_dir ): - print 'Please run "python setup.py build" prior to running tests' + print('Please run "python setup.py build" prior to running tests') sys.exit(1) - + plat_dirs = [ d for d in os.listdir('build') if d.startswith('lib') ] if not len(plat_dirs) == 1: - print 'Unexpected build result... aborting' + print('Unexpected build result... aborting') plat_dir = os.path.join( build_dir, plat_dirs[0] ) @@ -33,7 +35,7 @@ try: import srp._srp as _srp except ImportError: - print 'Failed to import srp._srp. Aborting tests' + print('Failed to import srp._srp. Aborting tests') sys.exit(1) @@ -62,17 +64,17 @@ usr = User( username, password, hash_alg, ng_type, n_hex, g_hex ) uname, A = usr.start_authentication() - + # username, A => server svr = Verifier( uname, _s, _v, A, hash_alg, ng_type, n_hex, g_hex ) s,B = svr.get_challenge() - + # s,B => client M = usr.process_challenge( s, B ) - + # M => server HAMK = svr.verify_session( M ) - + # HAMK => client usr.verify_session( HAMK ) @@ -143,24 +145,24 @@ NLEFT = 0 def do_auth( mod, hash_alg, ng_type, _s, _v ): - + usr = mod.User( username, password, hash_alg, ng_type) uname, A = usr.start_authentication() - + # username, A => server svr = mod.Verifier( uname, _s, _v, A, hash_alg, ng_type) s,B = svr.get_challenge() - + # s,B => client M = usr.process_challenge( s, B ) - + # M => server HAMK = svr.verify_session( M ) - + # HAMK => client usr.verify_session( HAMK ) - - if not svr.authenticated() or not usr.authenticated(): + + if not svr.authenticated() or not usr.authenticated(): raise Exception('Authentication failed!') @@ -169,7 +171,7 @@ _s, _v = srp.create_salted_verification_key( username, password, hash_alg, ng_type ) NLEFT = niter - + def test_thread(): global NLEFT while NLEFT > 0: @@ -188,75 +190,78 @@ def get_param_str( mod, hash_alg, ng_type ): - + m = { 'srp._pysrp' : 'Python', 'srp._ctsrp' : 'ctypes', 'srp._srp' : 'C ' } - + cfg = '%s, %s, %d:' % (m[mod.__name__], hash_map[hash_alg], prime_map[ng_type]) return cfg - + def param_test( mod, hash_alg, ng_type, niter=10 ): duration = performance_test( mod, hash_alg, ng_type, niter ) cfg = get_param_str( mod, hash_alg, ng_type ) - print ' ', cfg.ljust(20), '%.6f' % (duration/niter) + print(' ', cfg.ljust(20), '%.6f' % (duration/niter)) return duration/niter - + def print_default_timings(): - print '*'*60 - print 'Default Parameter Timings:' + print('*'*60) + print('Default Parameter Timings:') py_time = param_test( _pysrp, srp.SHA1, srp.NG_2048 ) ct_time = param_test( _ctsrp, srp.SHA1, srp.NG_2048 ) c_time = param_test( _srp, srp.SHA1, srp.NG_2048 ) - print '' - print 'Performance increases: ' - print ' ctypes-module : ', py_time/ct_time - print ' C-module : ', py_time/c_time + print('') + print('Performance increases: ') + print(' ctypes-module : ', py_time/ct_time) + print(' C-module : ', py_time/c_time) def print_performance_table(): ng_types = [ srp.NG_1024, srp.NG_2048, srp.NG_4096, srp.NG_8192 ] hash_types = [ srp.SHA1, srp.SHA224, srp.SHA256, srp.SHA384, srp.SHA512 ] - print '*'*60 - print 'Hash Algorithm vs Prime Number performance table' - print '' - print ' |', + print('*'*60) + print('Hash Algorithm vs Prime Number performance table') + print('') + print(' |') for ng in ng_types: - print ('NG_%d' % prime_map[ng]).rjust(12), - print '' - print '-'*60 + print ('NG_%d' % prime_map[ng]).rjust(12) + print('') + print('-'*60) for hash_alg in hash_types: - print '%s |' % hash_map[hash_alg], + print('%s |' % hash_map[hash_alg],) for ng in ng_types: - print '{0:>12f}'.format(performance_test(_srp, hash_alg, ng) / 10), - print '' + print('{0:>12f}'.format( + performance_test(_srp, hash_alg, ng) / 10)) + print('') def print_thread_performance(): - print '*'*60 - print 'Thread Performance Test:' + print('*'*60) + print('Thread Performance Test:') niter = 100 for nthreads in range(1,11): - print ' Thread Count {0:>2}: {1:8f}'.format(nthreads, performance_test(_srp, srp.SHA1, srp.NG_2048, niter, nthreads)/niter) + print(' Thread Count {0:>2}: {1:8f}'.format( + nthreads, performance_test( + _srp, srp.SHA1, srp.NG_2048, niter, nthreads)/niter)) -print '*'*60 -print '*' -print '* Testing Implementation' -print '*' +print('*'*60) +print('*') +print('* Testing Implementation') +print('*') suite = unittest.TestLoader().loadTestsFromTestCase(SRPTests) unittest.TextTestRunner(verbosity=1).run(suite) -print '*'*60 -print '*' -print '* Performance Testing' -print '*' +print('*'*60) +print('*') +print('* Performance Testing') +print('*') print_thread_performance() print_performance_table() print_default_timings() @@ -264,5 +269,3 @@ # Pause briefly to ensure no background threads are still executing time.sleep(0.1) - - debian/patches/series0000664000000000000000000000001412241236223012024 0ustar py3_support debian/docs0000664000000000000000000000002312241227737010045 0ustar README.txt LICENSE debian/compat0000664000000000000000000000000212241227737010375 0ustar 9