OLD | NEW |
1 # Authors: | 1 # Authors: |
2 # Trevor Perrin | 2 # Trevor Perrin |
3 # Dave Baggett (Arcode Corporation) - cleanup handling of constants | 3 # Dave Baggett (Arcode Corporation) - cleanup handling of constants |
4 # Yngve Pettersen (ported by Paul Sokolovsky) - TLS 1.2 | 4 # Yngve Pettersen (ported by Paul Sokolovsky) - TLS 1.2 |
5 # | 5 # |
6 # See the LICENSE file for legal information regarding use of this file. | 6 # See the LICENSE file for legal information regarding use of this file. |
7 | 7 |
8 """Class for setting handshake parameters.""" | 8 """Class for setting handshake parameters.""" |
9 | 9 |
10 from .constants import CertificateType | 10 from .constants import CertificateType |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 other.cipherNames = self.cipherNames | 144 other.cipherNames = self.cipherNames |
145 other.macNames = self.macNames | 145 other.macNames = self.macNames |
146 other.keyExchangeNames = self.keyExchangeNames | 146 other.keyExchangeNames = self.keyExchangeNames |
147 other.cipherImplementations = self.cipherImplementations | 147 other.cipherImplementations = self.cipherImplementations |
148 other.certificateTypes = self.certificateTypes | 148 other.certificateTypes = self.certificateTypes |
149 other.minVersion = self.minVersion | 149 other.minVersion = self.minVersion |
150 other.maxVersion = self.maxVersion | 150 other.maxVersion = self.maxVersion |
151 other.tlsIntolerant = self.tlsIntolerant | 151 other.tlsIntolerant = self.tlsIntolerant |
152 other.tlsIntoleranceType = self.tlsIntoleranceType | 152 other.tlsIntoleranceType = self.tlsIntoleranceType |
153 other.alertAfterHandshake = self.alertAfterHandshake | 153 other.alertAfterHandshake = self.alertAfterHandshake |
| 154 other.enableExtendedMasterSecret = self.enableExtendedMasterSecret |
154 | 155 |
155 if not cipherfactory.tripleDESPresent: | 156 if not cipherfactory.tripleDESPresent: |
156 other.cipherNames = [e for e in self.cipherNames if e != "3des"] | 157 other.cipherNames = [e for e in self.cipherNames if e != "3des"] |
157 if len(other.cipherNames)==0: | 158 if len(other.cipherNames)==0: |
158 raise ValueError("No supported ciphers") | 159 raise ValueError("No supported ciphers") |
159 if len(other.certificateTypes)==0: | 160 if len(other.certificateTypes)==0: |
160 raise ValueError("No supported certificate types") | 161 raise ValueError("No supported certificate types") |
161 | 162 |
162 if not cryptomath.m2cryptoLoaded: | 163 if not cryptomath.m2cryptoLoaded: |
163 other.cipherImplementations = \ | 164 other.cipherImplementations = \ |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 return other | 209 return other |
209 | 210 |
210 def _getCertificateTypes(self): | 211 def _getCertificateTypes(self): |
211 l = [] | 212 l = [] |
212 for ct in self.certificateTypes: | 213 for ct in self.certificateTypes: |
213 if ct == "x509": | 214 if ct == "x509": |
214 l.append(CertificateType.x509) | 215 l.append(CertificateType.x509) |
215 else: | 216 else: |
216 raise AssertionError() | 217 raise AssertionError() |
217 return l | 218 return l |
OLD | NEW |