Internal class to represent unencrypted ESP packets.
| 176 | |
| 177 | |
| 178 | class _ESPPlain(Packet): |
| 179 | """ |
| 180 | Internal class to represent unencrypted ESP packets. |
| 181 | """ |
| 182 | name = 'ESP' |
| 183 | |
| 184 | fields_desc = [ |
| 185 | XIntField('spi', 0x0), |
| 186 | IntField('seq', 0), |
| 187 | |
| 188 | StrField('iv', ''), |
| 189 | PacketField('data', '', Raw), |
| 190 | StrField('padding', ''), |
| 191 | |
| 192 | ByteField('padlen', 0), |
| 193 | ByteEnumField('nh', 0, IP_PROTOS), |
| 194 | StrField('icv', ''), |
| 195 | ] |
| 196 | |
| 197 | def data_for_encryption(self): |
| 198 | return raw(self.data) + self.padding + struct.pack("BB", self.padlen, self.nh) # noqa: E501 |
| 199 | |
| 200 | |
| 201 | ############################################################################### |
no test coverage detected
searching dependent graphs…