CSIT-1488: Add data to the Report 1904
[csit.git] / tests / vpp / func / crypto / default / eth2p-ethip6ipsectpt-ip6base-func.robot
1 # Copyright (c) 2016 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 *** Settings ***
15 | Resource | resources/libraries/robot/crypto/ipsec.robot
16 | Library | resources.libraries.python.Trace
17 | Force Tags | 3_NODE_SINGLE_LINK_TOPO | 3_NODE_DOUBLE_LINK_TOPO
18 | ...        | VM_ENV | HW_ENV | SKIP_VPP_PATCH
19 | Test Setup | Set up IPv6 IPSec functional test
20 | ...
21 | Test Teardown | Tear down IPSec functional test | ${dut_node}
22 | ...
23 | Documentation | *IPv6 IPsec transport mode test suite.*
24 | ...
25 | ... | *[Top] Network topologies:* TG-DUT1 2-node topology with one link\
26 | ... | between nodes.
27 | ... | *[Cfg] DUT configuration:* On DUT1 create loopback interface, configure
28 | ... | loopback an physical interface IPv6 addresses, static ARP record, route
29 | ... | and IPsec manual keyed connection in transport mode.
30 | ... | *[Ver] TG verification:* ESP packet is sent from TG to DUT1. ESP packet
31 | ... | is received on TG from DUT1.
32 | ... | *[Ref] Applicable standard specifications:* RFC4303.
33
34 *** Variables ***
35 | ${tg_spi}= | ${1000}
36 | ${dut_spi}= | ${1001}
37 | ${ESP_PROTO}= | ${50}
38 | ${tg_if_ip6}= | 3ffe:5f::1
39 | ${dut_if_ip6}= | 3ffe:5f::2
40 | ${tg_lo_ip6}= | 3ffe:60::3
41 | ${dut_lo_ip6}= | 3ffe:60::4
42 | ${ip6_plen}= | ${64}
43 | ${ip6_plen_rt}= | ${128}
44
45 *** Test Cases ***
46 | TC01: VPP process ESP packet in Transport Mode with AES-CBC-128 encryption and SHA1-96 integrity
47 | | [Documentation]
48 | | ... | [Top] TG-DUT1.
49 | | ... | [Ref] RFC4303.
50 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
51 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in transport
52 | | ... | mode.
53 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
54 | | ${encr_alg}= | Crypto Alg AES CBC 128
55 | | ${auth_alg}= | Integ Alg SHA1 96
56 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
57 | | When Configure manual keyed connection for IPSec
58 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
59 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
60 | | ... | is_ipv6=${TRUE}
61 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
62 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
63 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
64 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
65
66 | TC02: VPP process ESP packet in Transport Mode with AES-CBC-192 encryption and SHA1-96 integrity
67 | | [Documentation]
68 | | ... | [Top] TG-DUT1.
69 | | ... | [Ref] RFC4303.
70 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
71 | | ... | algorithm AES-CBC-192 and integrity algorithm SHA1-96 in transport
72 | | ... | mode.
73 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
74 | | [Tags] | SKIP_PATCH
75 | | ${encr_alg}= | Crypto Alg AES CBC 192
76 | | ${auth_alg}= | Integ Alg SHA1 96
77 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
78 | | When Configure manual keyed connection for IPSec
79 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
80 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
81 | | ... | is_ipv6=${TRUE}
82 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
83 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
84 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
85 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
86
87 | TC03: VPP process ESP packet in Transport Mode with AES-CBC-256 encryption and SHA1-96 integrity
88 | | [Documentation]
89 | | ... | [Top] TG-DUT1.
90 | | ... | [Ref] RFC4303.
91 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
92 | | ... | algorithm AES-CBC-256 and integrity algorithm SHA1-96 in transport
93 | | ... | mode.
94 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
95 | | [Tags] | SKIP_PATCH
96 | | ${encr_alg}= | Crypto Alg AES CBC 256
97 | | ${auth_alg}= | Integ Alg SHA1 96
98 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
99 | | When Configure manual keyed connection for IPSec
100 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
101 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
102 | | ... | is_ipv6=${TRUE}
103 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
104 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
105 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
106 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
107
108 | TC04: VPP process ESP packet in Transport Mode with AES-CBC-128 encryption and SHA-256-128 integrity
109 | | [Documentation]
110 | | ... | [Top] TG-DUT1.
111 | | ... | [Ref] RFC4303.
112 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
113 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA-256-128 in transport
114 | | ... | mode.
115 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
116 | | [Tags] | SKIP_PATCH
117 | | ${encr_alg}= | Crypto Alg AES CBC 128
118 | | ${auth_alg}= | Integ Alg SHA 256 128
119 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
120 | | When Configure manual keyed connection for IPSec
121 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
122 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
123 | | ... | is_ipv6=${TRUE}
124 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
125 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
126 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
127 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
128
129 | TC05: VPP process ESP packet in Transport Mode with AES-CBC-192 encryption and SHA-256-128 integrity
130 | | [Documentation]
131 | | ... | [Top] TG-DUT1.
132 | | ... | [Ref] RFC4303.
133 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
134 | | ... | algorithm AES-CBC-192 and integrity algorithm SHA-256-128 in transport
135 | | ... | mode.
136 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
137 | | ${encr_alg}= | Crypto Alg AES CBC 192
138 | | ${auth_alg}= | Integ Alg SHA 256 128
139 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
140 | | When Configure manual keyed connection for IPSec
141 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
142 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
143 | | ... | is_ipv6=${TRUE}
144 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
145 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
146 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
147 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
148
149 | TC06: VPP process ESP packet in Transport Mode with AES-CBC-256 encryption and SHA-256-128 integrity
150 | | [Documentation]
151 | | ... | [Top] TG-DUT1.
152 | | ... | [Ref] RFC4303.
153 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
154 | | ... | algorithm AES-CBC-256 and integrity algorithm SHA-256-128 in transport
155 | | ... | mode.
156 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
157 | | [Tags] | SKIP_PATCH
158 | | ${encr_alg}= | Crypto Alg AES CBC 256
159 | | ${auth_alg}= | Integ Alg SHA 256 128
160 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
161 | | When Configure manual keyed connection for IPSec
162 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
163 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
164 | | ... | is_ipv6=${TRUE}
165 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
166 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
167 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
168 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
169
170 | TC07: VPP process ESP packet in Transport Mode with AES-CBC-128 encryption and SHA-384-192 integrity
171 | | [Documentation]
172 | | ... | [Top] TG-DUT1.
173 | | ... | [Ref] RFC4303.
174 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
175 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA-384-192 in transport
176 | | ... | mode.
177 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
178 | | [Tags] | SKIP_PATCH
179 | | ${encr_alg}= | Crypto Alg AES CBC 128
180 | | ${auth_alg}= | Integ Alg SHA 384 192
181 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
182 | | When Configure manual keyed connection for IPSec
183 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
184 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
185 | | ... | is_ipv6=${TRUE}
186 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
187 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
188 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
189 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
190
191 | TC08: VPP process ESP packet in Transport Mode with AES-CBC-192 encryption and SHA-384-192 integrity
192 | | [Documentation]
193 | | ... | [Top] TG-DUT1.
194 | | ... | [Ref] RFC4303.
195 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
196 | | ... | algorithm AES-CBC-192 and integrity algorithm SHA-384-192 in transport
197 | | ... | mode.
198 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
199 | | [Tags] | SKIP_PATCH
200 | | ${encr_alg}= | Crypto Alg AES CBC 192
201 | | ${auth_alg}= | Integ Alg SHA 384 192
202 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
203 | | When Configure manual keyed connection for IPSec
204 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
205 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
206 | | ... | is_ipv6=${TRUE}
207 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
208 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
209 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
210 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
211
212 | TC09: VPP process ESP packet in Transport Mode with AES-CBC-256 encryption and SHA-384-192 integrity
213 | | [Documentation]
214 | | ... | [Top] TG-DUT1.
215 | | ... | [Ref] RFC4303.
216 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
217 | | ... | algorithm AES-CBC-256 and integrity algorithm SHA-384-192 in transport
218 | | ... | mode.
219 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
220 | | ${encr_alg}= | Crypto Alg AES CBC 256
221 | | ${auth_alg}= | Integ Alg SHA 384 192
222 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
223 | | When Configure manual keyed connection for IPSec
224 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
225 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
226 | | ... | is_ipv6=${TRUE}
227 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
228 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
229 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
230 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
231
232 | TC10: VPP process ESP packet in Transport Mode with AES-CBC-128 encryption and SHA-512-256 integrity
233 | | [Documentation]
234 | | ... | [Top] TG-DUT1.
235 | | ... | [Ref] RFC4303.
236 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
237 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA-512-256 in transport
238 | | ... | mode.
239 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
240 | | [Tags] | SKIP_PATCH
241 | | ${encr_alg}= | Crypto Alg AES CBC 128
242 | | ${auth_alg}= | Integ Alg SHA 512 256
243 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
244 | | When Configure manual keyed connection for IPSec
245 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
246 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
247 | | ... | is_ipv6=${TRUE}
248 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
249 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
250 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
251 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
252
253 | TC11: VPP process ESP packet in Transport Mode with AES-CBC-192 encryption and SHA-512-256 integrity
254 | | [Documentation]
255 | | ... | [Top] TG-DUT1.
256 | | ... | [Ref] RFC4303.
257 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
258 | | ... | algorithm AES-CBC-192 and integrity algorithm SHA-512-256 in transport
259 | | ... | mode.
260 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
261 | | [Tags] | SKIP_PATCH
262 | | ${encr_alg}= | Crypto Alg AES CBC 192
263 | | ${auth_alg}= | Integ Alg SHA 512 256
264 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
265 | | When Configure manual keyed connection for IPSec
266 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
267 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
268 | | ... | is_ipv6=${TRUE}
269 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
270 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
271 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
272 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
273
274 | TC12: VPP process ESP packet in Transport Mode with AES-CBC-256 encryption and SHA-512-256 integrity
275 | | [Documentation]
276 | | ... | [Top] TG-DUT1.
277 | | ... | [Ref] RFC4303.
278 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
279 | | ... | algorithm AES-CBC-256 and integrity algorithm SHA-512-256 in transport
280 | | ... | mode.
281 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
282 | | ${encr_alg}= | Crypto Alg AES CBC 256
283 | | ${auth_alg}= | Integ Alg SHA 512 256
284 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
285 | | When Configure manual keyed connection for IPSec
286 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
287 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
288 | | ... | is_ipv6=${TRUE}
289 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
290 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
291 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
292 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
293
294 | TC13: VPP process ESP packet in Transport Mode with AES-CBC-128 encryption and SHA1-96 integrity - different encryption alogrithms used
295 | | [Documentation]
296 | | ... | [Top] TG-DUT1.
297 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
298 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in transport\
299 | | ... | mode.
300 | | ... | [Ver] Send an ESP packet encrypted by encryption key different from\
301 | | ... | encryption key stored on VPP node from TG to VPP node and expect no\
302 | | ... | response to be received on TG.
303 | | ... | [Ref] RFC4303.
304 | | ${encr_alg}= | Crypto Alg AES CBC 128
305 | | ${auth_alg}= | Integ Alg SHA1 96
306 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
307 | | ${encr_key2}= | And Get Second Random String | ${encr_alg} | Crypto
308 | | When Configure manual keyed connection for IPSec
309 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
310 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
311 | | ... | is_ipv6=${TRUE}
312 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
313 | | ... | Send IPsec Packet and verify ESP encapsulation in received packet
314 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
315 | | ... | ${encr_alg} | ${encr_key2} | ${auth_alg} | ${auth_key} | ${tg_spi}
316 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
317
318 | TC14: VPP process ESP packet in Transport Mode with AES-CBC-128 encryption and SHA1-96 integrity - different integrity alogrithms used
319 | | [Documentation]
320 | | ... | [Top] TG-DUT1.
321 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
322 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in transport\
323 | | ... | mode.
324 | | ... | [Ver] Send an ESP packet authenticated by integrity key different\
325 | | ... | from integrity key stored on VPP node from TG to VPP node and expect\
326 | | ... | no response to be received on TG.
327 | | ... | [Ref] RFC4303.
328 | | ${encr_alg}= | Crypto Alg AES CBC 128
329 | | ${auth_alg}= | Integ Alg SHA1 96
330 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
331 | | ${auth_key2}= | And Get Second Random String | ${auth_alg} | Integ
332 | | When Configure manual keyed connection for IPSec
333 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
334 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
335 | | ... | is_ipv6=${TRUE}
336 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
337 | | ... | Send IPsec Packet and verify ESP encapsulation in received packet
338 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
339 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key2} | ${tg_spi}
340 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
341
342 | TC15: VPP process ESP packet in Transport Mode with AES-CBC-128 encryption and SHA1-96 integrity - different encryption and integrity alogrithms used
343 | | [Documentation]
344 | | ... | [Top] TG-DUT1.
345 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
346 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in transport\
347 | | ... | mode.
348 | | ... | [Ver] Send an ESP packet authenticated by integrity key and encrypted\
349 | | ... | by encryption key different from integrity and encryption keys stored\
350 | | ... | on VPP node from TG to VPP node and expect no response to be received\
351 | | ... | on TG.
352 | | ... | [Ref] RFC4303.
353 | | ${encr_alg}= | Crypto Alg AES CBC 128
354 | | ${auth_alg}= | Integ Alg SHA1 96
355 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
356 | | ${encr_key2}= | And Get Second Random String | ${encr_alg} | Crypto
357 | | ${auth_key2}= | And Get Second Random String | ${auth_alg} | Integ
358 | | When Configure manual keyed connection for IPSec
359 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
360 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
361 | | ... | is_ipv6=${TRUE}
362 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
363 | | ... | Send IPsec Packet and verify ESP encapsulation in received packet
364 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
365 | | ... | ${encr_alg} | ${encr_key2} | ${auth_alg} | ${auth_key2} | ${tg_spi}
366 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
367
368 | TC16: VPP process ESP packet in Transport Mode with AES-CBC-128 encryption and SHA1-96 integrity with update SA keys
369 | | [Documentation]
370 | | ... | [Top] TG-DUT1.
371 | | ... | [Ref] RFC4303.
372 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
373 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in transport\
374 | | ... | mode. Then update SA keys - use new keys.
375 | | ... | [Ver] Send and receive ESP packet between TG and VPP node before\
376 | | ... | and after SA keys update.
377 | | [Tags] | EXPECTED_FAILING
378 | | ${encr_alg}= | Crypto Alg AES CBC 128
379 | | ${auth_alg}= | Integ Alg SHA1 96
380 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
381 | | When Configure manual keyed connection for IPSec
382 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
383 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
384 | | ... | is_ipv6=${TRUE}
385 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
386 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
387 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
388 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
389 | | ${new_encr_key}= | Given Get Second Random String | ${encr_alg} | Crypto
390 | | ${new_auth_key}= | And Get Second Random String | ${auth_alg} | Integ
391 | | When Update IPSec SA keys | ${dut_node} | ${l_sa_id} | ${r_sa_id}
392 | | ... | ${new_encr_key} | ${new_auth_key}
393 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
394 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
395 | | ... | ${encr_alg} | ${new_encr_key} | ${auth_alg} | ${new_auth_key}
396 | | ... | ${tg_spi} | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
397
398 | TC17: VPP process ESP packet in Transport Mode with AES-CBC-128 encryption and SHA1-96 integrity with update SA keys - different encryption alogrithms used
399 | | [Documentation]
400 | | ... | [Top] TG-DUT1.
401 | | ... | [Ref] RFC4303.
402 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
403 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in transport\
404 | | ... | mode. Then update SA keys - use new keys.
405 | | ... | [Ver] Send an ESP packet encrypted by encryption key different from\
406 | | ... | encryption key stored on VPP node from TG to VPP node and expect no\
407 | | ... | response to be received on TG before and after SA keys update.
408 | | ${encr_alg}= | Crypto Alg AES CBC 128
409 | | ${auth_alg}= | Integ Alg SHA1 96
410 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
411 | | When Configure manual keyed connection for IPSec
412 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
413 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
414 | | ... | is_ipv6=${TRUE}
415 | | ${encr_key2}= | And Get Second Random String | ${encr_alg} | Crypto
416 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
417 | | ... | Send IPsec Packet and verify ESP encapsulation in received packet
418 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
419 | | ... | ${encr_alg} | ${encr_key2} | ${auth_alg} | ${auth_key} | ${tg_spi}
420 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
421 | | ${new_encr_key}= | Given Get Second Random String | ${encr_alg} | Crypto
422 | | ${new_auth_key}= | And Get Second Random String | ${auth_alg} | Integ
423 | | When Update IPSec SA keys | ${dut_node} | ${l_sa_id} | ${r_sa_id}
424 | | ... | ${new_encr_key} | ${new_auth_key}
425 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
426 | | ... | Send IPsec Packet and verify ESP encapsulation in received packet
427 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
428 | | ... | ${encr_alg} | ${encr_key2} | ${auth_alg} | ${new_auth_key} | ${tg_spi}
429 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
430
431 | TC18: VPP process ESP packet in Transport Mode with AES-CBC-128 encryption and SHA1-96 integrity with update SA keys - different integrity alogrithms used
432 | | [Documentation]
433 | | ... | [Top] TG-DUT1.
434 | | ... | [Ref] RFC4303.
435 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
436 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in transport\
437 | | ... | mode. Then update SA keys - use new keys.
438 | | ... | [Ver] Send an ESP packet authenticated by integrity key different\
439 | | ... | from integrity key stored on VPP node from TG to VPP node and expect\
440 | | ... | no response to be received on TG before and after SA keys update.
441 | | ${encr_alg}= | Crypto Alg AES CBC 128
442 | | ${auth_alg}= | Integ Alg SHA1 96
443 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
444 | | When Configure manual keyed connection for IPSec
445 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
446 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
447 | | ... | is_ipv6=${TRUE}
448 | | ${auth_key2}= | And Get Second Random String | ${auth_alg} | Integ
449 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
450 | | ... | Send IPsec Packet and verify ESP encapsulation in received packet
451 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
452 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key2} | ${tg_spi}
453 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
454 | | ${new_encr_key}= | Given Get Second Random String | ${encr_alg} | Crypto
455 | | ${new_auth_key}= | And Get Second Random String | ${auth_alg} | Integ
456 | | When Update IPSec SA keys | ${dut_node} | ${l_sa_id} | ${r_sa_id}
457 | | ... | ${new_encr_key} | ${new_auth_key}
458 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
459 | | ... | Send IPsec Packet and verify ESP encapsulation in received packet
460 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
461 | | ... | ${encr_alg} | ${new_encr_key} | ${auth_alg} | ${auth_key2} | ${tg_spi}
462 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
463
464 | TC19: VPP process ESP packet in Transport Mode with AES-CBC-128 encryption and SHA1-96 integrity with update SA keys - different encryption and integrity alogrithms used
465 | | [Documentation]
466 | | ... | [Top] TG-DUT1.
467 | | ... | [Ref] RFC4303.
468 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
469 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in transport\
470 | | ... | mode. Then update SA keys - use new keys.
471 | | ... | [Ver] Send an ESP packet authenticated by integrity key and encrypted\
472 | | ... | by encryption key different from integrity and encryption keys stored\
473 | | ... | on VPP node from TG to VPP node and expect no response to be received\
474 | | ... | on TG before and after SA keys update.
475 | | ${encr_alg}= | Crypto Alg AES CBC 128
476 | | ${auth_alg}= | Integ Alg SHA1 96
477 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
478 | | When Configure manual keyed connection for IPSec
479 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
480 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
481 | | ... | is_ipv6=${TRUE}
482 | | ${encr_key2}= | And Get Second Random String | ${encr_alg} | Crypto
483 | | ${auth_key2}= | And Get Second Random String | ${auth_alg} | Integ
484 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
485 | | ... | Send IPsec Packet and verify ESP encapsulation in received packet
486 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
487 | | ... | ${encr_alg} | ${encr_key2} | ${auth_alg} | ${auth_key2} | ${tg_spi}
488 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
489 | | ${new_encr_key}= | Given Get Second Random String | ${encr_alg} | Crypto
490 | | ${new_auth_key}= | And Get Second Random String | ${auth_alg} | Integ
491 | | When Update IPSec SA keys | ${dut_node} | ${l_sa_id} | ${r_sa_id}
492 | | ... | ${new_encr_key} | ${new_auth_key}
493 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
494 | | ... | Send IPsec Packet and verify ESP encapsulation in received packet
495 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
496 | | ... | ${encr_alg} | ${encr_key2} | ${auth_alg} | ${auth_key2} | ${tg_spi}
497 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
498
499 *** Keywords ***
500 | Get Second Random String
501 | | [Arguments] | ${req_alg} | ${req_type}
502 | | ${req_key_len}= | Run Keyword | Get ${req_type} Alg Key Len | ${req_alg}
503 | | ${key}= | Set Variable If | '${req_type}' == 'Crypto' | ${encr_key}
504 | | ... | '${req_type}' == 'Integ' | ${auth_key}
505 | | :FOR | ${index} | IN RANGE | 100
506 | | | ${req_key}= | Generate Random String | ${req_key_len}
507 | | | Return From Keyword If | '${req_key}' != '${key}' | ${req_key}