“mystarrocks” | 23f0c45 | 2017-12-11 07:11:51 -0800 | [diff] [blame] | 1 | import socket |
Klement Sekera | 28fb03f | 2018-04-17 11:36:55 +0200 | [diff] [blame] | 2 | import unittest |
Klement Sekera | 31da2e3 | 2018-06-24 22:49:55 +0200 | [diff] [blame] | 3 | from scapy.layers.ipsec import ESP |
Neale Ranns | 53f526b | 2019-02-25 14:32:02 +0000 | [diff] [blame] | 4 | from scapy.layers.inet import UDP |
“mystarrocks” | 23f0c45 | 2017-12-11 07:11:51 -0800 | [diff] [blame] | 5 | |
Neale Ranns | 00625a6 | 2019-07-31 00:13:18 -0700 | [diff] [blame] | 6 | from parameterized import parameterized |
juraj.linkes | 1105766 | 2019-07-08 10:22:55 +0200 | [diff] [blame] | 7 | from framework import VppTestRunner |
Neale Ranns | 53f526b | 2019-02-25 14:32:02 +0000 | [diff] [blame] | 8 | from template_ipsec import IpsecTra46Tests, IpsecTun46Tests, TemplateIpsec, \ |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 9 | IpsecTcpTests, IpsecTun4Tests, IpsecTra4Tests, config_tra_params, \ |
Neale Ranns | 12989b5 | 2019-09-26 16:20:19 +0000 | [diff] [blame] | 10 | config_tun_params, IPsecIPv4Params, IPsecIPv6Params, \ |
Neale Ranns | 4a56f4e | 2019-12-23 04:10:25 +0000 | [diff] [blame] | 11 | IpsecTra4, IpsecTun4, IpsecTra6, IpsecTun6, \ |
Neale Ranns | 0295040 | 2019-12-20 00:54:57 +0000 | [diff] [blame] | 12 | IpsecTun6HandoffTests, IpsecTun4HandoffTests, \ |
Filip Tehlar | efcad1a | 2020-02-04 09:36:04 +0000 | [diff] [blame^] | 13 | IpsecTra6ExtTests |
Klement Sekera | bf61395 | 2019-01-29 11:38:08 +0100 | [diff] [blame] | 14 | from vpp_ipsec import VppIpsecSpd, VppIpsecSpdEntry, VppIpsecSA,\ |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 15 | VppIpsecSpdItfBinding |
Neale Ranns | 311124e | 2019-01-24 04:52:25 -0800 | [diff] [blame] | 16 | from vpp_ip_route import VppIpRoute, VppRoutePath |
| 17 | from vpp_ip import DpoProto |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 18 | from vpp_papi import VppEnum |
“mystarrocks” | 23f0c45 | 2017-12-11 07:11:51 -0800 | [diff] [blame] | 19 | |
Neale Ranns | c87b66c | 2019-02-07 07:26:12 -0800 | [diff] [blame] | 20 | NUM_PKTS = 67 |
Filip Tehlar | efcad1a | 2020-02-04 09:36:04 +0000 | [diff] [blame^] | 21 | engines_supporting_chain_bufs = ["openssl"] |
Neale Ranns | c87b66c | 2019-02-07 07:26:12 -0800 | [diff] [blame] | 22 | |
“mystarrocks” | 23f0c45 | 2017-12-11 07:11:51 -0800 | [diff] [blame] | 23 | |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 24 | class ConfigIpsecESP(TemplateIpsec): |
| 25 | encryption_type = ESP |
| 26 | tra4_encrypt_node_name = "esp4-encrypt" |
| 27 | tra4_decrypt_node_name = "esp4-decrypt" |
| 28 | tra6_encrypt_node_name = "esp6-encrypt" |
| 29 | tra6_decrypt_node_name = "esp6-decrypt" |
| 30 | tun4_encrypt_node_name = "esp4-encrypt" |
| 31 | tun4_decrypt_node_name = "esp4-decrypt" |
| 32 | tun6_encrypt_node_name = "esp6-encrypt" |
| 33 | tun6_decrypt_node_name = "esp6-decrypt" |
Neale Ranns | 53f526b | 2019-02-25 14:32:02 +0000 | [diff] [blame] | 34 | |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 35 | @classmethod |
| 36 | def setUpClass(cls): |
| 37 | super(ConfigIpsecESP, cls).setUpClass() |
Neale Ranns | 53f526b | 2019-02-25 14:32:02 +0000 | [diff] [blame] | 38 | |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 39 | @classmethod |
| 40 | def tearDownClass(cls): |
| 41 | super(ConfigIpsecESP, cls).tearDownClass() |
Neale Ranns | 53f526b | 2019-02-25 14:32:02 +0000 | [diff] [blame] | 42 | |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 43 | def setUp(self): |
| 44 | super(ConfigIpsecESP, self).setUp() |
Neale Ranns | 53f526b | 2019-02-25 14:32:02 +0000 | [diff] [blame] | 45 | |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 46 | def tearDown(self): |
| 47 | super(ConfigIpsecESP, self).tearDown() |
| 48 | |
| 49 | def config_network(self, params): |
| 50 | self.net_objs = [] |
| 51 | self.tun_if = self.pg0 |
| 52 | self.tra_if = self.pg2 |
| 53 | self.logger.info(self.vapi.ppcli("show int addr")) |
| 54 | |
| 55 | self.tra_spd = VppIpsecSpd(self, self.tra_spd_id) |
| 56 | self.tra_spd.add_vpp_config() |
| 57 | self.net_objs.append(self.tra_spd) |
| 58 | self.tun_spd = VppIpsecSpd(self, self.tun_spd_id) |
| 59 | self.tun_spd.add_vpp_config() |
| 60 | self.net_objs.append(self.tun_spd) |
| 61 | |
| 62 | b = VppIpsecSpdItfBinding(self, self.tun_spd, |
| 63 | self.tun_if) |
| 64 | b.add_vpp_config() |
| 65 | self.net_objs.append(b) |
| 66 | |
| 67 | b = VppIpsecSpdItfBinding(self, self.tra_spd, |
| 68 | self.tra_if) |
| 69 | b.add_vpp_config() |
| 70 | self.net_objs.append(b) |
| 71 | |
| 72 | for p in params: |
| 73 | self.config_esp_tra(p) |
| 74 | config_tra_params(p, self.encryption_type) |
| 75 | for p in params: |
| 76 | self.config_esp_tun(p) |
Neale Ranns | 12989b5 | 2019-09-26 16:20:19 +0000 | [diff] [blame] | 77 | config_tun_params(p, self.encryption_type, self.tun_if) |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 78 | |
| 79 | for p in params: |
| 80 | d = DpoProto.DPO_PROTO_IP6 if p.is_ipv6 else DpoProto.DPO_PROTO_IP4 |
| 81 | r = VppIpRoute(self, p.remote_tun_if_host, p.addr_len, |
| 82 | [VppRoutePath(self.tun_if.remote_addr[p.addr_type], |
| 83 | 0xffffffff, |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 84 | proto=d)]) |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 85 | r.add_vpp_config() |
| 86 | self.net_objs.append(r) |
| 87 | |
| 88 | self.logger.info(self.vapi.ppcli("show ipsec all")) |
| 89 | |
| 90 | def unconfig_network(self): |
| 91 | for o in reversed(self.net_objs): |
| 92 | o.remove_vpp_config() |
| 93 | self.net_objs = [] |
| 94 | |
| 95 | def config_esp_tun(self, params): |
| 96 | addr_type = params.addr_type |
| 97 | scapy_tun_sa_id = params.scapy_tun_sa_id |
| 98 | scapy_tun_spi = params.scapy_tun_spi |
| 99 | vpp_tun_sa_id = params.vpp_tun_sa_id |
| 100 | vpp_tun_spi = params.vpp_tun_spi |
| 101 | auth_algo_vpp_id = params.auth_algo_vpp_id |
| 102 | auth_key = params.auth_key |
| 103 | crypt_algo_vpp_id = params.crypt_algo_vpp_id |
| 104 | crypt_key = params.crypt_key |
| 105 | remote_tun_if_host = params.remote_tun_if_host |
| 106 | addr_any = params.addr_any |
| 107 | addr_bcast = params.addr_bcast |
| 108 | e = VppEnum.vl_api_ipsec_spd_action_t |
Neale Ranns | 49e7ef6 | 2019-04-10 17:24:29 +0000 | [diff] [blame] | 109 | flags = params.flags |
Neale Ranns | 80f6fd5 | 2019-04-16 02:41:34 +0000 | [diff] [blame] | 110 | salt = params.salt |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 111 | objs = [] |
| 112 | |
| 113 | params.tun_sa_in = VppIpsecSA(self, scapy_tun_sa_id, scapy_tun_spi, |
| 114 | auth_algo_vpp_id, auth_key, |
| 115 | crypt_algo_vpp_id, crypt_key, |
| 116 | self.vpp_esp_protocol, |
| 117 | self.tun_if.local_addr[addr_type], |
Neale Ranns | 49e7ef6 | 2019-04-10 17:24:29 +0000 | [diff] [blame] | 118 | self.tun_if.remote_addr[addr_type], |
Neale Ranns | 80f6fd5 | 2019-04-16 02:41:34 +0000 | [diff] [blame] | 119 | flags=flags, |
| 120 | salt=salt) |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 121 | params.tun_sa_out = VppIpsecSA(self, vpp_tun_sa_id, vpp_tun_spi, |
| 122 | auth_algo_vpp_id, auth_key, |
| 123 | crypt_algo_vpp_id, crypt_key, |
| 124 | self.vpp_esp_protocol, |
| 125 | self.tun_if.remote_addr[addr_type], |
Neale Ranns | 49e7ef6 | 2019-04-10 17:24:29 +0000 | [diff] [blame] | 126 | self.tun_if.local_addr[addr_type], |
Neale Ranns | 80f6fd5 | 2019-04-16 02:41:34 +0000 | [diff] [blame] | 127 | flags=flags, |
| 128 | salt=salt) |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 129 | objs.append(params.tun_sa_in) |
| 130 | objs.append(params.tun_sa_out) |
| 131 | |
| 132 | params.spd_policy_in_any = VppIpsecSpdEntry(self, self.tun_spd, |
| 133 | scapy_tun_sa_id, |
| 134 | addr_any, addr_bcast, |
| 135 | addr_any, addr_bcast, |
| 136 | socket.IPPROTO_ESP) |
| 137 | params.spd_policy_out_any = VppIpsecSpdEntry(self, self.tun_spd, |
| 138 | scapy_tun_sa_id, |
| 139 | addr_any, addr_bcast, |
| 140 | addr_any, addr_bcast, |
| 141 | socket.IPPROTO_ESP, |
| 142 | is_outbound=0) |
| 143 | objs.append(params.spd_policy_out_any) |
| 144 | objs.append(params.spd_policy_in_any) |
| 145 | |
| 146 | objs.append(VppIpsecSpdEntry(self, self.tun_spd, vpp_tun_sa_id, |
| 147 | remote_tun_if_host, remote_tun_if_host, |
| 148 | self.pg1.remote_addr[addr_type], |
| 149 | self.pg1.remote_addr[addr_type], |
| 150 | 0, |
| 151 | priority=10, |
| 152 | policy=e.IPSEC_API_SPD_ACTION_PROTECT, |
| 153 | is_outbound=0)) |
| 154 | objs.append(VppIpsecSpdEntry(self, self.tun_spd, scapy_tun_sa_id, |
| 155 | self.pg1.remote_addr[addr_type], |
| 156 | self.pg1.remote_addr[addr_type], |
| 157 | remote_tun_if_host, remote_tun_if_host, |
| 158 | 0, |
| 159 | policy=e.IPSEC_API_SPD_ACTION_PROTECT, |
| 160 | priority=10)) |
| 161 | objs.append(VppIpsecSpdEntry(self, self.tun_spd, vpp_tun_sa_id, |
| 162 | remote_tun_if_host, remote_tun_if_host, |
| 163 | self.pg0.local_addr[addr_type], |
| 164 | self.pg0.local_addr[addr_type], |
| 165 | 0, |
| 166 | priority=20, |
| 167 | policy=e.IPSEC_API_SPD_ACTION_PROTECT, |
| 168 | is_outbound=0)) |
| 169 | objs.append(VppIpsecSpdEntry(self, self.tun_spd, scapy_tun_sa_id, |
| 170 | self.pg0.local_addr[addr_type], |
| 171 | self.pg0.local_addr[addr_type], |
| 172 | remote_tun_if_host, remote_tun_if_host, |
| 173 | 0, |
| 174 | policy=e.IPSEC_API_SPD_ACTION_PROTECT, |
| 175 | priority=20)) |
| 176 | for o in objs: |
| 177 | o.add_vpp_config() |
| 178 | self.net_objs = self.net_objs + objs |
| 179 | |
| 180 | def config_esp_tra(self, params): |
| 181 | addr_type = params.addr_type |
| 182 | scapy_tra_sa_id = params.scapy_tra_sa_id |
| 183 | scapy_tra_spi = params.scapy_tra_spi |
| 184 | vpp_tra_sa_id = params.vpp_tra_sa_id |
| 185 | vpp_tra_spi = params.vpp_tra_spi |
| 186 | auth_algo_vpp_id = params.auth_algo_vpp_id |
| 187 | auth_key = params.auth_key |
| 188 | crypt_algo_vpp_id = params.crypt_algo_vpp_id |
| 189 | crypt_key = params.crypt_key |
| 190 | addr_any = params.addr_any |
| 191 | addr_bcast = params.addr_bcast |
| 192 | flags = (VppEnum.vl_api_ipsec_sad_flags_t. |
| 193 | IPSEC_API_SAD_FLAG_USE_ANTI_REPLAY) |
| 194 | e = VppEnum.vl_api_ipsec_spd_action_t |
| 195 | flags = params.flags | flags |
Neale Ranns | 80f6fd5 | 2019-04-16 02:41:34 +0000 | [diff] [blame] | 196 | salt = params.salt |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 197 | objs = [] |
| 198 | |
| 199 | params.tra_sa_in = VppIpsecSA(self, scapy_tra_sa_id, scapy_tra_spi, |
| 200 | auth_algo_vpp_id, auth_key, |
| 201 | crypt_algo_vpp_id, crypt_key, |
| 202 | self.vpp_esp_protocol, |
Neale Ranns | 80f6fd5 | 2019-04-16 02:41:34 +0000 | [diff] [blame] | 203 | flags=flags, |
| 204 | salt=salt) |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 205 | params.tra_sa_out = VppIpsecSA(self, vpp_tra_sa_id, vpp_tra_spi, |
| 206 | auth_algo_vpp_id, auth_key, |
| 207 | crypt_algo_vpp_id, crypt_key, |
| 208 | self.vpp_esp_protocol, |
Neale Ranns | 80f6fd5 | 2019-04-16 02:41:34 +0000 | [diff] [blame] | 209 | flags=flags, |
| 210 | salt=salt) |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 211 | objs.append(params.tra_sa_in) |
| 212 | objs.append(params.tra_sa_out) |
| 213 | |
| 214 | objs.append(VppIpsecSpdEntry(self, self.tra_spd, vpp_tra_sa_id, |
| 215 | addr_any, addr_bcast, |
| 216 | addr_any, addr_bcast, |
| 217 | socket.IPPROTO_ESP)) |
| 218 | objs.append(VppIpsecSpdEntry(self, self.tra_spd, vpp_tra_sa_id, |
| 219 | addr_any, addr_bcast, |
| 220 | addr_any, addr_bcast, |
| 221 | socket.IPPROTO_ESP, |
| 222 | is_outbound=0)) |
| 223 | objs.append(VppIpsecSpdEntry(self, self.tra_spd, vpp_tra_sa_id, |
| 224 | self.tra_if.local_addr[addr_type], |
| 225 | self.tra_if.local_addr[addr_type], |
| 226 | self.tra_if.remote_addr[addr_type], |
| 227 | self.tra_if.remote_addr[addr_type], |
| 228 | 0, priority=10, |
| 229 | policy=e.IPSEC_API_SPD_ACTION_PROTECT, |
| 230 | is_outbound=0)) |
| 231 | objs.append(VppIpsecSpdEntry(self, self.tra_spd, scapy_tra_sa_id, |
| 232 | self.tra_if.local_addr[addr_type], |
| 233 | self.tra_if.local_addr[addr_type], |
| 234 | self.tra_if.remote_addr[addr_type], |
| 235 | self.tra_if.remote_addr[addr_type], |
| 236 | 0, policy=e.IPSEC_API_SPD_ACTION_PROTECT, |
| 237 | priority=10)) |
| 238 | for o in objs: |
| 239 | o.add_vpp_config() |
| 240 | self.net_objs = self.net_objs + objs |
Neale Ranns | 53f526b | 2019-02-25 14:32:02 +0000 | [diff] [blame] | 241 | |
| 242 | |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 243 | class TemplateIpsecEsp(ConfigIpsecESP): |
“mystarrocks” | 23f0c45 | 2017-12-11 07:11:51 -0800 | [diff] [blame] | 244 | """ |
| 245 | Basic test for ipsec esp sanity - tunnel and transport modes. |
| 246 | |
| 247 | Below 4 cases are covered as part of this test |
| 248 | 1) ipsec esp v4 transport basic test - IPv4 Transport mode |
Paul Vinciguerra | 8feeaff | 2019-03-27 11:25:48 -0700 | [diff] [blame] | 249 | scenario using HMAC-SHA1-96 integrity algo |
“mystarrocks” | 23f0c45 | 2017-12-11 07:11:51 -0800 | [diff] [blame] | 250 | 2) ipsec esp v4 transport burst test |
| 251 | Above test for 257 pkts |
| 252 | 3) ipsec esp 4o4 tunnel basic test - IPv4 Tunnel mode |
Paul Vinciguerra | 8feeaff | 2019-03-27 11:25:48 -0700 | [diff] [blame] | 253 | scenario using HMAC-SHA1-96 integrity algo |
“mystarrocks” | 23f0c45 | 2017-12-11 07:11:51 -0800 | [diff] [blame] | 254 | 4) ipsec esp 4o4 tunnel burst test |
| 255 | Above test for 257 pkts |
| 256 | |
| 257 | TRANSPORT MODE: |
| 258 | |
| 259 | --- encrypt --- |
| 260 | |pg2| <-------> |VPP| |
| 261 | --- decrypt --- |
| 262 | |
| 263 | TUNNEL MODE: |
| 264 | |
| 265 | --- encrypt --- plain --- |
Klement Sekera | 4b089f2 | 2018-04-17 18:04:57 +0200 | [diff] [blame] | 266 | |pg0| <------- |VPP| <------ |pg1| |
“mystarrocks” | 23f0c45 | 2017-12-11 07:11:51 -0800 | [diff] [blame] | 267 | --- --- --- |
| 268 | |
| 269 | --- decrypt --- plain --- |
Klement Sekera | 4b089f2 | 2018-04-17 18:04:57 +0200 | [diff] [blame] | 270 | |pg0| -------> |VPP| ------> |pg1| |
“mystarrocks” | 23f0c45 | 2017-12-11 07:11:51 -0800 | [diff] [blame] | 271 | --- --- --- |
“mystarrocks” | 23f0c45 | 2017-12-11 07:11:51 -0800 | [diff] [blame] | 272 | """ |
| 273 | |
Paul Vinciguerra | 7f9b7f9 | 2019-03-12 19:23:27 -0700 | [diff] [blame] | 274 | @classmethod |
| 275 | def setUpClass(cls): |
| 276 | super(TemplateIpsecEsp, cls).setUpClass() |
| 277 | |
| 278 | @classmethod |
| 279 | def tearDownClass(cls): |
| 280 | super(TemplateIpsecEsp, cls).tearDownClass() |
| 281 | |
Neale Ranns | 8e4a89b | 2019-01-23 08:16:17 -0800 | [diff] [blame] | 282 | def setUp(self): |
| 283 | super(TemplateIpsecEsp, self).setUp() |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 284 | self.config_network(self.params.values()) |
Klement Sekera | 611864f | 2018-09-26 11:19:00 +0200 | [diff] [blame] | 285 | |
Neale Ranns | 8e4a89b | 2019-01-23 08:16:17 -0800 | [diff] [blame] | 286 | def tearDown(self): |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 287 | self.unconfig_network() |
Neale Ranns | 8e4a89b | 2019-01-23 08:16:17 -0800 | [diff] [blame] | 288 | super(TemplateIpsecEsp, self).tearDown() |
Neale Ranns | 8e4a89b | 2019-01-23 08:16:17 -0800 | [diff] [blame] | 289 | |
Klement Sekera | 611864f | 2018-09-26 11:19:00 +0200 | [diff] [blame] | 290 | |
Neale Ranns | 0295040 | 2019-12-20 00:54:57 +0000 | [diff] [blame] | 291 | class TestIpsecEsp1(TemplateIpsecEsp, IpsecTra46Tests, |
Filip Tehlar | efcad1a | 2020-02-04 09:36:04 +0000 | [diff] [blame^] | 292 | IpsecTun46Tests, IpsecTra6ExtTests): |
Klement Sekera | 31da2e3 | 2018-06-24 22:49:55 +0200 | [diff] [blame] | 293 | """ Ipsec ESP - TUN & TRA tests """ |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 294 | pass |
“mystarrocks” | 23f0c45 | 2017-12-11 07:11:51 -0800 | [diff] [blame] | 295 | |
“mystarrocks” | 23f0c45 | 2017-12-11 07:11:51 -0800 | [diff] [blame] | 296 | |
Klement Sekera | 31da2e3 | 2018-06-24 22:49:55 +0200 | [diff] [blame] | 297 | class TestIpsecEsp2(TemplateIpsecEsp, IpsecTcpTests): |
| 298 | """ Ipsec ESP - TCP tests """ |
| 299 | pass |
“mystarrocks” | 23f0c45 | 2017-12-11 07:11:51 -0800 | [diff] [blame] | 300 | |
| 301 | |
Neale Ranns | 4a56f4e | 2019-12-23 04:10:25 +0000 | [diff] [blame] | 302 | class TestIpsecEspHandoff(TemplateIpsecEsp, |
| 303 | IpsecTun6HandoffTests, |
| 304 | IpsecTun4HandoffTests): |
| 305 | """ Ipsec ESP - handoff tests """ |
| 306 | pass |
| 307 | |
| 308 | |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 309 | class TemplateIpsecEspUdp(ConfigIpsecESP): |
Neale Ranns | 53f526b | 2019-02-25 14:32:02 +0000 | [diff] [blame] | 310 | """ |
| 311 | UDP encapped ESP |
| 312 | """ |
Paul Vinciguerra | 7f9b7f9 | 2019-03-12 19:23:27 -0700 | [diff] [blame] | 313 | |
| 314 | @classmethod |
| 315 | def setUpClass(cls): |
| 316 | super(TemplateIpsecEspUdp, cls).setUpClass() |
| 317 | |
| 318 | @classmethod |
| 319 | def tearDownClass(cls): |
| 320 | super(TemplateIpsecEspUdp, cls).tearDownClass() |
| 321 | |
Neale Ranns | 53f526b | 2019-02-25 14:32:02 +0000 | [diff] [blame] | 322 | def setUp(self): |
| 323 | super(TemplateIpsecEspUdp, self).setUp() |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 324 | self.net_objs = [] |
Neale Ranns | 53f526b | 2019-02-25 14:32:02 +0000 | [diff] [blame] | 325 | self.tun_if = self.pg0 |
| 326 | self.tra_if = self.pg2 |
| 327 | self.logger.info(self.vapi.ppcli("show int addr")) |
| 328 | |
| 329 | p = self.ipv4_params |
| 330 | p.flags = (VppEnum.vl_api_ipsec_sad_flags_t. |
| 331 | IPSEC_API_SAD_FLAG_UDP_ENCAP) |
| 332 | p.nat_header = UDP(sport=5454, dport=4500) |
| 333 | |
| 334 | self.tra_spd = VppIpsecSpd(self, self.tra_spd_id) |
| 335 | self.tra_spd.add_vpp_config() |
| 336 | VppIpsecSpdItfBinding(self, self.tra_spd, |
| 337 | self.tra_if).add_vpp_config() |
| 338 | |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 339 | self.config_esp_tra(p) |
Neale Ranns | 2ac885c | 2019-03-20 18:24:43 +0000 | [diff] [blame] | 340 | config_tra_params(p, self.encryption_type) |
Neale Ranns | 53f526b | 2019-02-25 14:32:02 +0000 | [diff] [blame] | 341 | |
| 342 | self.tun_spd = VppIpsecSpd(self, self.tun_spd_id) |
| 343 | self.tun_spd.add_vpp_config() |
| 344 | VppIpsecSpdItfBinding(self, self.tun_spd, |
| 345 | self.tun_if).add_vpp_config() |
| 346 | |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 347 | self.config_esp_tun(p) |
Neale Ranns | 92e9384 | 2019-04-08 07:36:50 +0000 | [diff] [blame] | 348 | self.logger.info(self.vapi.ppcli("show ipsec all")) |
Neale Ranns | 53f526b | 2019-02-25 14:32:02 +0000 | [diff] [blame] | 349 | |
| 350 | d = DpoProto.DPO_PROTO_IP4 |
| 351 | VppIpRoute(self, p.remote_tun_if_host, p.addr_len, |
| 352 | [VppRoutePath(self.tun_if.remote_addr[p.addr_type], |
| 353 | 0xffffffff, |
| 354 | proto=d)]).add_vpp_config() |
| 355 | |
| 356 | def tearDown(self): |
| 357 | super(TemplateIpsecEspUdp, self).tearDown() |
Paul Vinciguerra | 90cf21b | 2019-03-13 09:23:05 -0700 | [diff] [blame] | 358 | |
| 359 | def show_commands_at_teardown(self): |
| 360 | self.logger.info(self.vapi.cli("show hardware")) |
Neale Ranns | 53f526b | 2019-02-25 14:32:02 +0000 | [diff] [blame] | 361 | |
| 362 | |
Neale Ranns | 49e7ef6 | 2019-04-10 17:24:29 +0000 | [diff] [blame] | 363 | class TestIpsecEspUdp(TemplateIpsecEspUdp, IpsecTra4Tests): |
Neale Ranns | 53f526b | 2019-02-25 14:32:02 +0000 | [diff] [blame] | 364 | """ Ipsec NAT-T ESP UDP tests """ |
Neale Ranns | 53f526b | 2019-02-25 14:32:02 +0000 | [diff] [blame] | 365 | pass |
| 366 | |
| 367 | |
Andrew Yourtchenko | fbc3889 | 2019-09-09 11:14:59 +0000 | [diff] [blame] | 368 | class MyParameters(): |
| 369 | def __init__(self): |
| 370 | self.engines = ["ia32", "ipsecmb", "openssl"] |
| 371 | flag_esn = VppEnum.vl_api_ipsec_sad_flags_t.IPSEC_API_SAD_FLAG_USE_ESN |
| 372 | self.flags = [0, flag_esn] |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 373 | # foreach crypto algorithm |
Andrew Yourtchenko | fbc3889 | 2019-09-09 11:14:59 +0000 | [diff] [blame] | 374 | self.algos = { |
| 375 | 'AES-GCM-128/NONE': { |
| 376 | 'vpp-crypto': (VppEnum.vl_api_ipsec_crypto_alg_t. |
Neale Ranns | 47feb11 | 2019-04-11 15:14:07 +0000 | [diff] [blame] | 377 | IPSEC_API_CRYPTO_ALG_AES_GCM_128), |
| 378 | 'vpp-integ': (VppEnum.vl_api_ipsec_integ_alg_t. |
| 379 | IPSEC_API_INTEG_ALG_NONE), |
| 380 | 'scapy-crypto': "AES-GCM", |
| 381 | 'scapy-integ': "NULL", |
Ole Troan | 64e978b | 2019-10-17 21:40:36 +0200 | [diff] [blame] | 382 | 'key': b"JPjyOWBeVEQiMe7h", |
Neale Ranns | 80f6fd5 | 2019-04-16 02:41:34 +0000 | [diff] [blame] | 383 | 'salt': 0}, |
Andrew Yourtchenko | fbc3889 | 2019-09-09 11:14:59 +0000 | [diff] [blame] | 384 | 'AES-GCM-192/NONE': { |
| 385 | 'vpp-crypto': (VppEnum.vl_api_ipsec_crypto_alg_t. |
Neale Ranns | 80f6fd5 | 2019-04-16 02:41:34 +0000 | [diff] [blame] | 386 | IPSEC_API_CRYPTO_ALG_AES_GCM_192), |
| 387 | 'vpp-integ': (VppEnum.vl_api_ipsec_integ_alg_t. |
| 388 | IPSEC_API_INTEG_ALG_NONE), |
| 389 | 'scapy-crypto': "AES-GCM", |
| 390 | 'scapy-integ': "NULL", |
Ole Troan | 64e978b | 2019-10-17 21:40:36 +0200 | [diff] [blame] | 391 | 'key': b"JPjyOWBeVEQiMe7h01234567", |
Neale Ranns | 80f6fd5 | 2019-04-16 02:41:34 +0000 | [diff] [blame] | 392 | 'salt': 1010}, |
Andrew Yourtchenko | fbc3889 | 2019-09-09 11:14:59 +0000 | [diff] [blame] | 393 | 'AES-GCM-256/NONE': { |
| 394 | 'vpp-crypto': (VppEnum.vl_api_ipsec_crypto_alg_t. |
Neale Ranns | 47feb11 | 2019-04-11 15:14:07 +0000 | [diff] [blame] | 395 | IPSEC_API_CRYPTO_ALG_AES_GCM_256), |
| 396 | 'vpp-integ': (VppEnum.vl_api_ipsec_integ_alg_t. |
| 397 | IPSEC_API_INTEG_ALG_NONE), |
| 398 | 'scapy-crypto': "AES-GCM", |
| 399 | 'scapy-integ': "NULL", |
Ole Troan | 64e978b | 2019-10-17 21:40:36 +0200 | [diff] [blame] | 400 | 'key': b"JPjyOWBeVEQiMe7h0123456787654321", |
Neale Ranns | 80f6fd5 | 2019-04-16 02:41:34 +0000 | [diff] [blame] | 401 | 'salt': 2020}, |
Andrew Yourtchenko | fbc3889 | 2019-09-09 11:14:59 +0000 | [diff] [blame] | 402 | 'AES-CBC-128/MD5-96': { |
| 403 | 'vpp-crypto': (VppEnum.vl_api_ipsec_crypto_alg_t. |
Neale Ranns | 47feb11 | 2019-04-11 15:14:07 +0000 | [diff] [blame] | 404 | IPSEC_API_CRYPTO_ALG_AES_CBC_128), |
| 405 | 'vpp-integ': (VppEnum.vl_api_ipsec_integ_alg_t. |
Dmitry Vakhrushev | 77cc14a | 2019-08-14 00:12:33 -0400 | [diff] [blame] | 406 | IPSEC_API_INTEG_ALG_MD5_96), |
Neale Ranns | 47feb11 | 2019-04-11 15:14:07 +0000 | [diff] [blame] | 407 | 'scapy-crypto': "AES-CBC", |
Dmitry Vakhrushev | 77cc14a | 2019-08-14 00:12:33 -0400 | [diff] [blame] | 408 | 'scapy-integ': "HMAC-MD5-96", |
Neale Ranns | 80f6fd5 | 2019-04-16 02:41:34 +0000 | [diff] [blame] | 409 | 'salt': 0, |
Ole Troan | 64e978b | 2019-10-17 21:40:36 +0200 | [diff] [blame] | 410 | 'key': b"JPjyOWBeVEQiMe7h"}, |
Andrew Yourtchenko | fbc3889 | 2019-09-09 11:14:59 +0000 | [diff] [blame] | 411 | 'AES-CBC-192/SHA1-96': { |
| 412 | 'vpp-crypto': (VppEnum.vl_api_ipsec_crypto_alg_t. |
Neale Ranns | 47feb11 | 2019-04-11 15:14:07 +0000 | [diff] [blame] | 413 | IPSEC_API_CRYPTO_ALG_AES_CBC_192), |
| 414 | 'vpp-integ': (VppEnum.vl_api_ipsec_integ_alg_t. |
| 415 | IPSEC_API_INTEG_ALG_SHA1_96), |
| 416 | 'scapy-crypto': "AES-CBC", |
| 417 | 'scapy-integ': "HMAC-SHA1-96", |
Neale Ranns | 80f6fd5 | 2019-04-16 02:41:34 +0000 | [diff] [blame] | 418 | 'salt': 0, |
Ole Troan | 64e978b | 2019-10-17 21:40:36 +0200 | [diff] [blame] | 419 | 'key': b"JPjyOWBeVEQiMe7hJPjyOWBe"}, |
Andrew Yourtchenko | fbc3889 | 2019-09-09 11:14:59 +0000 | [diff] [blame] | 420 | 'AES-CBC-256/SHA1-96': { |
| 421 | 'vpp-crypto': (VppEnum.vl_api_ipsec_crypto_alg_t. |
Neale Ranns | 47feb11 | 2019-04-11 15:14:07 +0000 | [diff] [blame] | 422 | IPSEC_API_CRYPTO_ALG_AES_CBC_256), |
| 423 | 'vpp-integ': (VppEnum.vl_api_ipsec_integ_alg_t. |
| 424 | IPSEC_API_INTEG_ALG_SHA1_96), |
| 425 | 'scapy-crypto': "AES-CBC", |
| 426 | 'scapy-integ': "HMAC-SHA1-96", |
Neale Ranns | 80f6fd5 | 2019-04-16 02:41:34 +0000 | [diff] [blame] | 427 | 'salt': 0, |
Ole Troan | 64e978b | 2019-10-17 21:40:36 +0200 | [diff] [blame] | 428 | 'key': b"JPjyOWBeVEQiMe7hJPjyOWBeVEQiMe7h"}, |
Andrew Yourtchenko | fbc3889 | 2019-09-09 11:14:59 +0000 | [diff] [blame] | 429 | '3DES-CBC/SHA1-96': { |
| 430 | 'vpp-crypto': (VppEnum.vl_api_ipsec_crypto_alg_t. |
Vladimir Ratnikov | f480507 | 2019-05-17 09:17:59 -0400 | [diff] [blame] | 431 | IPSEC_API_CRYPTO_ALG_3DES_CBC), |
| 432 | 'vpp-integ': (VppEnum.vl_api_ipsec_integ_alg_t. |
| 433 | IPSEC_API_INTEG_ALG_SHA1_96), |
| 434 | 'scapy-crypto': "3DES", |
| 435 | 'scapy-integ': "HMAC-SHA1-96", |
| 436 | 'salt': 0, |
Ole Troan | 64e978b | 2019-10-17 21:40:36 +0200 | [diff] [blame] | 437 | 'key': b"JPjyOWBeVEQiMe7h00112233"}, |
Andrew Yourtchenko | fbc3889 | 2019-09-09 11:14:59 +0000 | [diff] [blame] | 438 | 'NONE/SHA1-96': { |
| 439 | 'vpp-crypto': (VppEnum.vl_api_ipsec_crypto_alg_t. |
Neale Ranns | 2cdcd0c | 2019-08-27 12:26:14 +0000 | [diff] [blame] | 440 | IPSEC_API_CRYPTO_ALG_NONE), |
| 441 | 'vpp-integ': (VppEnum.vl_api_ipsec_integ_alg_t. |
| 442 | IPSEC_API_INTEG_ALG_SHA1_96), |
| 443 | 'scapy-crypto': "NULL", |
| 444 | 'scapy-integ': "HMAC-SHA1-96", |
| 445 | 'salt': 0, |
Ole Troan | 64e978b | 2019-10-17 21:40:36 +0200 | [diff] [blame] | 446 | 'key': b"JPjyOWBeVEQiMe7h00112233"}} |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 447 | |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 448 | |
Andrew Yourtchenko | fbc3889 | 2019-09-09 11:14:59 +0000 | [diff] [blame] | 449 | class RunTestIpsecEspAll(ConfigIpsecESP, |
| 450 | IpsecTra4, IpsecTra6, |
| 451 | IpsecTun4, IpsecTun6): |
| 452 | """ Ipsec ESP all Algos """ |
| 453 | |
| 454 | def setUp(self): |
| 455 | super(RunTestIpsecEspAll, self).setUp() |
| 456 | test_args = str.split(self.__doc__, " ") |
| 457 | |
| 458 | params = MyParameters() |
| 459 | self.engine = test_args[0] |
| 460 | self.flag = params.flags[0] |
| 461 | if test_args[1] == 'ESN': |
| 462 | self.flag = params.flags[1] |
| 463 | |
| 464 | self.algo = params.algos[test_args[2]] |
| 465 | |
| 466 | def tearDown(self): |
| 467 | super(RunTestIpsecEspAll, self).tearDown() |
| 468 | |
| 469 | def run_test(self): |
| 470 | self.run_a_test(self.engine, self.flag, self.algo) |
| 471 | |
Filip Tehlar | efcad1a | 2020-02-04 09:36:04 +0000 | [diff] [blame^] | 472 | def run_a_test(self, engine, flag, algo, payload_size=None): |
Neale Ranns | 00625a6 | 2019-07-31 00:13:18 -0700 | [diff] [blame] | 473 | self.vapi.cli("set crypto handler all %s" % engine) |
Andrew Yourtchenko | fbc3889 | 2019-09-09 11:14:59 +0000 | [diff] [blame] | 474 | |
| 475 | self.ipv4_params = IPsecIPv4Params() |
| 476 | self.ipv6_params = IPsecIPv6Params() |
| 477 | |
| 478 | self.params = {self.ipv4_params.addr_type: |
| 479 | self.ipv4_params, |
| 480 | self.ipv6_params.addr_type: |
| 481 | self.ipv6_params} |
| 482 | |
| 483 | for _, p in self.params.items(): |
| 484 | p.auth_algo_vpp_id = algo['vpp-integ'] |
| 485 | p.crypt_algo_vpp_id = algo['vpp-crypto'] |
| 486 | p.crypt_algo = algo['scapy-crypto'] |
| 487 | p.auth_algo = algo['scapy-integ'] |
| 488 | p.crypt_key = algo['key'] |
| 489 | p.salt = algo['salt'] |
| 490 | p.flags = p.flags | flag |
| 491 | |
| 492 | self.reporter.send_keep_alive(self) |
| 493 | |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 494 | # |
Andrew Yourtchenko | fbc3889 | 2019-09-09 11:14:59 +0000 | [diff] [blame] | 495 | # configure the SPDs. SAs, etc |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 496 | # |
Andrew Yourtchenko | fbc3889 | 2019-09-09 11:14:59 +0000 | [diff] [blame] | 497 | self.config_network(self.params.values()) |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 498 | |
Andrew Yourtchenko | fbc3889 | 2019-09-09 11:14:59 +0000 | [diff] [blame] | 499 | # |
| 500 | # run some traffic. |
| 501 | # An exhautsive 4o6, 6o4 is not necessary |
| 502 | # for each algo |
| 503 | # |
| 504 | self.verify_tra_basic6(count=NUM_PKTS) |
| 505 | self.verify_tra_basic4(count=NUM_PKTS) |
| 506 | self.verify_tun_66(self.params[socket.AF_INET6], |
| 507 | count=NUM_PKTS) |
| 508 | self.verify_tun_44(self.params[socket.AF_INET], |
| 509 | count=NUM_PKTS) |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 510 | |
Filip Tehlar | efcad1a | 2020-02-04 09:36:04 +0000 | [diff] [blame^] | 511 | LARGE_PKT_SZ = [ |
| 512 | 4010, # ICV ends up splitted accross 2 buffers in esp_decrypt |
| 513 | # for transport4; transport6 takes normal path |
| 514 | |
| 515 | 4020, # same as above but tra4 and tra6 are switched |
| 516 | ] |
| 517 | if self.engine in engines_supporting_chain_bufs: |
| 518 | for sz in LARGE_PKT_SZ: |
| 519 | self.verify_tra_basic4(count=NUM_PKTS, payload_size=sz) |
| 520 | self.verify_tra_basic6(count=NUM_PKTS, payload_size=sz) |
| 521 | self.verify_tun_66(self.params[socket.AF_INET6], |
| 522 | count=NUM_PKTS, payload_size=sz) |
| 523 | self.verify_tun_44(self.params[socket.AF_INET], |
| 524 | count=NUM_PKTS, payload_size=sz) |
| 525 | |
Andrew Yourtchenko | fbc3889 | 2019-09-09 11:14:59 +0000 | [diff] [blame] | 526 | # |
| 527 | # remove the SPDs, SAs, etc |
| 528 | # |
| 529 | self.unconfig_network() |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 530 | |
Andrew Yourtchenko | fbc3889 | 2019-09-09 11:14:59 +0000 | [diff] [blame] | 531 | # |
| 532 | # reconfigure the network and SA to run the |
| 533 | # anti replay tests |
| 534 | # |
| 535 | self.config_network(self.params.values()) |
| 536 | self.verify_tra_anti_replay() |
| 537 | self.unconfig_network() |
juraj.linkes | 1105766 | 2019-07-08 10:22:55 +0200 | [diff] [blame] | 538 | |
Andrew Yourtchenko | fbc3889 | 2019-09-09 11:14:59 +0000 | [diff] [blame] | 539 | # |
| 540 | # To generate test classes, do: |
| 541 | # grep '# GEN' test_ipsec_esp.py | sed -e 's/# GEN //g' | bash |
| 542 | # |
| 543 | # GEN for ENG in ia32 ipsecmb openssl; do \ |
| 544 | # GEN for FLG in noESN ESN; do for ALG in AES-GCM-128/NONE \ |
| 545 | # GEN AES-GCM-192/NONE AES-GCM-256/NONE AES-CBC-128/MD5-96 \ |
| 546 | # GEN AES-CBC-192/SHA1-96 AES-CBC-256/SHA1-96 \ |
| 547 | # GEN 3DES-CBC/SHA1-96 NONE/SHA1-96; do \ |
| 548 | # GEN echo -e "\n\nclass Test_${ENG}_${FLG}_${ALG}(RunTestIpsecEspAll):" | |
| 549 | # GEN sed -e 's/-/_/g' -e 's#/#_#g' ; \ |
| 550 | # GEN echo ' """'$ENG $FLG $ALG IPSec test'"""' ; |
| 551 | # GEN echo " def test_ipsec(self):"; |
| 552 | # GEN echo " self.run_test()"; |
| 553 | # GEN done; done; done |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 554 | |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 555 | |
Andrew Yourtchenko | fbc3889 | 2019-09-09 11:14:59 +0000 | [diff] [blame] | 556 | class Test_ia32_noESN_AES_GCM_128_NONE(RunTestIpsecEspAll): |
| 557 | """ia32 noESN AES-GCM-128/NONE IPSec test""" |
| 558 | def test_ipsec(self): |
| 559 | self.run_test() |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 560 | |
Andrew Yourtchenko | fbc3889 | 2019-09-09 11:14:59 +0000 | [diff] [blame] | 561 | |
| 562 | class Test_ia32_noESN_AES_GCM_192_NONE(RunTestIpsecEspAll): |
| 563 | """ia32 noESN AES-GCM-192/NONE IPSec test""" |
| 564 | def test_ipsec(self): |
| 565 | self.run_test() |
| 566 | |
| 567 | |
| 568 | class Test_ia32_noESN_AES_GCM_256_NONE(RunTestIpsecEspAll): |
| 569 | """ia32 noESN AES-GCM-256/NONE IPSec test""" |
| 570 | def test_ipsec(self): |
| 571 | self.run_test() |
| 572 | |
| 573 | |
| 574 | class Test_ia32_noESN_AES_CBC_128_MD5_96(RunTestIpsecEspAll): |
| 575 | """ia32 noESN AES-CBC-128/MD5-96 IPSec test""" |
| 576 | def test_ipsec(self): |
| 577 | self.run_test() |
| 578 | |
| 579 | |
| 580 | class Test_ia32_noESN_AES_CBC_192_SHA1_96(RunTestIpsecEspAll): |
| 581 | """ia32 noESN AES-CBC-192/SHA1-96 IPSec test""" |
| 582 | def test_ipsec(self): |
| 583 | self.run_test() |
| 584 | |
| 585 | |
| 586 | class Test_ia32_noESN_AES_CBC_256_SHA1_96(RunTestIpsecEspAll): |
| 587 | """ia32 noESN AES-CBC-256/SHA1-96 IPSec test""" |
| 588 | def test_ipsec(self): |
| 589 | self.run_test() |
| 590 | |
| 591 | |
| 592 | class Test_ia32_noESN_3DES_CBC_SHA1_96(RunTestIpsecEspAll): |
| 593 | """ia32 noESN 3DES-CBC/SHA1-96 IPSec test""" |
| 594 | def test_ipsec(self): |
| 595 | self.run_test() |
| 596 | |
| 597 | |
| 598 | class Test_ia32_noESN_NONE_SHA1_96(RunTestIpsecEspAll): |
| 599 | """ia32 noESN NONE/SHA1-96 IPSec test""" |
| 600 | def test_ipsec(self): |
| 601 | self.run_test() |
| 602 | |
| 603 | |
| 604 | class Test_ia32_ESN_AES_GCM_128_NONE(RunTestIpsecEspAll): |
| 605 | """ia32 ESN AES-GCM-128/NONE IPSec test""" |
| 606 | def test_ipsec(self): |
| 607 | self.run_test() |
| 608 | |
| 609 | |
| 610 | class Test_ia32_ESN_AES_GCM_192_NONE(RunTestIpsecEspAll): |
| 611 | """ia32 ESN AES-GCM-192/NONE IPSec test""" |
| 612 | def test_ipsec(self): |
| 613 | self.run_test() |
| 614 | |
| 615 | |
| 616 | class Test_ia32_ESN_AES_GCM_256_NONE(RunTestIpsecEspAll): |
| 617 | """ia32 ESN AES-GCM-256/NONE IPSec test""" |
| 618 | def test_ipsec(self): |
| 619 | self.run_test() |
| 620 | |
| 621 | |
| 622 | class Test_ia32_ESN_AES_CBC_128_MD5_96(RunTestIpsecEspAll): |
| 623 | """ia32 ESN AES-CBC-128/MD5-96 IPSec test""" |
| 624 | def test_ipsec(self): |
| 625 | self.run_test() |
| 626 | |
| 627 | |
| 628 | class Test_ia32_ESN_AES_CBC_192_SHA1_96(RunTestIpsecEspAll): |
| 629 | """ia32 ESN AES-CBC-192/SHA1-96 IPSec test""" |
| 630 | def test_ipsec(self): |
| 631 | self.run_test() |
| 632 | |
| 633 | |
| 634 | class Test_ia32_ESN_AES_CBC_256_SHA1_96(RunTestIpsecEspAll): |
| 635 | """ia32 ESN AES-CBC-256/SHA1-96 IPSec test""" |
| 636 | def test_ipsec(self): |
| 637 | self.run_test() |
| 638 | |
| 639 | |
| 640 | class Test_ia32_ESN_3DES_CBC_SHA1_96(RunTestIpsecEspAll): |
| 641 | """ia32 ESN 3DES-CBC/SHA1-96 IPSec test""" |
| 642 | def test_ipsec(self): |
| 643 | self.run_test() |
| 644 | |
| 645 | |
| 646 | class Test_ia32_ESN_NONE_SHA1_96(RunTestIpsecEspAll): |
| 647 | """ia32 ESN NONE/SHA1-96 IPSec test""" |
| 648 | def test_ipsec(self): |
| 649 | self.run_test() |
| 650 | |
| 651 | |
| 652 | class Test_ipsecmb_noESN_AES_GCM_128_NONE(RunTestIpsecEspAll): |
| 653 | """ipsecmb noESN AES-GCM-128/NONE IPSec test""" |
| 654 | def test_ipsec(self): |
| 655 | self.run_test() |
| 656 | |
| 657 | |
| 658 | class Test_ipsecmb_noESN_AES_GCM_192_NONE(RunTestIpsecEspAll): |
| 659 | """ipsecmb noESN AES-GCM-192/NONE IPSec test""" |
| 660 | def test_ipsec(self): |
| 661 | self.run_test() |
| 662 | |
| 663 | |
| 664 | class Test_ipsecmb_noESN_AES_GCM_256_NONE(RunTestIpsecEspAll): |
| 665 | """ipsecmb noESN AES-GCM-256/NONE IPSec test""" |
| 666 | def test_ipsec(self): |
| 667 | self.run_test() |
| 668 | |
| 669 | |
| 670 | class Test_ipsecmb_noESN_AES_CBC_128_MD5_96(RunTestIpsecEspAll): |
| 671 | """ipsecmb noESN AES-CBC-128/MD5-96 IPSec test""" |
| 672 | def test_ipsec(self): |
| 673 | self.run_test() |
| 674 | |
| 675 | |
| 676 | class Test_ipsecmb_noESN_AES_CBC_192_SHA1_96(RunTestIpsecEspAll): |
| 677 | """ipsecmb noESN AES-CBC-192/SHA1-96 IPSec test""" |
| 678 | def test_ipsec(self): |
| 679 | self.run_test() |
| 680 | |
| 681 | |
| 682 | class Test_ipsecmb_noESN_AES_CBC_256_SHA1_96(RunTestIpsecEspAll): |
| 683 | """ipsecmb noESN AES-CBC-256/SHA1-96 IPSec test""" |
| 684 | def test_ipsec(self): |
| 685 | self.run_test() |
| 686 | |
| 687 | |
| 688 | class Test_ipsecmb_noESN_3DES_CBC_SHA1_96(RunTestIpsecEspAll): |
| 689 | """ipsecmb noESN 3DES-CBC/SHA1-96 IPSec test""" |
| 690 | def test_ipsec(self): |
| 691 | self.run_test() |
| 692 | |
| 693 | |
| 694 | class Test_ipsecmb_noESN_NONE_SHA1_96(RunTestIpsecEspAll): |
| 695 | """ipsecmb noESN NONE/SHA1-96 IPSec test""" |
| 696 | def test_ipsec(self): |
| 697 | self.run_test() |
| 698 | |
| 699 | |
| 700 | class Test_ipsecmb_ESN_AES_GCM_128_NONE(RunTestIpsecEspAll): |
| 701 | """ipsecmb ESN AES-GCM-128/NONE IPSec test""" |
| 702 | def test_ipsec(self): |
| 703 | self.run_test() |
| 704 | |
| 705 | |
| 706 | class Test_ipsecmb_ESN_AES_GCM_192_NONE(RunTestIpsecEspAll): |
| 707 | """ipsecmb ESN AES-GCM-192/NONE IPSec test""" |
| 708 | def test_ipsec(self): |
| 709 | self.run_test() |
| 710 | |
| 711 | |
| 712 | class Test_ipsecmb_ESN_AES_GCM_256_NONE(RunTestIpsecEspAll): |
| 713 | """ipsecmb ESN AES-GCM-256/NONE IPSec test""" |
| 714 | def test_ipsec(self): |
| 715 | self.run_test() |
| 716 | |
| 717 | |
| 718 | class Test_ipsecmb_ESN_AES_CBC_128_MD5_96(RunTestIpsecEspAll): |
| 719 | """ipsecmb ESN AES-CBC-128/MD5-96 IPSec test""" |
| 720 | def test_ipsec(self): |
| 721 | self.run_test() |
| 722 | |
| 723 | |
| 724 | class Test_ipsecmb_ESN_AES_CBC_192_SHA1_96(RunTestIpsecEspAll): |
| 725 | """ipsecmb ESN AES-CBC-192/SHA1-96 IPSec test""" |
| 726 | def test_ipsec(self): |
| 727 | self.run_test() |
| 728 | |
| 729 | |
| 730 | class Test_ipsecmb_ESN_AES_CBC_256_SHA1_96(RunTestIpsecEspAll): |
| 731 | """ipsecmb ESN AES-CBC-256/SHA1-96 IPSec test""" |
| 732 | def test_ipsec(self): |
| 733 | self.run_test() |
| 734 | |
| 735 | |
| 736 | class Test_ipsecmb_ESN_3DES_CBC_SHA1_96(RunTestIpsecEspAll): |
| 737 | """ipsecmb ESN 3DES-CBC/SHA1-96 IPSec test""" |
| 738 | def test_ipsec(self): |
| 739 | self.run_test() |
| 740 | |
| 741 | |
| 742 | class Test_ipsecmb_ESN_NONE_SHA1_96(RunTestIpsecEspAll): |
| 743 | """ipsecmb ESN NONE/SHA1-96 IPSec test""" |
| 744 | def test_ipsec(self): |
| 745 | self.run_test() |
| 746 | |
| 747 | |
| 748 | class Test_openssl_noESN_AES_GCM_128_NONE(RunTestIpsecEspAll): |
| 749 | """openssl noESN AES-GCM-128/NONE IPSec test""" |
| 750 | def test_ipsec(self): |
| 751 | self.run_test() |
| 752 | |
| 753 | |
| 754 | class Test_openssl_noESN_AES_GCM_192_NONE(RunTestIpsecEspAll): |
| 755 | """openssl noESN AES-GCM-192/NONE IPSec test""" |
| 756 | def test_ipsec(self): |
| 757 | self.run_test() |
| 758 | |
| 759 | |
| 760 | class Test_openssl_noESN_AES_GCM_256_NONE(RunTestIpsecEspAll): |
| 761 | """openssl noESN AES-GCM-256/NONE IPSec test""" |
| 762 | def test_ipsec(self): |
| 763 | self.run_test() |
| 764 | |
| 765 | |
| 766 | class Test_openssl_noESN_AES_CBC_128_MD5_96(RunTestIpsecEspAll): |
| 767 | """openssl noESN AES-CBC-128/MD5-96 IPSec test""" |
| 768 | def test_ipsec(self): |
| 769 | self.run_test() |
| 770 | |
| 771 | |
| 772 | class Test_openssl_noESN_AES_CBC_192_SHA1_96(RunTestIpsecEspAll): |
| 773 | """openssl noESN AES-CBC-192/SHA1-96 IPSec test""" |
| 774 | def test_ipsec(self): |
| 775 | self.run_test() |
| 776 | |
| 777 | |
| 778 | class Test_openssl_noESN_AES_CBC_256_SHA1_96(RunTestIpsecEspAll): |
| 779 | """openssl noESN AES-CBC-256/SHA1-96 IPSec test""" |
| 780 | def test_ipsec(self): |
| 781 | self.run_test() |
| 782 | |
| 783 | |
| 784 | class Test_openssl_noESN_3DES_CBC_SHA1_96(RunTestIpsecEspAll): |
| 785 | """openssl noESN 3DES-CBC/SHA1-96 IPSec test""" |
| 786 | def test_ipsec(self): |
| 787 | self.run_test() |
| 788 | |
| 789 | |
| 790 | class Test_openssl_noESN_NONE_SHA1_96(RunTestIpsecEspAll): |
| 791 | """openssl noESN NONE/SHA1-96 IPSec test""" |
| 792 | def test_ipsec(self): |
| 793 | self.run_test() |
| 794 | |
| 795 | |
| 796 | class Test_openssl_ESN_AES_GCM_128_NONE(RunTestIpsecEspAll): |
| 797 | """openssl ESN AES-GCM-128/NONE IPSec test""" |
| 798 | def test_ipsec(self): |
| 799 | self.run_test() |
| 800 | |
| 801 | |
| 802 | class Test_openssl_ESN_AES_GCM_192_NONE(RunTestIpsecEspAll): |
| 803 | """openssl ESN AES-GCM-192/NONE IPSec test""" |
| 804 | def test_ipsec(self): |
| 805 | self.run_test() |
| 806 | |
| 807 | |
| 808 | class Test_openssl_ESN_AES_GCM_256_NONE(RunTestIpsecEspAll): |
| 809 | """openssl ESN AES-GCM-256/NONE IPSec test""" |
| 810 | def test_ipsec(self): |
| 811 | self.run_test() |
| 812 | |
| 813 | |
| 814 | class Test_openssl_ESN_AES_CBC_128_MD5_96(RunTestIpsecEspAll): |
| 815 | """openssl ESN AES-CBC-128/MD5-96 IPSec test""" |
| 816 | def test_ipsec(self): |
| 817 | self.run_test() |
| 818 | |
| 819 | |
| 820 | class Test_openssl_ESN_AES_CBC_192_SHA1_96(RunTestIpsecEspAll): |
| 821 | """openssl ESN AES-CBC-192/SHA1-96 IPSec test""" |
| 822 | def test_ipsec(self): |
| 823 | self.run_test() |
| 824 | |
| 825 | |
| 826 | class Test_openssl_ESN_AES_CBC_256_SHA1_96(RunTestIpsecEspAll): |
| 827 | """openssl ESN AES-CBC-256/SHA1-96 IPSec test""" |
| 828 | def test_ipsec(self): |
| 829 | self.run_test() |
| 830 | |
| 831 | |
| 832 | class Test_openssl_ESN_3DES_CBC_SHA1_96(RunTestIpsecEspAll): |
| 833 | """openssl ESN 3DES-CBC/SHA1-96 IPSec test""" |
| 834 | def test_ipsec(self): |
| 835 | self.run_test() |
| 836 | |
| 837 | |
| 838 | class Test_openssl_ESN_NONE_SHA1_96(RunTestIpsecEspAll): |
| 839 | """openssl ESN NONE/SHA1-96 IPSec test""" |
| 840 | def test_ipsec(self): |
| 841 | self.run_test() |
Neale Ranns | 6afaae1 | 2019-07-17 15:07:14 +0000 | [diff] [blame] | 842 | |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 843 | |
“mystarrocks” | 23f0c45 | 2017-12-11 07:11:51 -0800 | [diff] [blame] | 844 | if __name__ == '__main__': |
| 845 | unittest.main(testRunner=VppTestRunner) |