“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, \ |
| 13 | IpsecTra6ExtTests, IpsecTunEsp4Tests |
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 |
| 21 | |
“mystarrocks” | 23f0c45 | 2017-12-11 07:11:51 -0800 | [diff] [blame] | 22 | |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 23 | class ConfigIpsecESP(TemplateIpsec): |
| 24 | encryption_type = ESP |
| 25 | tra4_encrypt_node_name = "esp4-encrypt" |
| 26 | tra4_decrypt_node_name = "esp4-decrypt" |
| 27 | tra6_encrypt_node_name = "esp6-encrypt" |
| 28 | tra6_decrypt_node_name = "esp6-decrypt" |
| 29 | tun4_encrypt_node_name = "esp4-encrypt" |
| 30 | tun4_decrypt_node_name = "esp4-decrypt" |
| 31 | tun6_encrypt_node_name = "esp6-encrypt" |
| 32 | tun6_decrypt_node_name = "esp6-decrypt" |
Neale Ranns | 53f526b | 2019-02-25 14:32:02 +0000 | [diff] [blame] | 33 | |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 34 | @classmethod |
| 35 | def setUpClass(cls): |
| 36 | super(ConfigIpsecESP, cls).setUpClass() |
Neale Ranns | 53f526b | 2019-02-25 14:32:02 +0000 | [diff] [blame] | 37 | |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 38 | @classmethod |
| 39 | def tearDownClass(cls): |
| 40 | super(ConfigIpsecESP, cls).tearDownClass() |
Neale Ranns | 53f526b | 2019-02-25 14:32:02 +0000 | [diff] [blame] | 41 | |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 42 | def setUp(self): |
| 43 | super(ConfigIpsecESP, self).setUp() |
Neale Ranns | 53f526b | 2019-02-25 14:32:02 +0000 | [diff] [blame] | 44 | |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 45 | def tearDown(self): |
| 46 | super(ConfigIpsecESP, self).tearDown() |
| 47 | |
| 48 | def config_network(self, params): |
| 49 | self.net_objs = [] |
| 50 | self.tun_if = self.pg0 |
| 51 | self.tra_if = self.pg2 |
| 52 | self.logger.info(self.vapi.ppcli("show int addr")) |
| 53 | |
| 54 | self.tra_spd = VppIpsecSpd(self, self.tra_spd_id) |
| 55 | self.tra_spd.add_vpp_config() |
| 56 | self.net_objs.append(self.tra_spd) |
| 57 | self.tun_spd = VppIpsecSpd(self, self.tun_spd_id) |
| 58 | self.tun_spd.add_vpp_config() |
| 59 | self.net_objs.append(self.tun_spd) |
| 60 | |
| 61 | b = VppIpsecSpdItfBinding(self, self.tun_spd, |
| 62 | self.tun_if) |
| 63 | b.add_vpp_config() |
| 64 | self.net_objs.append(b) |
| 65 | |
| 66 | b = VppIpsecSpdItfBinding(self, self.tra_spd, |
| 67 | self.tra_if) |
| 68 | b.add_vpp_config() |
| 69 | self.net_objs.append(b) |
| 70 | |
| 71 | for p in params: |
| 72 | self.config_esp_tra(p) |
| 73 | config_tra_params(p, self.encryption_type) |
| 74 | for p in params: |
| 75 | self.config_esp_tun(p) |
Neale Ranns | 12989b5 | 2019-09-26 16:20:19 +0000 | [diff] [blame] | 76 | config_tun_params(p, self.encryption_type, self.tun_if) |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 77 | |
| 78 | for p in params: |
| 79 | d = DpoProto.DPO_PROTO_IP6 if p.is_ipv6 else DpoProto.DPO_PROTO_IP4 |
| 80 | r = VppIpRoute(self, p.remote_tun_if_host, p.addr_len, |
| 81 | [VppRoutePath(self.tun_if.remote_addr[p.addr_type], |
| 82 | 0xffffffff, |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 83 | proto=d)]) |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 84 | r.add_vpp_config() |
| 85 | self.net_objs.append(r) |
| 86 | |
| 87 | self.logger.info(self.vapi.ppcli("show ipsec all")) |
| 88 | |
| 89 | def unconfig_network(self): |
| 90 | for o in reversed(self.net_objs): |
| 91 | o.remove_vpp_config() |
| 92 | self.net_objs = [] |
| 93 | |
| 94 | def config_esp_tun(self, params): |
| 95 | addr_type = params.addr_type |
| 96 | scapy_tun_sa_id = params.scapy_tun_sa_id |
| 97 | scapy_tun_spi = params.scapy_tun_spi |
| 98 | vpp_tun_sa_id = params.vpp_tun_sa_id |
| 99 | vpp_tun_spi = params.vpp_tun_spi |
| 100 | auth_algo_vpp_id = params.auth_algo_vpp_id |
| 101 | auth_key = params.auth_key |
| 102 | crypt_algo_vpp_id = params.crypt_algo_vpp_id |
| 103 | crypt_key = params.crypt_key |
| 104 | remote_tun_if_host = params.remote_tun_if_host |
| 105 | addr_any = params.addr_any |
| 106 | addr_bcast = params.addr_bcast |
| 107 | e = VppEnum.vl_api_ipsec_spd_action_t |
Neale Ranns | 49e7ef6 | 2019-04-10 17:24:29 +0000 | [diff] [blame] | 108 | flags = params.flags |
Neale Ranns | 80f6fd5 | 2019-04-16 02:41:34 +0000 | [diff] [blame] | 109 | salt = params.salt |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 110 | objs = [] |
| 111 | |
| 112 | params.tun_sa_in = VppIpsecSA(self, scapy_tun_sa_id, scapy_tun_spi, |
| 113 | auth_algo_vpp_id, auth_key, |
| 114 | crypt_algo_vpp_id, crypt_key, |
| 115 | self.vpp_esp_protocol, |
| 116 | self.tun_if.local_addr[addr_type], |
Neale Ranns | 49e7ef6 | 2019-04-10 17:24:29 +0000 | [diff] [blame] | 117 | self.tun_if.remote_addr[addr_type], |
Neale Ranns | 80f6fd5 | 2019-04-16 02:41:34 +0000 | [diff] [blame] | 118 | flags=flags, |
| 119 | salt=salt) |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 120 | params.tun_sa_out = VppIpsecSA(self, vpp_tun_sa_id, vpp_tun_spi, |
| 121 | auth_algo_vpp_id, auth_key, |
| 122 | crypt_algo_vpp_id, crypt_key, |
| 123 | self.vpp_esp_protocol, |
| 124 | self.tun_if.remote_addr[addr_type], |
Neale Ranns | 49e7ef6 | 2019-04-10 17:24:29 +0000 | [diff] [blame] | 125 | self.tun_if.local_addr[addr_type], |
Neale Ranns | 80f6fd5 | 2019-04-16 02:41:34 +0000 | [diff] [blame] | 126 | flags=flags, |
| 127 | salt=salt) |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 128 | objs.append(params.tun_sa_in) |
| 129 | objs.append(params.tun_sa_out) |
| 130 | |
| 131 | params.spd_policy_in_any = VppIpsecSpdEntry(self, self.tun_spd, |
| 132 | scapy_tun_sa_id, |
| 133 | addr_any, addr_bcast, |
| 134 | addr_any, addr_bcast, |
| 135 | socket.IPPROTO_ESP) |
| 136 | params.spd_policy_out_any = VppIpsecSpdEntry(self, self.tun_spd, |
| 137 | scapy_tun_sa_id, |
| 138 | addr_any, addr_bcast, |
| 139 | addr_any, addr_bcast, |
| 140 | socket.IPPROTO_ESP, |
| 141 | is_outbound=0) |
| 142 | objs.append(params.spd_policy_out_any) |
| 143 | objs.append(params.spd_policy_in_any) |
| 144 | |
| 145 | objs.append(VppIpsecSpdEntry(self, self.tun_spd, vpp_tun_sa_id, |
| 146 | remote_tun_if_host, remote_tun_if_host, |
| 147 | self.pg1.remote_addr[addr_type], |
| 148 | self.pg1.remote_addr[addr_type], |
| 149 | 0, |
| 150 | priority=10, |
| 151 | policy=e.IPSEC_API_SPD_ACTION_PROTECT, |
| 152 | is_outbound=0)) |
| 153 | objs.append(VppIpsecSpdEntry(self, self.tun_spd, scapy_tun_sa_id, |
| 154 | self.pg1.remote_addr[addr_type], |
| 155 | self.pg1.remote_addr[addr_type], |
| 156 | remote_tun_if_host, remote_tun_if_host, |
| 157 | 0, |
| 158 | policy=e.IPSEC_API_SPD_ACTION_PROTECT, |
| 159 | priority=10)) |
| 160 | objs.append(VppIpsecSpdEntry(self, self.tun_spd, vpp_tun_sa_id, |
| 161 | remote_tun_if_host, remote_tun_if_host, |
| 162 | self.pg0.local_addr[addr_type], |
| 163 | self.pg0.local_addr[addr_type], |
| 164 | 0, |
| 165 | priority=20, |
| 166 | policy=e.IPSEC_API_SPD_ACTION_PROTECT, |
| 167 | is_outbound=0)) |
| 168 | objs.append(VppIpsecSpdEntry(self, self.tun_spd, scapy_tun_sa_id, |
| 169 | self.pg0.local_addr[addr_type], |
| 170 | self.pg0.local_addr[addr_type], |
| 171 | remote_tun_if_host, remote_tun_if_host, |
| 172 | 0, |
| 173 | policy=e.IPSEC_API_SPD_ACTION_PROTECT, |
| 174 | priority=20)) |
| 175 | for o in objs: |
| 176 | o.add_vpp_config() |
| 177 | self.net_objs = self.net_objs + objs |
| 178 | |
| 179 | def config_esp_tra(self, params): |
| 180 | addr_type = params.addr_type |
| 181 | scapy_tra_sa_id = params.scapy_tra_sa_id |
| 182 | scapy_tra_spi = params.scapy_tra_spi |
| 183 | vpp_tra_sa_id = params.vpp_tra_sa_id |
| 184 | vpp_tra_spi = params.vpp_tra_spi |
| 185 | auth_algo_vpp_id = params.auth_algo_vpp_id |
| 186 | auth_key = params.auth_key |
| 187 | crypt_algo_vpp_id = params.crypt_algo_vpp_id |
| 188 | crypt_key = params.crypt_key |
| 189 | addr_any = params.addr_any |
| 190 | addr_bcast = params.addr_bcast |
| 191 | flags = (VppEnum.vl_api_ipsec_sad_flags_t. |
| 192 | IPSEC_API_SAD_FLAG_USE_ANTI_REPLAY) |
| 193 | e = VppEnum.vl_api_ipsec_spd_action_t |
| 194 | flags = params.flags | flags |
Neale Ranns | 80f6fd5 | 2019-04-16 02:41:34 +0000 | [diff] [blame] | 195 | salt = params.salt |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 196 | objs = [] |
| 197 | |
| 198 | params.tra_sa_in = VppIpsecSA(self, scapy_tra_sa_id, scapy_tra_spi, |
| 199 | auth_algo_vpp_id, auth_key, |
| 200 | crypt_algo_vpp_id, crypt_key, |
| 201 | self.vpp_esp_protocol, |
Neale Ranns | 80f6fd5 | 2019-04-16 02:41:34 +0000 | [diff] [blame] | 202 | flags=flags, |
| 203 | salt=salt) |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 204 | params.tra_sa_out = VppIpsecSA(self, vpp_tra_sa_id, vpp_tra_spi, |
| 205 | auth_algo_vpp_id, auth_key, |
| 206 | crypt_algo_vpp_id, crypt_key, |
| 207 | self.vpp_esp_protocol, |
Neale Ranns | 80f6fd5 | 2019-04-16 02:41:34 +0000 | [diff] [blame] | 208 | flags=flags, |
| 209 | salt=salt) |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 210 | objs.append(params.tra_sa_in) |
| 211 | objs.append(params.tra_sa_out) |
| 212 | |
| 213 | objs.append(VppIpsecSpdEntry(self, self.tra_spd, vpp_tra_sa_id, |
| 214 | addr_any, addr_bcast, |
| 215 | addr_any, addr_bcast, |
| 216 | socket.IPPROTO_ESP)) |
| 217 | objs.append(VppIpsecSpdEntry(self, self.tra_spd, vpp_tra_sa_id, |
| 218 | addr_any, addr_bcast, |
| 219 | addr_any, addr_bcast, |
| 220 | socket.IPPROTO_ESP, |
| 221 | is_outbound=0)) |
| 222 | objs.append(VppIpsecSpdEntry(self, self.tra_spd, vpp_tra_sa_id, |
| 223 | self.tra_if.local_addr[addr_type], |
| 224 | self.tra_if.local_addr[addr_type], |
| 225 | self.tra_if.remote_addr[addr_type], |
| 226 | self.tra_if.remote_addr[addr_type], |
| 227 | 0, priority=10, |
| 228 | policy=e.IPSEC_API_SPD_ACTION_PROTECT, |
| 229 | is_outbound=0)) |
| 230 | objs.append(VppIpsecSpdEntry(self, self.tra_spd, scapy_tra_sa_id, |
| 231 | self.tra_if.local_addr[addr_type], |
| 232 | self.tra_if.local_addr[addr_type], |
| 233 | self.tra_if.remote_addr[addr_type], |
| 234 | self.tra_if.remote_addr[addr_type], |
| 235 | 0, policy=e.IPSEC_API_SPD_ACTION_PROTECT, |
| 236 | priority=10)) |
| 237 | for o in objs: |
| 238 | o.add_vpp_config() |
| 239 | self.net_objs = self.net_objs + objs |
Neale Ranns | 53f526b | 2019-02-25 14:32:02 +0000 | [diff] [blame] | 240 | |
| 241 | |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 242 | class TemplateIpsecEsp(ConfigIpsecESP): |
“mystarrocks” | 23f0c45 | 2017-12-11 07:11:51 -0800 | [diff] [blame] | 243 | """ |
| 244 | Basic test for ipsec esp sanity - tunnel and transport modes. |
| 245 | |
| 246 | Below 4 cases are covered as part of this test |
| 247 | 1) ipsec esp v4 transport basic test - IPv4 Transport mode |
Paul Vinciguerra | 8feeaff | 2019-03-27 11:25:48 -0700 | [diff] [blame] | 248 | scenario using HMAC-SHA1-96 integrity algo |
“mystarrocks” | 23f0c45 | 2017-12-11 07:11:51 -0800 | [diff] [blame] | 249 | 2) ipsec esp v4 transport burst test |
| 250 | Above test for 257 pkts |
| 251 | 3) ipsec esp 4o4 tunnel basic test - IPv4 Tunnel mode |
Paul Vinciguerra | 8feeaff | 2019-03-27 11:25:48 -0700 | [diff] [blame] | 252 | scenario using HMAC-SHA1-96 integrity algo |
“mystarrocks” | 23f0c45 | 2017-12-11 07:11:51 -0800 | [diff] [blame] | 253 | 4) ipsec esp 4o4 tunnel burst test |
| 254 | Above test for 257 pkts |
| 255 | |
| 256 | TRANSPORT MODE: |
| 257 | |
| 258 | --- encrypt --- |
| 259 | |pg2| <-------> |VPP| |
| 260 | --- decrypt --- |
| 261 | |
| 262 | TUNNEL MODE: |
| 263 | |
| 264 | --- encrypt --- plain --- |
Klement Sekera | 4b089f2 | 2018-04-17 18:04:57 +0200 | [diff] [blame] | 265 | |pg0| <------- |VPP| <------ |pg1| |
“mystarrocks” | 23f0c45 | 2017-12-11 07:11:51 -0800 | [diff] [blame] | 266 | --- --- --- |
| 267 | |
| 268 | --- decrypt --- plain --- |
Klement Sekera | 4b089f2 | 2018-04-17 18:04:57 +0200 | [diff] [blame] | 269 | |pg0| -------> |VPP| ------> |pg1| |
“mystarrocks” | 23f0c45 | 2017-12-11 07:11:51 -0800 | [diff] [blame] | 270 | --- --- --- |
“mystarrocks” | 23f0c45 | 2017-12-11 07:11:51 -0800 | [diff] [blame] | 271 | """ |
| 272 | |
Paul Vinciguerra | 7f9b7f9 | 2019-03-12 19:23:27 -0700 | [diff] [blame] | 273 | @classmethod |
| 274 | def setUpClass(cls): |
| 275 | super(TemplateIpsecEsp, cls).setUpClass() |
| 276 | |
| 277 | @classmethod |
| 278 | def tearDownClass(cls): |
| 279 | super(TemplateIpsecEsp, cls).tearDownClass() |
| 280 | |
Neale Ranns | 8e4a89b | 2019-01-23 08:16:17 -0800 | [diff] [blame] | 281 | def setUp(self): |
| 282 | super(TemplateIpsecEsp, self).setUp() |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 283 | self.config_network(self.params.values()) |
Klement Sekera | 611864f | 2018-09-26 11:19:00 +0200 | [diff] [blame] | 284 | |
Neale Ranns | 8e4a89b | 2019-01-23 08:16:17 -0800 | [diff] [blame] | 285 | def tearDown(self): |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 286 | self.unconfig_network() |
Neale Ranns | 8e4a89b | 2019-01-23 08:16:17 -0800 | [diff] [blame] | 287 | super(TemplateIpsecEsp, self).tearDown() |
Neale Ranns | 8e4a89b | 2019-01-23 08:16:17 -0800 | [diff] [blame] | 288 | |
Klement Sekera | 611864f | 2018-09-26 11:19:00 +0200 | [diff] [blame] | 289 | |
Neale Ranns | 0295040 | 2019-12-20 00:54:57 +0000 | [diff] [blame] | 290 | class TestIpsecEsp1(TemplateIpsecEsp, IpsecTra46Tests, |
| 291 | IpsecTun46Tests, IpsecTunEsp4Tests, |
| 292 | 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 | |
| 472 | def run_a_test(self, engine, flag, algo): |
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 | |
Andrew Yourtchenko | fbc3889 | 2019-09-09 11:14:59 +0000 | [diff] [blame] | 511 | # |
| 512 | # remove the SPDs, SAs, etc |
| 513 | # |
| 514 | self.unconfig_network() |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 515 | |
Andrew Yourtchenko | fbc3889 | 2019-09-09 11:14:59 +0000 | [diff] [blame] | 516 | # |
| 517 | # reconfigure the network and SA to run the |
| 518 | # anti replay tests |
| 519 | # |
| 520 | self.config_network(self.params.values()) |
| 521 | self.verify_tra_anti_replay() |
| 522 | self.unconfig_network() |
juraj.linkes | 1105766 | 2019-07-08 10:22:55 +0200 | [diff] [blame] | 523 | |
Andrew Yourtchenko | fbc3889 | 2019-09-09 11:14:59 +0000 | [diff] [blame] | 524 | # |
| 525 | # To generate test classes, do: |
| 526 | # grep '# GEN' test_ipsec_esp.py | sed -e 's/# GEN //g' | bash |
| 527 | # |
| 528 | # GEN for ENG in ia32 ipsecmb openssl; do \ |
| 529 | # GEN for FLG in noESN ESN; do for ALG in AES-GCM-128/NONE \ |
| 530 | # GEN AES-GCM-192/NONE AES-GCM-256/NONE AES-CBC-128/MD5-96 \ |
| 531 | # GEN AES-CBC-192/SHA1-96 AES-CBC-256/SHA1-96 \ |
| 532 | # GEN 3DES-CBC/SHA1-96 NONE/SHA1-96; do \ |
| 533 | # GEN echo -e "\n\nclass Test_${ENG}_${FLG}_${ALG}(RunTestIpsecEspAll):" | |
| 534 | # GEN sed -e 's/-/_/g' -e 's#/#_#g' ; \ |
| 535 | # GEN echo ' """'$ENG $FLG $ALG IPSec test'"""' ; |
| 536 | # GEN echo " def test_ipsec(self):"; |
| 537 | # GEN echo " self.run_test()"; |
| 538 | # GEN done; done; done |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 539 | |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 540 | |
Andrew Yourtchenko | fbc3889 | 2019-09-09 11:14:59 +0000 | [diff] [blame] | 541 | class Test_ia32_noESN_AES_GCM_128_NONE(RunTestIpsecEspAll): |
| 542 | """ia32 noESN AES-GCM-128/NONE IPSec test""" |
| 543 | def test_ipsec(self): |
| 544 | self.run_test() |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 545 | |
Andrew Yourtchenko | fbc3889 | 2019-09-09 11:14:59 +0000 | [diff] [blame] | 546 | |
| 547 | class Test_ia32_noESN_AES_GCM_192_NONE(RunTestIpsecEspAll): |
| 548 | """ia32 noESN AES-GCM-192/NONE IPSec test""" |
| 549 | def test_ipsec(self): |
| 550 | self.run_test() |
| 551 | |
| 552 | |
| 553 | class Test_ia32_noESN_AES_GCM_256_NONE(RunTestIpsecEspAll): |
| 554 | """ia32 noESN AES-GCM-256/NONE IPSec test""" |
| 555 | def test_ipsec(self): |
| 556 | self.run_test() |
| 557 | |
| 558 | |
| 559 | class Test_ia32_noESN_AES_CBC_128_MD5_96(RunTestIpsecEspAll): |
| 560 | """ia32 noESN AES-CBC-128/MD5-96 IPSec test""" |
| 561 | def test_ipsec(self): |
| 562 | self.run_test() |
| 563 | |
| 564 | |
| 565 | class Test_ia32_noESN_AES_CBC_192_SHA1_96(RunTestIpsecEspAll): |
| 566 | """ia32 noESN AES-CBC-192/SHA1-96 IPSec test""" |
| 567 | def test_ipsec(self): |
| 568 | self.run_test() |
| 569 | |
| 570 | |
| 571 | class Test_ia32_noESN_AES_CBC_256_SHA1_96(RunTestIpsecEspAll): |
| 572 | """ia32 noESN AES-CBC-256/SHA1-96 IPSec test""" |
| 573 | def test_ipsec(self): |
| 574 | self.run_test() |
| 575 | |
| 576 | |
| 577 | class Test_ia32_noESN_3DES_CBC_SHA1_96(RunTestIpsecEspAll): |
| 578 | """ia32 noESN 3DES-CBC/SHA1-96 IPSec test""" |
| 579 | def test_ipsec(self): |
| 580 | self.run_test() |
| 581 | |
| 582 | |
| 583 | class Test_ia32_noESN_NONE_SHA1_96(RunTestIpsecEspAll): |
| 584 | """ia32 noESN NONE/SHA1-96 IPSec test""" |
| 585 | def test_ipsec(self): |
| 586 | self.run_test() |
| 587 | |
| 588 | |
| 589 | class Test_ia32_ESN_AES_GCM_128_NONE(RunTestIpsecEspAll): |
| 590 | """ia32 ESN AES-GCM-128/NONE IPSec test""" |
| 591 | def test_ipsec(self): |
| 592 | self.run_test() |
| 593 | |
| 594 | |
| 595 | class Test_ia32_ESN_AES_GCM_192_NONE(RunTestIpsecEspAll): |
| 596 | """ia32 ESN AES-GCM-192/NONE IPSec test""" |
| 597 | def test_ipsec(self): |
| 598 | self.run_test() |
| 599 | |
| 600 | |
| 601 | class Test_ia32_ESN_AES_GCM_256_NONE(RunTestIpsecEspAll): |
| 602 | """ia32 ESN AES-GCM-256/NONE IPSec test""" |
| 603 | def test_ipsec(self): |
| 604 | self.run_test() |
| 605 | |
| 606 | |
| 607 | class Test_ia32_ESN_AES_CBC_128_MD5_96(RunTestIpsecEspAll): |
| 608 | """ia32 ESN AES-CBC-128/MD5-96 IPSec test""" |
| 609 | def test_ipsec(self): |
| 610 | self.run_test() |
| 611 | |
| 612 | |
| 613 | class Test_ia32_ESN_AES_CBC_192_SHA1_96(RunTestIpsecEspAll): |
| 614 | """ia32 ESN AES-CBC-192/SHA1-96 IPSec test""" |
| 615 | def test_ipsec(self): |
| 616 | self.run_test() |
| 617 | |
| 618 | |
| 619 | class Test_ia32_ESN_AES_CBC_256_SHA1_96(RunTestIpsecEspAll): |
| 620 | """ia32 ESN AES-CBC-256/SHA1-96 IPSec test""" |
| 621 | def test_ipsec(self): |
| 622 | self.run_test() |
| 623 | |
| 624 | |
| 625 | class Test_ia32_ESN_3DES_CBC_SHA1_96(RunTestIpsecEspAll): |
| 626 | """ia32 ESN 3DES-CBC/SHA1-96 IPSec test""" |
| 627 | def test_ipsec(self): |
| 628 | self.run_test() |
| 629 | |
| 630 | |
| 631 | class Test_ia32_ESN_NONE_SHA1_96(RunTestIpsecEspAll): |
| 632 | """ia32 ESN NONE/SHA1-96 IPSec test""" |
| 633 | def test_ipsec(self): |
| 634 | self.run_test() |
| 635 | |
| 636 | |
| 637 | class Test_ipsecmb_noESN_AES_GCM_128_NONE(RunTestIpsecEspAll): |
| 638 | """ipsecmb noESN AES-GCM-128/NONE IPSec test""" |
| 639 | def test_ipsec(self): |
| 640 | self.run_test() |
| 641 | |
| 642 | |
| 643 | class Test_ipsecmb_noESN_AES_GCM_192_NONE(RunTestIpsecEspAll): |
| 644 | """ipsecmb noESN AES-GCM-192/NONE IPSec test""" |
| 645 | def test_ipsec(self): |
| 646 | self.run_test() |
| 647 | |
| 648 | |
| 649 | class Test_ipsecmb_noESN_AES_GCM_256_NONE(RunTestIpsecEspAll): |
| 650 | """ipsecmb noESN AES-GCM-256/NONE IPSec test""" |
| 651 | def test_ipsec(self): |
| 652 | self.run_test() |
| 653 | |
| 654 | |
| 655 | class Test_ipsecmb_noESN_AES_CBC_128_MD5_96(RunTestIpsecEspAll): |
| 656 | """ipsecmb noESN AES-CBC-128/MD5-96 IPSec test""" |
| 657 | def test_ipsec(self): |
| 658 | self.run_test() |
| 659 | |
| 660 | |
| 661 | class Test_ipsecmb_noESN_AES_CBC_192_SHA1_96(RunTestIpsecEspAll): |
| 662 | """ipsecmb noESN AES-CBC-192/SHA1-96 IPSec test""" |
| 663 | def test_ipsec(self): |
| 664 | self.run_test() |
| 665 | |
| 666 | |
| 667 | class Test_ipsecmb_noESN_AES_CBC_256_SHA1_96(RunTestIpsecEspAll): |
| 668 | """ipsecmb noESN AES-CBC-256/SHA1-96 IPSec test""" |
| 669 | def test_ipsec(self): |
| 670 | self.run_test() |
| 671 | |
| 672 | |
| 673 | class Test_ipsecmb_noESN_3DES_CBC_SHA1_96(RunTestIpsecEspAll): |
| 674 | """ipsecmb noESN 3DES-CBC/SHA1-96 IPSec test""" |
| 675 | def test_ipsec(self): |
| 676 | self.run_test() |
| 677 | |
| 678 | |
| 679 | class Test_ipsecmb_noESN_NONE_SHA1_96(RunTestIpsecEspAll): |
| 680 | """ipsecmb noESN NONE/SHA1-96 IPSec test""" |
| 681 | def test_ipsec(self): |
| 682 | self.run_test() |
| 683 | |
| 684 | |
| 685 | class Test_ipsecmb_ESN_AES_GCM_128_NONE(RunTestIpsecEspAll): |
| 686 | """ipsecmb ESN AES-GCM-128/NONE IPSec test""" |
| 687 | def test_ipsec(self): |
| 688 | self.run_test() |
| 689 | |
| 690 | |
| 691 | class Test_ipsecmb_ESN_AES_GCM_192_NONE(RunTestIpsecEspAll): |
| 692 | """ipsecmb ESN AES-GCM-192/NONE IPSec test""" |
| 693 | def test_ipsec(self): |
| 694 | self.run_test() |
| 695 | |
| 696 | |
| 697 | class Test_ipsecmb_ESN_AES_GCM_256_NONE(RunTestIpsecEspAll): |
| 698 | """ipsecmb ESN AES-GCM-256/NONE IPSec test""" |
| 699 | def test_ipsec(self): |
| 700 | self.run_test() |
| 701 | |
| 702 | |
| 703 | class Test_ipsecmb_ESN_AES_CBC_128_MD5_96(RunTestIpsecEspAll): |
| 704 | """ipsecmb ESN AES-CBC-128/MD5-96 IPSec test""" |
| 705 | def test_ipsec(self): |
| 706 | self.run_test() |
| 707 | |
| 708 | |
| 709 | class Test_ipsecmb_ESN_AES_CBC_192_SHA1_96(RunTestIpsecEspAll): |
| 710 | """ipsecmb ESN AES-CBC-192/SHA1-96 IPSec test""" |
| 711 | def test_ipsec(self): |
| 712 | self.run_test() |
| 713 | |
| 714 | |
| 715 | class Test_ipsecmb_ESN_AES_CBC_256_SHA1_96(RunTestIpsecEspAll): |
| 716 | """ipsecmb ESN AES-CBC-256/SHA1-96 IPSec test""" |
| 717 | def test_ipsec(self): |
| 718 | self.run_test() |
| 719 | |
| 720 | |
| 721 | class Test_ipsecmb_ESN_3DES_CBC_SHA1_96(RunTestIpsecEspAll): |
| 722 | """ipsecmb ESN 3DES-CBC/SHA1-96 IPSec test""" |
| 723 | def test_ipsec(self): |
| 724 | self.run_test() |
| 725 | |
| 726 | |
| 727 | class Test_ipsecmb_ESN_NONE_SHA1_96(RunTestIpsecEspAll): |
| 728 | """ipsecmb ESN NONE/SHA1-96 IPSec test""" |
| 729 | def test_ipsec(self): |
| 730 | self.run_test() |
| 731 | |
| 732 | |
| 733 | class Test_openssl_noESN_AES_GCM_128_NONE(RunTestIpsecEspAll): |
| 734 | """openssl noESN AES-GCM-128/NONE IPSec test""" |
| 735 | def test_ipsec(self): |
| 736 | self.run_test() |
| 737 | |
| 738 | |
| 739 | class Test_openssl_noESN_AES_GCM_192_NONE(RunTestIpsecEspAll): |
| 740 | """openssl noESN AES-GCM-192/NONE IPSec test""" |
| 741 | def test_ipsec(self): |
| 742 | self.run_test() |
| 743 | |
| 744 | |
| 745 | class Test_openssl_noESN_AES_GCM_256_NONE(RunTestIpsecEspAll): |
| 746 | """openssl noESN AES-GCM-256/NONE IPSec test""" |
| 747 | def test_ipsec(self): |
| 748 | self.run_test() |
| 749 | |
| 750 | |
| 751 | class Test_openssl_noESN_AES_CBC_128_MD5_96(RunTestIpsecEspAll): |
| 752 | """openssl noESN AES-CBC-128/MD5-96 IPSec test""" |
| 753 | def test_ipsec(self): |
| 754 | self.run_test() |
| 755 | |
| 756 | |
| 757 | class Test_openssl_noESN_AES_CBC_192_SHA1_96(RunTestIpsecEspAll): |
| 758 | """openssl noESN AES-CBC-192/SHA1-96 IPSec test""" |
| 759 | def test_ipsec(self): |
| 760 | self.run_test() |
| 761 | |
| 762 | |
| 763 | class Test_openssl_noESN_AES_CBC_256_SHA1_96(RunTestIpsecEspAll): |
| 764 | """openssl noESN AES-CBC-256/SHA1-96 IPSec test""" |
| 765 | def test_ipsec(self): |
| 766 | self.run_test() |
| 767 | |
| 768 | |
| 769 | class Test_openssl_noESN_3DES_CBC_SHA1_96(RunTestIpsecEspAll): |
| 770 | """openssl noESN 3DES-CBC/SHA1-96 IPSec test""" |
| 771 | def test_ipsec(self): |
| 772 | self.run_test() |
| 773 | |
| 774 | |
| 775 | class Test_openssl_noESN_NONE_SHA1_96(RunTestIpsecEspAll): |
| 776 | """openssl noESN NONE/SHA1-96 IPSec test""" |
| 777 | def test_ipsec(self): |
| 778 | self.run_test() |
| 779 | |
| 780 | |
| 781 | class Test_openssl_ESN_AES_GCM_128_NONE(RunTestIpsecEspAll): |
| 782 | """openssl ESN AES-GCM-128/NONE IPSec test""" |
| 783 | def test_ipsec(self): |
| 784 | self.run_test() |
| 785 | |
| 786 | |
| 787 | class Test_openssl_ESN_AES_GCM_192_NONE(RunTestIpsecEspAll): |
| 788 | """openssl ESN AES-GCM-192/NONE IPSec test""" |
| 789 | def test_ipsec(self): |
| 790 | self.run_test() |
| 791 | |
| 792 | |
| 793 | class Test_openssl_ESN_AES_GCM_256_NONE(RunTestIpsecEspAll): |
| 794 | """openssl ESN AES-GCM-256/NONE IPSec test""" |
| 795 | def test_ipsec(self): |
| 796 | self.run_test() |
| 797 | |
| 798 | |
| 799 | class Test_openssl_ESN_AES_CBC_128_MD5_96(RunTestIpsecEspAll): |
| 800 | """openssl ESN AES-CBC-128/MD5-96 IPSec test""" |
| 801 | def test_ipsec(self): |
| 802 | self.run_test() |
| 803 | |
| 804 | |
| 805 | class Test_openssl_ESN_AES_CBC_192_SHA1_96(RunTestIpsecEspAll): |
| 806 | """openssl ESN AES-CBC-192/SHA1-96 IPSec test""" |
| 807 | def test_ipsec(self): |
| 808 | self.run_test() |
| 809 | |
| 810 | |
| 811 | class Test_openssl_ESN_AES_CBC_256_SHA1_96(RunTestIpsecEspAll): |
| 812 | """openssl ESN AES-CBC-256/SHA1-96 IPSec test""" |
| 813 | def test_ipsec(self): |
| 814 | self.run_test() |
| 815 | |
| 816 | |
| 817 | class Test_openssl_ESN_3DES_CBC_SHA1_96(RunTestIpsecEspAll): |
| 818 | """openssl ESN 3DES-CBC/SHA1-96 IPSec test""" |
| 819 | def test_ipsec(self): |
| 820 | self.run_test() |
| 821 | |
| 822 | |
| 823 | class Test_openssl_ESN_NONE_SHA1_96(RunTestIpsecEspAll): |
| 824 | """openssl ESN NONE/SHA1-96 IPSec test""" |
| 825 | def test_ipsec(self): |
| 826 | self.run_test() |
Neale Ranns | 6afaae1 | 2019-07-17 15:07:14 +0000 | [diff] [blame] | 827 | |
Neale Ranns | 4f33c80 | 2019-04-10 12:39:10 +0000 | [diff] [blame] | 828 | |
“mystarrocks” | 23f0c45 | 2017-12-11 07:11:51 -0800 | [diff] [blame] | 829 | if __name__ == '__main__': |
| 830 | unittest.main(testRunner=VppTestRunner) |