summaryrefslogtreecommitdiff
path: root/src/leap/crypto
diff options
context:
space:
mode:
authorkali <kali@leap.se>2013-05-03 02:59:22 +0900
committerkali <kali@leap.se>2013-05-11 21:59:58 +0900
commit2dae2703fb8c2ae7e721ce83020c0dd10ff9ca33 (patch)
tree280cb8751c56d43769fb15ead4fb4476960ae06c /src/leap/crypto
parentc85894efdbd6f65eb2b0c2edfc216827c192c1d1 (diff)
updated documentation
* documentation reviewed after rewrite, ready for 0.2.1 * updated docstrings format to fit sphinx autodoc
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 749b6f8c..07b3c917 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(