| OLD | NEW |
| 1 # Authors: | 1 # Authors: |
| 2 # Trevor Perrin | 2 # Trevor Perrin |
| 3 # Google - added reqCAs parameter | 3 # Google - added reqCAs parameter |
| 4 # Google (adapted by Sam Rushing and Marcelo Fernandez) - NPN support | 4 # Google (adapted by Sam Rushing and Marcelo Fernandez) - NPN support |
| 5 # Dimitris Moraitis - Anon ciphersuites | 5 # Dimitris Moraitis - Anon ciphersuites |
| 6 # Martin von Loewis - python 3 port | 6 # Martin von Loewis - python 3 port |
| 7 # | 7 # |
| 8 # See the LICENSE file for legal information regarding use of this file. | 8 # See the LICENSE file for legal information regarding use of this file. |
| 9 | 9 |
| 10 """ | 10 """ |
| (...skipping 1410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1421 else: | 1421 else: |
| 1422 raise ValueError("Unknown intolerance type: '%s'" % | 1422 raise ValueError("Unknown intolerance type: '%s'" % |
| 1423 settings.tlsIntoleranceType) | 1423 settings.tlsIntoleranceType) |
| 1424 | 1424 |
| 1425 #If client's version is too high, propose my highest version | 1425 #If client's version is too high, propose my highest version |
| 1426 elif clientHello.client_version > settings.maxVersion: | 1426 elif clientHello.client_version > settings.maxVersion: |
| 1427 self.version = settings.maxVersion | 1427 self.version = settings.maxVersion |
| 1428 | 1428 |
| 1429 #Detect if the client performed an inappropriate fallback. | 1429 #Detect if the client performed an inappropriate fallback. |
| 1430 elif fallbackSCSV and clientHello.client_version < settings.maxVersion: | 1430 elif fallbackSCSV and clientHello.client_version < settings.maxVersion: |
| 1431 self.version = clientHello.client_version |
| 1431 if CipherSuite.TLS_FALLBACK_SCSV in clientHello.cipher_suites: | 1432 if CipherSuite.TLS_FALLBACK_SCSV in clientHello.cipher_suites: |
| 1432 for result in self._sendError(\ | 1433 for result in self._sendError(\ |
| 1433 AlertDescription.inappropriate_fallback): | 1434 AlertDescription.inappropriate_fallback): |
| 1434 yield result | 1435 yield result |
| 1435 | 1436 |
| 1436 else: | 1437 else: |
| 1437 #Set the version to the client's version | 1438 #Set the version to the client's version |
| 1438 self.version = clientHello.client_version | 1439 self.version = clientHello.client_version |
| 1439 | 1440 |
| 1440 #If resumption was requested and we have a session cache... | 1441 #If resumption was requested and we have a session cache... |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1928 except TLSAlert as alert: | 1929 except TLSAlert as alert: |
| 1929 if not self.fault: | 1930 if not self.fault: |
| 1930 raise | 1931 raise |
| 1931 if alert.description not in Fault.faultAlerts[self.fault]: | 1932 if alert.description not in Fault.faultAlerts[self.fault]: |
| 1932 raise TLSFaultError(str(alert)) | 1933 raise TLSFaultError(str(alert)) |
| 1933 else: | 1934 else: |
| 1934 pass | 1935 pass |
| 1935 except: | 1936 except: |
| 1936 self._shutdown(False) | 1937 self._shutdown(False) |
| 1937 raise | 1938 raise |
| OLD | NEW |