| 161 | return self.m.get(prompt) |
| 162 | |
| 163 | class DialogHandler: |
| 164 | def __init__(self, con): |
| 165 | self.con = con |
| 166 | |
| 167 | def authenticate(self, pkt): |
| 168 | while True: |
| 169 | flag = pkt.read_uint8() |
| 170 | # echo = (flag & 0x06) == 0x02 |
| 171 | last = (flag & 0x01) == 0x01 |
| 172 | prompt = pkt.read_all() |
| 173 | |
| 174 | if prompt == b"Password, please:": |
| 175 | self.con.write_packet(b"stillnotverysecret\0") |
| 176 | else: |
| 177 | self.con.write_packet(b"no idea what to do with this prompt\0") |
| 178 | pkt = self.con._read_packet() |
| 179 | pkt.check_error() |
| 180 | if pkt.is_ok_packet() or last: |
| 181 | break |
| 182 | return pkt |
| 183 | |
| 184 | class DefectiveHandler: |
| 185 | def __init__(self, con): |
nothing calls this directly
no outgoing calls
no test coverage detected