Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace 'async' keyword to 'asynchronous' #122

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions tlslite/tlsconnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def __init__(self, sock):

def handshakeClientAnonymous(self, session=None, settings=None,
checker=None, serverName="",
async=False):
asynchronus=False):
"""Perform an anonymous handshake in the role of client.

This function performs an SSL or TLS handshake using an
Expand Down Expand Up @@ -102,16 +102,16 @@ def handshakeClientAnonymous(self, session=None, settings=None,
@type serverName: string
@param serverName: The ServerNameIndication TLS Extension.

@type async: bool
@param async: If False, this function will block until the
@type asynchronus: bool
@param asynchronus: If False, this function will block until the
handshake is completed. If True, this function will return a
generator. Successive invocations of the generator will
return 0 if it is waiting to read from the socket, 1 if it is
waiting to write to the socket, or will raise StopIteration if
the handshake operation is completed.

@rtype: None or an iterable
@return: If 'async' is True, a generator object will be
@return: If 'asynchronous' is True, a generator object will be
returned.

@raise socket.error: If a socket error occurs.
Expand All @@ -126,15 +126,15 @@ def handshakeClientAnonymous(self, session=None, settings=None,
settings=settings,
checker=checker,
serverName=serverName)
if async:
if asynchronus:
return handshaker
for result in handshaker:
pass

def handshakeClientSRP(self, username, password, session=None,
settings=None, checker=None,
reqTack=True, serverName="",
async=False):
asynchronous=False):
"""Perform an SRP handshake in the role of client.

This function performs a TLS/SRP handshake. SRP mutually
Expand Down Expand Up @@ -179,16 +179,16 @@ def handshakeClientSRP(self, username, password, session=None,
@type serverName: string
@param serverName: The ServerNameIndication TLS Extension.

@type async: bool
@param async: If False, this function will block until the
@type asynchronous: bool
@param asynchronous: If False, this function will block until the
handshake is completed. If True, this function will return a
generator. Successive invocations of the generator will
return 0 if it is waiting to read from the socket, 1 if it is
waiting to write to the socket, or will raise StopIteration if
the handshake operation is completed.

@rtype: None or an iterable
@return: If 'async' is True, a generator object will be
@return: If 'asynchronous' is True, a generator object will be
returned.

@raise socket.error: If a socket error occurs.
Expand All @@ -208,15 +208,15 @@ def handshakeClientSRP(self, username, password, session=None,
#
# If 'async' is True, the generator is returned to the caller,
# otherwise it is executed to completion here.
if async:
if asynchronous:
return handshaker
for result in handshaker:
pass

def handshakeClientCert(self, certChain=None, privateKey=None,
session=None, settings=None, checker=None,
nextProtos=None, reqTack=True, serverName="",
async=False):
asynchronous=False):
"""Perform a certificate-based handshake in the role of client.

This function performs an SSL or TLS handshake. The server
Expand Down Expand Up @@ -273,16 +273,16 @@ def handshakeClientCert(self, certChain=None, privateKey=None,
@type serverName: string
@param serverName: The ServerNameIndication TLS Extension.

@type async: bool
@param async: If False, this function will block until the
@type asynchronous: bool
@param asynchronous: If False, this function will block until the
handshake is completed. If True, this function will return a
generator. Successive invocations of the generator will
return 0 if it is waiting to read from the socket, 1 if it is
waiting to write to the socket, or will raise StopIteration if
the handshake operation is completed.

@rtype: None or an iterable
@return: If 'async' is True, a generator object will be
@return: If 'asynchronous' is True, a generator object will be
returned.

@raise socket.error: If a socket error occurs.
Expand All @@ -303,7 +303,7 @@ def handshakeClientCert(self, certChain=None, privateKey=None,
#
# If 'async' is True, the generator is returned to the caller,
# otherwise it is executed to completion here.
if async:
if asynchronous:
return handshaker
for result in handshaker:
pass
Expand Down