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