summaryrefslogtreecommitdiff
path: root/src/leap/crypto
diff options
context:
space:
mode:
authorTomas Touceda <chiiph@leap.se>2013-05-07 16:08:55 -0300
committerTomas Touceda <chiiph@leap.se>2013-05-07 16:08:55 -0300
commit4cc3c7d3f0d63d97df0d40c3e2d0941c5e069eb9 (patch)
treedfabf2a91cd8466b572539b73d38273eef733339 /src/leap/crypto
parent76641e028f4a8b6c5c89ad0e9ff4bfecc075d678 (diff)
parente6b7d52d827109d6fc8d79a28e8d46964e1ad94c (diff)
Merge remote-tracking branch 'kali/feature/update-docs' into develop
Diffstat (limited to 'src/leap/crypto')
-rw-r--r--src/leap/crypto/srpauth.py68
-rw-r--r--src/leap/crypto/srpregister.py22
-rwxr-xr-xsrc/leap/crypto/tests/fake_provider.py4
3 files changed, 47 insertions, 47 deletions
diff --git a/src/leap/crypto/srpauth.py b/src/leap/crypto/srpauth.py
index ba8ac3f5..9446cee8 100644
--- a/src/leap/crypto/srpauth.py
+++ b/src/leap/crypto/srpauth.py
@@ -58,8 +58,8 @@ class SRPAuth(QtCore.QObject):
"""
Constructor for SRPAuth implementation
- @param server: Server to which we will authenticate
- @type server: str
+ :param server: Server to which we will authenticate
+ :type server: str
"""
QtCore.QObject.__init__(self)
@@ -91,11 +91,11 @@ class SRPAuth(QtCore.QObject):
Rounds the val to a multiple of 2 and returns the
unhexlified value
- @param val: hexlified value
- @type val: str
+ :param val: hexlified value
+ :type val: str
- @rtype: binary hex data
- @return: unhexlified val
+ :rtype: binary hex data
+ :return: unhexlified val
"""
return binascii.unhexlify(val) \
if (len(val) % 2 == 0) else binascii.unhexlify('0' + val)
@@ -104,10 +104,10 @@ class SRPAuth(QtCore.QObject):
"""
Generates the SRP.User to get the A SRP parameter
- @param username: username to login
- @type username: str
- @param password: password for the username
- @type password: str
+ :param username: username to login
+ :type username: str
+ :param password: password for the username
+ :type password: str
"""
logger.debug("Authentication preprocessing...")
self._srp_user = self._srp.User(username,
@@ -125,13 +125,13 @@ class SRPAuth(QtCore.QObject):
Might raise SRPAuthenticationError
- @param username: username to login
- @type username: str
- @param password: password for the username
- @type password: str
+ :param username: username to login
+ :type username: str
+ :param password: password for the username
+ :type password: str
- @return: salt and B parameters
- @rtype: tuple
+ :return: salt and B parameters
+ :rtype: tuple
"""
logger.debug("Starting authentication process...")
try:
@@ -184,15 +184,15 @@ class SRPAuth(QtCore.QObject):
Might throw SRPAuthenticationError
- @param salt: salt for the username
- @type salt: str
- @param B: B SRP parameter
- @type B: str
- @param username: username for this session
- @type username: str
+ :param salt: salt for the username
+ :type salt: str
+ :param B: B SRP parameter
+ :type B: str
+ :param username: username for this session
+ :type username: str
- @return: the M2 SRP parameter
- @rtype: str
+ :return: the M2 SRP parameter
+ :rtype: str
"""
logger.debug("Processing challenge...")
try:
@@ -261,8 +261,8 @@ class SRPAuth(QtCore.QObject):
Might throw SRPAuthenticationError
- @param M2: M2 SRP parameter
- @type M2: str
+ :param M2: M2 SRP parameter
+ :type M2: str
"""
logger.debug("Verifying session...")
try:
@@ -296,10 +296,10 @@ class SRPAuth(QtCore.QObject):
Might raise SRPAuthenticationError
- @param username: username for this session
- @type username: str
- @param password: password for this user
- @type password: str
+ :param username: username for this session
+ :type username: str
+ :param password: password for this user
+ :type password: str
"""
leap_assert(self.get_session_id() is None, "Already logged in")
@@ -390,10 +390,10 @@ class SRPAuth(QtCore.QObject):
Might raise SRPAuthenticationError
- @param username: username for this session
- @type username: str
- @param password: password for this user
- @type password: str
+ :param username: username for this session
+ :type username: str
+ :param password: password for this user
+ :type password: str
"""
try:
diff --git a/src/leap/crypto/srpregister.py b/src/leap/crypto/srpregister.py
index 59aaf257..b9ca16cf 100644
--- a/src/leap/crypto/srpregister.py
+++ b/src/leap/crypto/srpregister.py
@@ -48,11 +48,11 @@ class SRPRegister(QtCore.QObject):
"""
Constructor
- @param provider_config: provider configuration instance,
+ :param provider_config: provider configuration instance,
properly loaded
- @type privider_config: ProviderConfig
- @param register_path: webapp path for registering users
- @type register_path; str
+ :type privider_config: ProviderConfig
+ :param register_path: webapp path for registering users
+ :type register_path; str
"""
QtCore.QObject.__init__(self)
leap_assert(provider_config, "Please provide a provider")
@@ -84,7 +84,7 @@ class SRPRegister(QtCore.QObject):
Returns the URI where the register request should be made for
the provider
- @rtype: str
+ :rtype: str
"""
uri = "https://%s:%s/%s/%s" % (
@@ -99,13 +99,13 @@ class SRPRegister(QtCore.QObject):
"""
Registers a user with the validator based on the password provider
- @param username: username to register
- @type username: str
- @param password: password for this username
- @type password: str
+ :param username: username to register
+ :type username: str
+ :param password: password for this username
+ :type password: str
- @rtype: tuple
- @rparam: (ok, request)
+ :rtype: tuple
+ :rparam: (ok, request)
"""
salt, verifier = self._srp.create_salted_verification_key(
username,
diff --git a/src/leap/crypto/tests/fake_provider.py b/src/leap/crypto/tests/fake_provider.py
index d533b82b..74a735ff 100755
--- a/src/leap/crypto/tests/fake_provider.py
+++ b/src/leap/crypto/tests/fake_provider.py
@@ -321,8 +321,8 @@ def get_provider_factory():
* port 8000 for http connections
* port 8443 for https connections
- @rparam: factory for a site
- @rtype: Site instance
+ :rparam: factory for a site
+ :rtype: Site instance
"""
root = Resource()
root.putChild("provider.json", File(