Package tlslite :: Module mathtls
[hide private]
[frames] | no frames]

Module mathtls

source code

Miscellaneous helper functions.

Classes [hide private]
  MAC_SSL
Functions [hide private]
 
PAD(n, x) source code
 
PRF(secret, label, seed, length) source code
 
PRF_1_2(secret, label, seed, length)
Pseudo Random Function for TLS1.2 ciphers that use SHA256
source code
 
PRF_1_2_SHA384(secret, label, seed, length)
Pseudo Random Function for TLS1.2 ciphers that use SHA384
source code
 
PRF_SSL(secret, seed, length) source code
 
P_hash(macFunc, secret, seed, length) source code
 
calcExtendedMasterSecret(version, cipherSuite, premasterSecret, handshakeHashes)
Derive Extended Master Secret from premaster and handshake msgs
source code
 
calcFinished(version, masterSecret, cipherSuite, handshakeHashes, isClient)
Calculate the Handshake protocol Finished value
source code
 
calcMasterSecret(version, cipherSuite, premasterSecret, clientRandom, serverRandom)
Derive Master Secret from premaster secret and random values
source code
 
createHMAC(k, digestmod=<built-in function openssl_sha1>) source code
 
createMAC_SSL(k, digestmod=None) source code
 
makeK(N, g) source code
 
makeU(N, A, B) source code
 
makeVerifier(username, password, bits) source code
 
makeX(salt, username, password) source code
Variables [hide private]
  __package__ = 'tlslite'
  ecdsaAllCurves = True
  fipsFile = <closed file '/proc/sys/crypto/fips_enabled', mode ...
  gmpyLoaded = False
  goodGroupParameters = [(2, 16760943441033506134513952376435009...
  m2cryptoLoaded = True
  prngName = 'os.urandom'
  pycryptoLoaded = True
Function Details [hide private]

calcFinished(version, masterSecret, cipherSuite, handshakeHashes, isClient)

source code 

Calculate the Handshake protocol Finished value

Parameters:
  • version - TLS protocol version tuple
  • masterSecret - negotiated master secret of the connection
  • cipherSuite - negotiated cipher suite of the connection,
  • handshakeHashes - running hash of the handshake messages
  • isClient - whether the calculation should be performed for message sent by client (True) or by server (False) side of connection

Variables Details [hide private]

fipsFile

Value:
<closed file '/proc/sys/crypto/fips_enabled', mode 'r' at 0x7f639b80d5\
d0>

goodGroupParameters

Value:
[(2,
  16760943441033506134513952376435009026013552532981390455742093030980\
0865859473551531551523800013916573891864789934747039010546328480848979\
5166376737766056103746694262147761978284926913845194532182537027880222\
3320568363583162691335715494191412998548952262990254076836840948224829\
0641036967659389658897350067939),
 (2,
  14869981859231282928165073536194095211524576625963800746148189668102\
...