Skip to content

Commit bff8773

Browse files
authored
Merge pull request #391 from tomato42/docs
Update docs
2 parents 9396ca0 + ec6a981 commit bff8773

File tree

10 files changed

+95
-96
lines changed

10 files changed

+95
-96
lines changed

docs/conf.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
# ones.
3232
extensions = [
3333
'sphinx.ext.autodoc',
34+
'sphinx.ext.intersphinx',
3435
]
3536

3637
# Add any paths that contain templates here, relative to this directory.
@@ -121,7 +122,7 @@
121122
# The theme to use for HTML and HTML Help pages. See the documentation for
122123
# a list of builtin themes.
123124
#
124-
html_theme = 'alabaster'
125+
html_theme = 'sphinx_rtd_theme'
125126

126127
# Theme options are theme-specific and customize the look and feel of a theme
127128
# further. For a list of options available for each theme, see the
@@ -338,3 +339,4 @@
338339
# If true, do not generate a @detailmenu in the "Top" node's menu.
339340
#
340341
# texinfo_no_detailmenu = False
342+
intersphinx_mapping = {'https://docs.python.org/': None}

docs/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Contents:
1111
.. toctree::
1212
:maxdepth: 2
1313

14+
modules
15+
1416
Indices and tables
1517
==================
1618

tlslite/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,13 @@
1313
To use, do::
1414
1515
from tlslite import TLSConnection, ...
16-
16+
1717
If you want to import the most useful objects, the cleanest way is::
1818
1919
from tlslite.api import *
2020
2121
Then use the L{tlslite.TLSConnection.TLSConnection} class with a socket.
2222
(Or, use one of the integration classes in L{tlslite.integration}).
23-
24-
@version: 0.8.0-alpha36
2523
"""
2624

2725
from tlslite.api import *

tlslite/extensions.py

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ class TLSExtension(object):
5151
:ivar extType: a 2^16-1 limited integer specifying the type of the
5252
extension that it contains, e.g. 0 indicates server name extension
5353
54-
:vartype extData: bytearray
55-
:ivar extData: a byte array containing the value of the extension as
54+
:vartype ~.extData: bytearray
55+
:ivar ~.extData: a byte array containing the value of the extension as
5656
to be written on the wire
5757
5858
:vartype serverType: boolean
@@ -383,7 +383,7 @@ def parse(self, parser):
383383
"""Deserialise extension from on-the-wire data.
384384
385385
:param tlslite.utils.codec.Parser parser: data
386-
:rtype TLSExtension
386+
:rtype: TLSExtension
387387
"""
388388
if not parser.getRemainingLength():
389389
self._internal_value = None
@@ -669,8 +669,8 @@ class SNIExtension(TLSExtension):
669669
:vartype extType: int
670670
:ivar extType: numeric type of SNIExtension, i.e. 0
671671
672-
:vartype extData: bytearray
673-
:ivar extData: raw representation of the extension
672+
:vartype ~.extData: bytearray
673+
:ivar ~.extData: raw representation of the extension
674674
"""
675675

676676
ServerName = namedtuple('ServerName', 'name_type name')
@@ -853,8 +853,8 @@ class SupportedVersionsExtension(VarSeqListExtension):
853853
:vartype extType: int
854854
:ivar extType: numeric type of the Supported Versions extension, i.e. 43
855855
856-
:vartype extData: bytearray
857-
:ivar extData: raw representation of the extension data
856+
:vartype ~.extData: bytearray
857+
:ivar ~.extData: raw representation of the extension data
858858
859859
:vartype versions: list of tuples
860860
:ivar versions: list of supported protocol versions; each tuple has two
@@ -878,11 +878,11 @@ class SrvSupportedVersionsExtension(TLSExtension):
878878
:vartype extType: int
879879
:ivar extType: numeric type of the Supported Versions extension, i.e. 43
880880
881-
:vartype extData: bytearray
882-
:ivar extData: raw representation of the extension payload
881+
:vartype ~.extData: bytearray
882+
:ivar ~.extData: raw representation of the extension payload
883883
884-
:vartype version: tuple
885-
:ivar version: version selected by the server
884+
:vartype ~.version: tuple
885+
:ivar ~.version: version selected by the server
886886
"""
887887

888888
def __init__(self):
@@ -950,8 +950,8 @@ class ClientCertTypeExtension(VarListExtension):
950950
:vartype extType: int
951951
:ivar extType: numeric type of Certificate Type extension, i.e. 9
952952
953-
:vartype extData: bytearray
954-
:ivar extData: raw representation of the extension data
953+
:vartype ~.extData: bytearray
954+
:ivar ~.extData: raw representation of the extension data
955955
956956
:vartype certTypes: list of int
957957
:ivar certTypes: list of certificate type identifiers (each one byte long)
@@ -977,8 +977,8 @@ class ServerCertTypeExtension(IntExtension):
977977
:vartype extType: int
978978
:ivar extType: binary type of Certificate Type extension, i.e. 9
979979
980-
:vartype extData: bytearray
981-
:ivar extData: raw representation of the extension data
980+
:vartype ~.extData: bytearray
981+
:ivar ~.extData: raw representation of the extension data
982982
983983
:vartype cert_type: int
984984
:ivar cert_type: the certificate type selected by server
@@ -1014,8 +1014,8 @@ class SRPExtension(TLSExtension):
10141014
:vartype extType: int
10151015
:ivar extType: numeric type of SRPExtension, i.e. 12
10161016
1017-
:vartype extData: bytearray
1018-
:ivar extData: raw representation of extension data
1017+
:vartype ~.extData: bytearray
1018+
:ivar ~.extData: raw representation of extension data
10191019
10201020
:vartype identity: bytearray
10211021
:ivar identity: UTF-8 encoding of user name
@@ -1101,8 +1101,8 @@ class NPNExtension(TLSExtension):
11011101
:vartype extType: int
11021102
:ivar extType: numeric type of NPNExtension, i.e. 13172
11031103
1104-
:vartype extData: bytearray
1105-
:ivar extData: raw representation of extension data
1104+
:vartype ~.extData: bytearray
1105+
:ivar ~.extData: raw representation of extension data
11061106
"""
11071107

11081108
def __init__(self):
@@ -1527,8 +1527,8 @@ class ALPNExtension(TLSExtension):
15271527
:vartype extType: int
15281528
:ivar extType: numberic type of ALPNExtension, i.e. 16
15291529
1530-
:vartype extData: bytearray
1531-
:ivar extData: raw encoding of the extension data
1530+
:vartype ~.extData: bytearray
1531+
:var ~.extData: raw encoding of the extension data
15321532
"""
15331533

15341534
def __init__(self):
@@ -1796,8 +1796,8 @@ class HeartbeatExtension(IntExtension):
17961796
"""
17971797
Heartbeat extension from RFC 6520
17981798
1799-
@type mode: int
1800-
@ivar mode: mode if peer is allowed or nor allowed to send responses
1799+
:type mode: int
1800+
:ivar mode: mode if peer is allowed or nor allowed to send responses
18011801
"""
18021802
def __init__(self):
18031803
super(HeartbeatExtension, self).__init__(

tlslite/handshakesettings.py

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class Keypair(object):
6565
:vartype key: RSAKey or ECDSAKey
6666
:ivar key: private key
6767
68-
:vartype certificates: list of X509
68+
:vartype certificates: list(X509)
6969
:ivar certificates: the certificates to send to peer if the key is selected
7070
for use. The first one MUST include the public key of the ``key``
7171
"""
@@ -89,22 +89,22 @@ class VirtualHost(object):
8989
TODO: support SRP as alternative to certificates
9090
TODO: support PSK as alternative to certificates
9191
92-
:vartype keys: list of :ref:`~Keypair`
92+
:vartype keys: list(Keypair)
9393
:ivar keys: List of certificates and keys to be used in this
9494
virtual host. First keypair able to server ClientHello will be used.
9595
96-
:vartype hostnames: set of bytes
96+
:vartype hostnames: set(bytes)
9797
:ivar hostnames: all the hostnames that server supports
98-
please use :ref:`matches_hostname` to verify if the VirtualHost
98+
please use :py:meth:`matches_hostname` to verify if the VirtualHost
9999
can serve a request to a given hostname as that allows wildcard hosts
100100
that always reply True.
101101
102-
:vartype trust_anchors: list of X509
102+
:vartype trust_anchors: list(X509)
103103
:ivar trust_anchors: list of CA certificates supported for client
104104
certificate authentication, sent in CertificateRequest
105105
106-
:ivar app_protocols: all the application protocols that the server supports
107-
(for ALPN)
106+
:ivar list(bytes) app_protocols: all the application protocols that the
107+
server supports (for ALPN)
108108
"""
109109

110110
def __init__(self):
@@ -146,7 +146,7 @@ class HandshakeSettings(object):
146146
parameters larger than this length, an alert will be signalled.
147147
The default is 8193.
148148
149-
:vartype cipherNames: list
149+
:vartype cipherNames: list(str)
150150
:ivar cipherNames: The allowed ciphers.
151151
152152
The allowed values in this list are 'chacha20-poly1305', 'aes256gcm',
@@ -160,22 +160,18 @@ class HandshakeSettings(object):
160160
choose whichever ciphersuite matches the earliest entry in this
161161
list.
162162
163-
.. note:: If '3des' is used in this list, but TLS Lite can't find an
164-
add-on library that supports 3DES, then '3des' will be silently
165-
removed.
166-
167163
The default value is list that excludes 'rc4', 'null' and
168164
'chacha20-poly1305_draft00'.
169165
170-
:vartype macNames: list
166+
:vartype macNames: list(str)
171167
:ivar macNames: The allowed MAC algorithms.
172168
173169
The allowed values in this list are 'sha384', 'sha256', 'aead', 'sha'
174170
and 'md5'.
175171
176172
The default value is list that excludes 'md5'.
177173
178-
:vartype certificateTypes: list
174+
:vartype certificateTypes: list(str)
179175
:ivar certificateTypes: The allowed certificate types.
180176
181177
The only allowed certificate type is 'x509'. This list is only used
@@ -219,7 +215,7 @@ class HandshakeSettings(object):
219215
:vartype sendFallbackSCSV: bool
220216
:ivar sendFallbackSCSV: Whether to, as a client, send FALLBACK_SCSV.
221217
222-
:vartype rsaSigHashes: list
218+
:vartype rsaSigHashes: list(str)
223219
:ivar rsaSigHashes: List of hashes supported (and advertised as such) for
224220
TLS 1.2 signatures over Server Key Exchange or Certificate Verify with
225221
RSA signature algorithm.
@@ -229,7 +225,7 @@ class HandshakeSettings(object):
229225
The allowed hashes are: "md5", "sha1", "sha224", "sha256",
230226
"sha384" and "sha512". The default list does not include md5.
231227
232-
:vartype ecdsaSigHashes: list
228+
:vartype ecdsaSigHashes: list(str)
233229
:ivar ecdsaSigHashes: List of hashes supported (and advertised as such) for
234230
TLS 1.2 signatures over Server Key Exchange or Certificate Verify with
235231
ECDSA signature algorithm.
@@ -239,7 +235,7 @@ class HandshakeSettings(object):
239235
The allowed hashes are: "sha1", "sha224", "sha256",
240236
"sha384" and "sha512".
241237
242-
:vartype eccCurves: list
238+
:vartype eccCurves: list(str)
243239
:ivar eccCurves: List of named curves that are to be supported
244240
245241
:vartype useEncryptThenMAC: bool
@@ -261,21 +257,22 @@ class HandshakeSettings(object):
261257
first curve for eccCurves and may be distinct from curves from that
262258
list.
263259
264-
:vartype keyShares: list
260+
:vartype keyShares: list(str)
265261
:ivar keyShares: list of TLS 1.3 key shares to include in Client Hello
266262
267263
:vartype padding_cb: func
268264
:ivar padding_cb: Callback to function computing number of padding bytes
269265
for TLS 1.3. Signature is cb_func(msg_size, content_type, max_size).
270266
271-
:vartype pskConfigs: list of tuples
267+
:vartype pskConfigs: list(tuple(bytearray, bytearray, bytearray))
272268
:ivar pskConfigs: list of tuples, first element of the tuple is the
273269
human readable, UTF-8 encoded, "identity" of the associated secret
274270
(bytearray, can be empty for TLS 1.2 and earlier), second element is
275271
the binary secret (bytearray), third is an optional parameter
276-
specifying the PRF hash to be used in TLS 1.3 ('sha256' or 'sha384')
272+
specifying the PRF hash to be used in TLS 1.3 (``sha256`` or
273+
``sha384``)
277274
278-
:vartype ticketKeys: list of bytearray
275+
:vartype ticketKeys: list(bytearray)
279276
:ivar ticketKeys: keys to be used for encrypting and decrypting session
280277
tickets. First entry is the encryption key for new tickets and the
281278
default decryption key, subsequent entries are the fallback keys
@@ -296,7 +293,7 @@ class HandshakeSettings(object):
296293
:ivar ticketLifetime: maximum allowed lifetime of ticket encryption key,
297294
in seconds. 1 day by default
298295
299-
:vartype psk_modes: list
296+
:vartype psk_modes: list(str)
300297
:ivar psk_modes: acceptable modes for the PSK key exchange in TLS 1.3
301298
302299
:ivar int max_early_data: maximum number of bytes acceptable for 0-RTT
@@ -312,8 +309,8 @@ class HandshakeSettings(object):
312309
:ivar heartbeat_response_callback: Callback to function when Heartbeat
313310
response is received.
314311
315-
:vartype record_size_limit: int
316-
:ivar record_size_limit: maximum size of records we are willing to process
312+
:vartype ~.record_size_limit: int
313+
:ivar ~.record_size_limit: maximum size of records we are willing to process
317314
(value advertised to the other side). It must not be larger than
318315
2**14+1 (the maximum for TLS 1.3) and will be reduced to 2**14 if TLS
319316
1.2 or lower is the highest enabled version. Must not be set to values

tlslite/messages.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -318,14 +318,14 @@ class ClientHello(HelloMessage):
318318
:vartype srp_username: bytearray
319319
:ivar srp_username: name of the user in SRP extension (deprecated)
320320
321-
:vartype supports_npn: boolean
322-
:ivar supports_npn: NPN extension presence (deprecated)
321+
:vartype ~.supports_npn: boolean
322+
:ivar ~.supports_npn: NPN extension presence (deprecated)
323323
324-
:vartype tack: boolean
325-
:ivar tack: TACK extension presence (deprecated)
324+
:vartype ~.tack: boolean
325+
:ivar ~.tack: TACK extension presence (deprecated)
326326
327-
:vartype server_name: bytearray
328-
:ivar server_name: first host_name (type 0) present in SNI extension
327+
:vartype ~.server_name: bytearray
328+
:ivar ~.server_name: first host_name (type 0) present in SNI extension
329329
(deprecated)
330330
331331
:vartype extensions: list of :py:class:`TLSExtension`
@@ -1620,8 +1620,8 @@ class ClientKeyExchange(HandshakeMsg):
16201620
16211621
:vartype cipherSuite: int
16221622
:ivar cipherSuite: the cipher suite id used for the connection
1623-
:vartype version: tuple(int, int)
1624-
:ivar version: TLS protocol version used for the connection
1623+
:vartype ~.version: tuple(int, int)
1624+
:ivar ~.version: TLS protocol version used for the connection
16251625
:vartype srp_A: int
16261626
:ivar srp_A: SRP protocol client answer value
16271627
:vartype dh_Yc: int
@@ -2056,7 +2056,7 @@ class SessionTicketPayload(object):
20562056
This is the internal (meant to be encrypted) representation of server
20572057
state that is set to client in the NewSessionTicket message.
20582058
2059-
:ivar int version: implementation detail for forward compatibility
2059+
:ivar int ~.version: implementation detail for forward compatibility
20602060
:ivar bytearray master_secret: master secret for TLS 1.2-, resumption
20612061
master secret for TLS 1.3
20622062
@@ -2268,14 +2268,14 @@ class Heartbeat(object):
22682268
"""
22692269
Handling Heartbeat messages from RFC 6520
22702270
2271-
@type message_type: int
2272-
@ivar message_type: type of message (response or request)
2271+
:type message_type: int
2272+
:ivar message_type: type of message (response or request)
22732273
2274-
@type payload: bytearray
2275-
@ivar payload: payload
2274+
:type payload: bytearray
2275+
:ivar payload: payload
22762276
2277-
@type padding: bytearray
2278-
@ivar padding: random padding of selected length
2277+
:type padding: bytearray
2278+
:ivar padding: random padding of selected length
22792279
"""
22802280

22812281
def __init__(self):
@@ -2335,8 +2335,8 @@ class KeyUpdate(HandshakeMsg):
23352335
"""
23362336
Handling KeyUpdate message from RFC 8446
23372337
2338-
@type message_type: int
2339-
@ivar message_type: type of message (update_not_requested or
2338+
:vartype message_type: int
2339+
:ivar message_type: type of message (update_not_requested or
23402340
update_requested)
23412341
"""
23422342

0 commit comments

Comments
 (0)