FIX: ipsec + vpp stable version update
[csit.git] / tests / vpp / func / crypto / default / eth2p-ethip4ipsectpt-ip4base-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 IPv4 IPSec functional test
20 | ...
21 | Test Teardown | Tear down IPSec functional test | ${dut_node}
22 | ...
23 | Documentation | *IPv4 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 IPv4 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_ip4}= | 192.168.100.2
39 | ${dut_if_ip4}= | 192.168.100.3
40 | ${tg_lo_ip4}= | 192.168.3.3
41 | ${dut_lo_ip4}= | 192.168.4.4
42 | ${ip4_plen}= | ${24}
43
44 *** Test Cases ***
45 | TC01: VPP process ESP packet in Transport Mode with AES-CBC-128 encryption and SHA1-96 integrity
46 | | [Documentation]
47 | | ... | [Top] TG-DUT1.
48 | | ... | [Ref] RFC4303.
49 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
50 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in transport
51 | | ... | mode.
52 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
53 | | ${encr_alg}= | Crypto Alg AES CBC 128
54 | | ${auth_alg}= | Integ Alg SHA1 96
55 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
56 | | When Configure manual keyed connection for IPSec
57 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
58 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
59 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
60 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
61 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
62 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
63
64 | TC02: VPP process ESP packet in Transport Mode with AES-CBC-192 encryption and SHA1-96 integrity
65 | | [Documentation]
66 | | ... | [Top] TG-DUT1.
67 | | ... | [Ref] RFC4303.
68 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
69 | | ... | algorithm AES-CBC-192 and integrity algorithm SHA1-96 in transport
70 | | ... | mode.
71 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
72 | | [Tags] | SKIP_PATCH
73 | | ${encr_alg}= | Crypto Alg AES CBC 192
74 | | ${auth_alg}= | Integ Alg SHA1 96
75 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
76 | | When Configure manual keyed connection for IPSec
77 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
78 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
79 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
80 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
81 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
82 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
83
84 | TC03: VPP process ESP packet in Transport Mode with AES-CBC-256 encryption and SHA1-96 integrity
85 | | [Documentation]
86 | | ... | [Top] TG-DUT1.
87 | | ... | [Ref] RFC4303.
88 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
89 | | ... | algorithm AES-CBC-256 and integrity algorithm SHA1-96 in transport
90 | | ... | mode.
91 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
92 | | [Tags] | SKIP_PATCH
93 | | ${encr_alg}= | Crypto Alg AES CBC 256
94 | | ${auth_alg}= | Integ Alg SHA1 96
95 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
96 | | When Configure manual keyed connection for IPSec
97 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
98 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
99 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
100 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
101 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
102 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
103
104 | TC04: VPP process ESP packet in Transport Mode with AES-CBC-128 encryption and SHA-256-128 integrity
105 | | [Documentation]
106 | | ... | [Top] TG-DUT1.
107 | | ... | [Ref] RFC4303.
108 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
109 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA-256-128 in transport
110 | | ... | mode.
111 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
112 | | [Tags] | SKIP_PATCH
113 | | ${encr_alg}= | Crypto Alg AES CBC 128
114 | | ${auth_alg}= | Integ Alg SHA 256 128
115 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
116 | | When Configure manual keyed connection for IPSec
117 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
118 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
119 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
120 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
121 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
122 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
123
124 | TC05: VPP process ESP packet in Transport Mode with AES-CBC-192 encryption and SHA-256-128 integrity
125 | | [Documentation]
126 | | ... | [Top] TG-DUT1.
127 | | ... | [Ref] RFC4303.
128 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
129 | | ... | algorithm AES-CBC-192 and integrity algorithm SHA-256-128 in transport
130 | | ... | mode.
131 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
132 | | ${encr_alg}= | Crypto Alg AES CBC 192
133 | | ${auth_alg}= | Integ Alg SHA 256 128
134 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
135 | | When Configure manual keyed connection for IPSec
136 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
137 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
138 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
139 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
140 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
141 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
142
143 | TC06: VPP process ESP packet in Transport Mode with AES-CBC-256 encryption and SHA-256-128 integrity
144 | | [Documentation]
145 | | ... | [Top] TG-DUT1.
146 | | ... | [Ref] RFC4303.
147 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
148 | | ... | algorithm AES-CBC-256 and integrity algorithm SHA-256-128 in transport
149 | | ... | mode.
150 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
151 | | [Tags] | SKIP_PATCH
152 | | ${encr_alg}= | Crypto Alg AES CBC 256
153 | | ${auth_alg}= | Integ Alg SHA 256 128
154 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
155 | | When Configure manual keyed connection for IPSec
156 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
157 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
158 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
159 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
160 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
161 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
162
163 | TC07: VPP process ESP packet in Transport Mode with AES-CBC-128 encryption and SHA-384-192 integrity
164 | | [Documentation]
165 | | ... | [Top] TG-DUT1.
166 | | ... | [Ref] RFC4303.
167 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
168 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA-384-192 in transport
169 | | ... | mode.
170 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
171 | | [Tags] | SKIP_PATCH
172 | | ${encr_alg}= | Crypto Alg AES CBC 128
173 | | ${auth_alg}= | Integ Alg SHA 384 192
174 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
175 | | When Configure manual keyed connection for IPSec
176 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
177 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
178 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
179 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
180 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
181 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
182
183 | TC08: VPP process ESP packet in Transport Mode with AES-CBC-192 encryption and SHA-384-192 integrity
184 | | [Documentation]
185 | | ... | [Top] TG-DUT1.
186 | | ... | [Ref] RFC4303.
187 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
188 | | ... | algorithm AES-CBC-192 and integrity algorithm SHA-384-192 in transport
189 | | ... | mode.
190 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
191 | | [Tags] | SKIP_PATCH
192 | | ${encr_alg}= | Crypto Alg AES CBC 192
193 | | ${auth_alg}= | Integ Alg SHA 384 192
194 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
195 | | When Configure manual keyed connection for IPSec
196 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
197 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
198 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
199 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
200 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
201 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
202
203 | TC09: VPP process ESP packet in Transport Mode with AES-CBC-256 encryption and SHA-384-192 integrity
204 | | [Documentation]
205 | | ... | [Top] TG-DUT1.
206 | | ... | [Ref] RFC4303.
207 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
208 | | ... | algorithm AES-CBC-256 and integrity algorithm SHA-384-192 in transport
209 | | ... | mode.
210 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
211 | | ${encr_alg}= | Crypto Alg AES CBC 256
212 | | ${auth_alg}= | Integ Alg SHA 384 192
213 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
214 | | When Configure manual keyed connection for IPSec
215 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
216 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
217 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
218 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
219 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
220 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
221
222 | TC10: VPP process ESP packet in Transport Mode with AES-CBC-128 encryption and SHA-512-256 integrity
223 | | [Documentation]
224 | | ... | [Top] TG-DUT1.
225 | | ... | [Ref] RFC4303.
226 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
227 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA-512-256 in transport
228 | | ... | mode.
229 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
230 | | [Tags] | SKIP_PATCH
231 | | ${encr_alg}= | Crypto Alg AES CBC 128
232 | | ${auth_alg}= | Integ Alg SHA 512 256
233 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
234 | | When Configure manual keyed connection for IPSec
235 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
236 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
237 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
238 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
239 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
240 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
241
242 | TC11: VPP process ESP packet in Transport Mode with AES-CBC-192 encryption and SHA-512-256 integrity
243 | | [Documentation]
244 | | ... | [Top] TG-DUT1.
245 | | ... | [Ref] RFC4303.
246 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
247 | | ... | algorithm AES-CBC-192 and integrity algorithm SHA-512-256 in transport
248 | | ... | mode.
249 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
250 | | [Tags] | SKIP_PATCH
251 | | ${encr_alg}= | Crypto Alg AES CBC 192
252 | | ${auth_alg}= | Integ Alg SHA 512 256
253 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
254 | | When Configure manual keyed connection for IPSec
255 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
256 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
257 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
258 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
259 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
260 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
261
262 | TC12: VPP process ESP packet in Transport Mode with AES-CBC-256 encryption and SHA-512-256 integrity
263 | | [Documentation]
264 | | ... | [Top] TG-DUT1.
265 | | ... | [Ref] RFC4303.
266 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
267 | | ... | algorithm AES-CBC-256 and integrity algorithm SHA-512-256 in transport
268 | | ... | mode.
269 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
270 | | ${encr_alg}= | Crypto Alg AES CBC 256
271 | | ${auth_alg}= | Integ Alg SHA 512 256
272 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
273 | | When Configure manual keyed connection for IPSec
274 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
275 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
276 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
277 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
278 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
279 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
280
281
282 | TC13: VPP process ESP packet in Transport Mode with AES-CBC-128 encryption and SHA1-96 integrity - different encryption alogrithms used
283 | | [Documentation]
284 | | ... | [Top] TG-DUT1.
285 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
286 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in transport\
287 | | ... | mode.
288 | | ... | [Ver] Send an ESP packet encrypted by encryption key different from\
289 | | ... | encryption key stored on VPP node from TG to VPP node and expect no\
290 | | ... | response to be received on TG.
291 | | ... | [Ref] RFC4303.
292 | | ${encr_alg}= | Crypto Alg AES CBC 128
293 | | ${auth_alg}= | Integ Alg SHA1 96
294 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
295 | | ${encr_key2}= | And Get Second Random String | ${encr_alg} | Crypto
296 | | When Configure manual keyed connection for IPSec
297 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
298 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
299 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
300 | | ... | Send IPsec Packet and verify ESP encapsulation in received packet
301 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
302 | | ... | ${encr_alg} | ${encr_key2} | ${auth_alg} | ${auth_key} | ${tg_spi}
303 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
304
305 | TC14: VPP process ESP packet in Transport Mode with AES-CBC-128 encryption and SHA1-96 integrity - different integrity alogrithms used
306 | | [Documentation]
307 | | ... | [Top] TG-DUT1.
308 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
309 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in transport\
310 | | ... | mode.
311 | | ... | [Ver] Send an ESP packet authenticated by integrity key different\
312 | | ... | from integrity key stored on VPP node from TG to VPP node and expect\
313 | | ... | no response to be received on TG.
314 | | ... | [Ref] RFC4303.
315 | | ${encr_alg}= | Crypto Alg AES CBC 128
316 | | ${auth_alg}= | Integ Alg SHA1 96
317 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
318 | | ${auth_key2}= | And Get Second Random String | ${auth_alg} | Integ
319 | | When Configure manual keyed connection for IPSec
320 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
321 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
322 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
323 | | ... | Send IPsec Packet and verify ESP encapsulation in received packet
324 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
325 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key2} | ${tg_spi}
326 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
327
328 | TC15: VPP process ESP packet in Transport Mode with AES-CBC-128 encryption and SHA1-96 integrity - different encryption and integrity alogrithms used
329 | | [Documentation]
330 | | ... | [Top] TG-DUT1.
331 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
332 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in transport\
333 | | ... | mode.
334 | | ... | [Ver] Send an ESP packet authenticated by integrity key and encrypted\
335 | | ... | by encryption key different from integrity and encryption keys stored\
336 | | ... | on VPP node from TG to VPP node and expect no response to be received\
337 | | ... | on TG.
338 | | ... | [Ref] RFC4303.
339 | | ${encr_alg}= | Crypto Alg AES CBC 128
340 | | ${auth_alg}= | Integ Alg SHA1 96
341 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
342 | | ${encr_key2}= | And Get Second Random String | ${encr_alg} | Crypto
343 | | ${auth_key2}= | And Get Second Random String | ${auth_alg} | Integ
344 | | When Configure manual keyed connection for IPSec
345 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
346 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
347 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
348 | | ... | Send IPsec Packet and verify ESP encapsulation in received packet
349 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
350 | | ... | ${encr_alg} | ${encr_key2} | ${auth_alg} | ${auth_key2} | ${tg_spi}
351 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
352
353 | TC16: VPP process ESP packet in Transport Mode with AES-CBC-128 encryption and SHA1-96 integrity with update SA keys
354 | | [Documentation]
355 | | ... | [Top] TG-DUT1.
356 | | ... | [Ref] RFC4303.
357 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
358 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in transport\
359 | | ... | mode. Then update SA keys - use new keys.
360 | | ... | [Ver] Send and receive ESP packet between TG and VPP node before\
361 | | ... | and after SA keys update.
362 | | [Tags] | EXPECTED_FAILING
363 | | ${encr_alg}= | Crypto Alg AES CBC 128
364 | | ${auth_alg}= | Integ Alg SHA1 96
365 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
366 | | When Configure manual keyed connection for IPSec
367 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
368 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
369 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
370 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
371 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
372 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
373 | | ${new_encr_key}= | Given Get Second Random String | ${encr_alg} | Crypto
374 | | ${new_auth_key}= | And Get Second Random String | ${auth_alg} | Integ
375 | | When Update IPSec SA keys | ${dut_node} | ${l_sa_id} | ${r_sa_id}
376 | | ... | ${new_encr_key} | ${new_auth_key}
377 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
378 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
379 | | ... | ${encr_alg} | ${new_encr_key} | ${auth_alg} | ${new_auth_key}
380 | | ... | ${tg_spi} | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
381
382 | 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
383 | | [Documentation]
384 | | ... | [Top] TG-DUT1.
385 | | ... | [Ref] RFC4303.
386 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
387 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in transport\
388 | | ... | mode. Then update SA keys - use new keys.
389 | | ... | [Ver] Send an ESP packet encrypted by encryption key different from\
390 | | ... | encryption key stored on VPP node from TG to VPP node and expect no\
391 | | ... | response to be received on TG before and after SA keys update.
392 | | ${encr_alg}= | Crypto Alg AES CBC 128
393 | | ${auth_alg}= | Integ Alg SHA1 96
394 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
395 | | When Configure manual keyed connection for IPSec
396 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
397 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
398 | | ${encr_key2}= | And Get Second Random String | ${encr_alg} | Crypto
399 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
400 | | ... | Send IPsec Packet and verify ESP encapsulation in received packet
401 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
402 | | ... | ${encr_alg} | ${encr_key2} | ${auth_alg} | ${auth_key} | ${tg_spi}
403 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
404 | | ${new_encr_key}= | Given Get Second Random String | ${encr_alg} | Crypto
405 | | ${new_auth_key}= | And Get Second Random String | ${auth_alg} | Integ
406 | | When Update IPSec SA keys | ${dut_node} | ${l_sa_id} | ${r_sa_id}
407 | | ... | ${new_encr_key} | ${new_auth_key}
408 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
409 | | ... | Send IPsec Packet and verify ESP encapsulation in received packet
410 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
411 | | ... | ${encr_alg} | ${encr_key2} | ${auth_alg} | ${new_auth_key} | ${tg_spi}
412 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
413
414 | 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
415 | | [Documentation]
416 | | ... | [Top] TG-DUT1.
417 | | ... | [Ref] RFC4303.
418 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
419 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in transport\
420 | | ... | mode. Then update SA keys - use new keys.
421 | | ... | [Ver] Send an ESP packet authenticated by integrity key different\
422 | | ... | from integrity key stored on VPP node from TG to VPP node and expect\
423 | | ... | no response to be received on TG before and after SA keys update.
424 | | ${encr_alg}= | Crypto Alg AES CBC 128
425 | | ${auth_alg}= | Integ Alg SHA1 96
426 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
427 | | When Configure manual keyed connection for IPSec
428 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
429 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
430 | | ${auth_key2}= | And Get Second Random String | ${auth_alg} | Integ
431 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
432 | | ... | Send IPsec Packet and verify ESP encapsulation in received packet
433 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
434 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key2} | ${tg_spi}
435 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
436 | | ${new_encr_key}= | Given Get Second Random String | ${encr_alg} | Crypto
437 | | ${new_auth_key}= | And Get Second Random String | ${auth_alg} | Integ
438 | | When Update IPSec SA keys | ${dut_node} | ${l_sa_id} | ${r_sa_id}
439 | | ... | ${new_encr_key} | ${new_auth_key}
440 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
441 | | ... | Send IPsec Packet and verify ESP encapsulation in received packet
442 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
443 | | ... | ${encr_alg} | ${new_encr_key} | ${auth_alg} | ${auth_key2} | ${tg_spi}
444 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
445
446 | 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
447 | | [Documentation]
448 | | ... | [Top] TG-DUT1.
449 | | ... | [Ref] RFC4303.
450 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
451 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in transport\
452 | | ... | mode. Then update SA keys - use new keys.
453 | | ... | [Ver] Send an ESP packet authenticated by integrity key and encrypted\
454 | | ... | by encryption key different from integrity and encryption keys stored\
455 | | ... | on VPP node from TG to VPP node and expect no response to be received\
456 | | ... | on TG before and after SA keys update.
457 | | ${encr_alg}= | Crypto Alg AES CBC 128
458 | | ${auth_alg}= | Integ Alg SHA1 96
459 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
460 | | When Configure manual keyed connection for IPSec
461 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
462 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
463 | | ${encr_key2}= | And Get Second Random String | ${encr_alg} | Crypto
464 | | ${auth_key2}= | And Get Second Random String | ${auth_alg} | Integ
465 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
466 | | ... | Send IPsec Packet and verify ESP encapsulation in received packet
467 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
468 | | ... | ${encr_alg} | ${encr_key2} | ${auth_alg} | ${auth_key2} | ${tg_spi}
469 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
470 | | ${new_encr_key}= | Given Get Second Random String | ${encr_alg} | Crypto
471 | | ${new_auth_key}= | And Get Second Random String | ${auth_alg} | Integ
472 | | When Update IPSec SA keys | ${dut_node} | ${l_sa_id} | ${r_sa_id}
473 | | ... | ${new_encr_key} | ${new_auth_key}
474 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
475 | | ... | Send IPsec Packet and verify ESP encapsulation in received packet
476 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
477 | | ... | ${encr_alg} | ${encr_key2} | ${auth_alg} | ${auth_key2} | ${tg_spi}
478 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
479
480 *** Keywords ***
481 | Get Second Random String
482 | | [Arguments] | ${req_alg} | ${req_type}
483 | | ${req_key_len}= | Run Keyword | Get ${req_type} Alg Key Len | ${req_alg}
484 | | ${key}= | Set Variable If | '${req_type}' == 'Crypto' | ${encr_key}
485 | | ... | '${req_type}' == 'Integ' | ${auth_key}
486 | | :FOR | ${index} | IN RANGE | 100
487 | | | ${req_key}= | Generate Random String | ${req_key_len}
488 | | | Return From Keyword If | '${req_key}' != '${key}' | ${req_key}