Selecting a cipher suite should be no trouble as we already caught the None case previously.
(self)
| 365 | |
| 366 | @ATMT.condition(PREPARE_SERVERFLIGHT1) |
| 367 | def should_add_ServerHello(self): |
| 368 | """ |
| 369 | Selecting a cipher suite should be no trouble as we already caught |
| 370 | the None case previously. |
| 371 | """ |
| 372 | if isinstance(self.mykey, PrivKeyRSA): |
| 373 | kx = "RSA" |
| 374 | elif isinstance(self.mykey, PrivKeyECDSA): |
| 375 | kx = "ECDSA" |
| 376 | elif isinstance(self.mykey, PrivKeyEdDSA): |
| 377 | kx = "" |
| 378 | usable_suites = get_usable_ciphersuites(self.cur_pkt.ciphers, kx) |
| 379 | c = usable_suites[0] |
| 380 | if self.preferred_ciphersuite in usable_suites: |
| 381 | c = self.preferred_ciphersuite |
| 382 | |
| 383 | # Some extensions |
| 384 | ext = [TLS_Ext_RenegotiationInfo()] |
| 385 | |
| 386 | self.add_msg(TLSServerHello(cipher=c, ext=ext)) |
| 387 | raise self.ADDED_SERVERHELLO() |
| 388 | |
| 389 | @ATMT.state() |
| 390 | def ADDED_SERVERHELLO(self): |
nothing calls this directly
no test coverage detected