Skip to content

Commit

Permalink
Merge branch 'fix-srp-rsa'
Browse files Browse the repository at this point in the history
  • Loading branch information
tomato42 committed Nov 5, 2015
2 parents 5133390 + c5a57a9 commit 58d6da9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tlslite/tlsconnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,8 @@ def _clientSRPKeyExchange(self, settings, cipherSuite, certificateType,
if cipherSuite in CipherSuite.srpCertSuites:
#Hash ServerKeyExchange/ServerSRPParams
hashBytes = serverKeyExchange.hash(clientRandom, serverRandom)
if self.version == (3, 3):
hashBytes = RSAKey.addPKCS1SHA1Prefix(hashBytes)

#Extract signature bytes from ServerKeyExchange
sigBytes = serverKeyExchange.signature
Expand Down Expand Up @@ -1730,6 +1732,8 @@ def _serverSRPKeyExchange(self, clientHello, serverHello, verifierDB,
if cipherSuite in CipherSuite.srpCertSuites:
hashBytes = serverKeyExchange.hash(clientHello.random,
serverHello.random)
if self.version == (3, 3):
hashBytes = RSAKey.addPKCS1SHA1Prefix(hashBytes)
serverKeyExchange.signature = privateKey.sign(hashBytes)
if self.version == (3, 3):
# TODO signing algorithm not negotiatied
Expand Down

0 comments on commit 58d6da9

Please sign in to comment.