tlslite.handshakehashes module

Handling cryptographic hashes for handshake protocol

class tlslite.handshakehashes.HandshakeHashes[source]

Bases: object

Store and calculate necessary hashes for handshake protocol

Calculates message digests of messages exchanged in handshake protocol of SSLv3 and TLS.

__init__()[source]

Create instance

copy()[source]

Copy object

Return a copy of the object with all the hashes in the same state as the source object.

Return type:

HandshakeHashes

digest(digest=None)[source]

Calculate and return digest for the already consumed data.

Used for Finished and CertificateVerify messages.

Parameters:

digest (str) – name of digest to return

digestSSL(masterSecret, label)[source]

Calculate and return digest for already consumed data (SSLv3 version)

Used for Finished and CertificateVerify messages.

Parameters:
  • masterSecret (bytearray) – value of the master secret

  • label (bytearray) – label to include in the calculation

update(data)[source]

Add data to hash input.

Parameters:

data (bytearray) – serialized TLS handshake message