CSIT-687: Directory structure reorganization
[csit.git] / tests / vpp / func / crypto / 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 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
61 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
62 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
63 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
64
65 | TC02: VPP process ESP packet in Transport Mode with AES-CBC-192 encryption and SHA1-96 integrity
66 | | [Documentation]
67 | | ... | [Top] TG-DUT1.
68 | | ... | [Ref] RFC4303.
69 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
70 | | ... | algorithm AES-CBC-192 and integrity algorithm SHA1-96 in transport
71 | | ... | mode.
72 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
73 | | [Tags] | SKIP_PATCH
74 | | ${encr_alg}= | Crypto Alg AES CBC 192
75 | | ${auth_alg}= | Integ Alg SHA1 96
76 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
77 | | When Configure manual keyed connection for IPSec
78 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
79 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
80 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
81 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
82 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
83 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
84
85 | TC03: VPP process ESP packet in Transport Mode with AES-CBC-256 encryption and SHA1-96 integrity
86 | | [Documentation]
87 | | ... | [Top] TG-DUT1.
88 | | ... | [Ref] RFC4303.
89 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
90 | | ... | algorithm AES-CBC-256 and integrity algorithm SHA1-96 in transport
91 | | ... | mode.
92 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
93 | | [Tags] | SKIP_PATCH
94 | | ${encr_alg}= | Crypto Alg AES CBC 256
95 | | ${auth_alg}= | Integ Alg SHA1 96
96 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
97 | | When Configure manual keyed connection for IPSec
98 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
99 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
100 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
101 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
102 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
103 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
104
105 | TC04: VPP process ESP packet in Transport Mode with AES-CBC-128 encryption and SHA-256-128 integrity
106 | | [Documentation]
107 | | ... | [Top] TG-DUT1.
108 | | ... | [Ref] RFC4303.
109 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
110 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA-256-128 in transport
111 | | ... | mode.
112 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
113 | | [Tags] | SKIP_PATCH
114 | | ${encr_alg}= | Crypto Alg AES CBC 128
115 | | ${auth_alg}= | Integ Alg SHA 256 128
116 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
117 | | When Configure manual keyed connection for IPSec
118 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
119 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
120 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
121 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
122 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
123 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
124
125 | TC05: VPP process ESP packet in Transport Mode with AES-CBC-192 encryption and SHA-256-128 integrity
126 | | [Documentation]
127 | | ... | [Top] TG-DUT1.
128 | | ... | [Ref] RFC4303.
129 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
130 | | ... | algorithm AES-CBC-192 and integrity algorithm SHA-256-128 in transport
131 | | ... | mode.
132 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
133 | | ${encr_alg}= | Crypto Alg AES CBC 192
134 | | ${auth_alg}= | Integ Alg SHA 256 128
135 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
136 | | When Configure manual keyed connection for IPSec
137 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
138 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
139 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
140 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
141 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
142 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
143
144 | TC06: VPP process ESP packet in Transport Mode with AES-CBC-256 encryption and SHA-256-128 integrity
145 | | [Documentation]
146 | | ... | [Top] TG-DUT1.
147 | | ... | [Ref] RFC4303.
148 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
149 | | ... | algorithm AES-CBC-256 and integrity algorithm SHA-256-128 in transport
150 | | ... | mode.
151 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
152 | | [Tags] | SKIP_PATCH
153 | | ${encr_alg}= | Crypto Alg AES CBC 256
154 | | ${auth_alg}= | Integ Alg SHA 256 128
155 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
156 | | When Configure manual keyed connection for IPSec
157 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
158 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
159 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
160 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
161 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
162 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
163
164 | TC07: VPP process ESP packet in Transport Mode with AES-CBC-128 encryption and SHA-384-192 integrity
165 | | [Documentation]
166 | | ... | [Top] TG-DUT1.
167 | | ... | [Ref] RFC4303.
168 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
169 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA-384-192 in transport
170 | | ... | mode.
171 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
172 | | [Tags] | SKIP_PATCH
173 | | ${encr_alg}= | Crypto Alg AES CBC 128
174 | | ${auth_alg}= | Integ Alg SHA 384 192
175 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
176 | | When Configure manual keyed connection for IPSec
177 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
178 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
179 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
180 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
181 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
182 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
183
184 | TC08: VPP process ESP packet in Transport Mode with AES-CBC-192 encryption and SHA-384-192 integrity
185 | | [Documentation]
186 | | ... | [Top] TG-DUT1.
187 | | ... | [Ref] RFC4303.
188 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
189 | | ... | algorithm AES-CBC-192 and integrity algorithm SHA-384-192 in transport
190 | | ... | mode.
191 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
192 | | [Tags] | SKIP_PATCH
193 | | ${encr_alg}= | Crypto Alg AES CBC 192
194 | | ${auth_alg}= | Integ Alg SHA 384 192
195 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
196 | | When Configure manual keyed connection for IPSec
197 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
198 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
199 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
200 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
201 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
202 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
203
204 | TC09: VPP process ESP packet in Transport Mode with AES-CBC-256 encryption and SHA-384-192 integrity
205 | | [Documentation]
206 | | ... | [Top] TG-DUT1.
207 | | ... | [Ref] RFC4303.
208 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
209 | | ... | algorithm AES-CBC-256 and integrity algorithm SHA-384-192 in transport
210 | | ... | mode.
211 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
212 | | ${encr_alg}= | Crypto Alg AES CBC 256
213 | | ${auth_alg}= | Integ Alg SHA 384 192
214 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
215 | | When Configure manual keyed connection for IPSec
216 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
217 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
218 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
219 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
220 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
221 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
222
223 | TC10: VPP process ESP packet in Transport Mode with AES-CBC-128 encryption and SHA-512-256 integrity
224 | | [Documentation]
225 | | ... | [Top] TG-DUT1.
226 | | ... | [Ref] RFC4303.
227 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
228 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA-512-256 in transport
229 | | ... | mode.
230 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
231 | | [Tags] | SKIP_PATCH
232 | | ${encr_alg}= | Crypto Alg AES CBC 128
233 | | ${auth_alg}= | Integ Alg SHA 512 256
234 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
235 | | When Configure manual keyed connection for IPSec
236 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
237 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
238 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
239 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
240 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
241 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
242
243 | TC11: VPP process ESP packet in Transport Mode with AES-CBC-192 encryption and SHA-512-256 integrity
244 | | [Documentation]
245 | | ... | [Top] TG-DUT1.
246 | | ... | [Ref] RFC4303.
247 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
248 | | ... | algorithm AES-CBC-192 and integrity algorithm SHA-512-256 in transport
249 | | ... | mode.
250 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
251 | | [Tags] | SKIP_PATCH
252 | | ${encr_alg}= | Crypto Alg AES CBC 192
253 | | ${auth_alg}= | Integ Alg SHA 512 256
254 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
255 | | When Configure manual keyed connection for IPSec
256 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
257 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
258 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
259 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
260 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
261 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
262
263 | TC12: VPP process ESP packet in Transport Mode with AES-CBC-256 encryption and SHA-512-256 integrity
264 | | [Documentation]
265 | | ... | [Top] TG-DUT1.
266 | | ... | [Ref] RFC4303.
267 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
268 | | ... | algorithm AES-CBC-256 and integrity algorithm SHA-512-256 in transport
269 | | ... | mode.
270 | | ... | [Ver] Send and receive ESP packet between TG and VPP node.
271 | | ${encr_alg}= | Crypto Alg AES CBC 256
272 | | ${auth_alg}= | Integ Alg SHA 512 256
273 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
274 | | When Configure manual keyed connection for IPSec
275 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
276 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
277 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
278 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
279 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
280 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
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 | | ${encr_alg}= | Crypto Alg AES CBC 128
363 | | ${auth_alg}= | Integ Alg SHA1 96
364 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
365 | | When Configure manual keyed connection for IPSec
366 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
367 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
368 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
369 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
370 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key} | ${tg_spi}
371 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
372 | | ${new_encr_key}= | Given Get Second Random String | ${encr_alg} | Crypto
373 | | ${new_auth_key}= | And Get Second Random String | ${auth_alg} | Integ
374 | | When Update IPSec SA keys | ${dut_node} | ${l_sa_id} | ${r_sa_id}
375 | | ... | ${new_encr_key} | ${new_auth_key}
376 | | Then Send IPsec Packet and verify ESP encapsulation in received packet
377 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
378 | | ... | ${encr_alg} | ${new_encr_key} | ${auth_alg} | ${new_auth_key}
379 | | ... | ${tg_spi} | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
380
381 | 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
382 | | [Documentation]
383 | | ... | [Top] TG-DUT1.
384 | | ... | [Ref] RFC4303.
385 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
386 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in transport\
387 | | ... | mode. Then update SA keys - use new keys.
388 | | ... | [Ver] Send an ESP packet encrypted by encryption key different from\
389 | | ... | encryption key stored on VPP node from TG to VPP node and expect no\
390 | | ... | response to be received on TG before and after SA keys update.
391 | | ${encr_alg}= | Crypto Alg AES CBC 128
392 | | ${auth_alg}= | Integ Alg SHA1 96
393 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
394 | | When Configure manual keyed connection for IPSec
395 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
396 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
397 | | ${encr_key2}= | And Get Second Random String | ${encr_alg} | Crypto
398 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
399 | | ... | Send IPsec Packet and verify ESP encapsulation in received packet
400 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
401 | | ... | ${encr_alg} | ${encr_key2} | ${auth_alg} | ${auth_key} | ${tg_spi}
402 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
403 | | ${new_encr_key}= | Given Get Second Random String | ${encr_alg} | Crypto
404 | | ${new_auth_key}= | And Get Second Random String | ${auth_alg} | Integ
405 | | When Update IPSec SA keys | ${dut_node} | ${l_sa_id} | ${r_sa_id}
406 | | ... | ${new_encr_key} | ${new_auth_key}
407 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
408 | | ... | Send IPsec Packet and verify ESP encapsulation in received packet
409 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
410 | | ... | ${encr_alg} | ${encr_key2} | ${auth_alg} | ${new_auth_key} | ${tg_spi}
411 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
412
413 | 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
414 | | [Documentation]
415 | | ... | [Top] TG-DUT1.
416 | | ... | [Ref] RFC4303.
417 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
418 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in transport\
419 | | ... | mode. Then update SA keys - use new keys.
420 | | ... | [Ver] Send an ESP packet authenticated by integrity key different\
421 | | ... | from integrity key stored on VPP node from TG to VPP node and expect\
422 | | ... | no response to be received on TG before and after SA keys update.
423 | | ${encr_alg}= | Crypto Alg AES CBC 128
424 | | ${auth_alg}= | Integ Alg SHA1 96
425 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
426 | | When Configure manual keyed connection for IPSec
427 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
428 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
429 | | ${auth_key2}= | And Get Second Random String | ${auth_alg} | Integ
430 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
431 | | ... | Send IPsec Packet and verify ESP encapsulation in received packet
432 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
433 | | ... | ${encr_alg} | ${encr_key} | ${auth_alg} | ${auth_key2} | ${tg_spi}
434 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
435 | | ${new_encr_key}= | Given Get Second Random String | ${encr_alg} | Crypto
436 | | ${new_auth_key}= | And Get Second Random String | ${auth_alg} | Integ
437 | | When Update IPSec SA keys | ${dut_node} | ${l_sa_id} | ${r_sa_id}
438 | | ... | ${new_encr_key} | ${new_auth_key}
439 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
440 | | ... | Send IPsec Packet and verify ESP encapsulation in received packet
441 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
442 | | ... | ${encr_alg} | ${new_encr_key} | ${auth_alg} | ${auth_key2} | ${tg_spi}
443 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
444
445 | 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
446 | | [Documentation]
447 | | ... | [Top] TG-DUT1.
448 | | ... | [Ref] RFC4303.
449 | | ... | [Cfg] On DUT1 configure IPsec manual keyed connection with encryption\
450 | | ... | algorithm AES-CBC-128 and integrity algorithm SHA1-96 in transport\
451 | | ... | mode. Then update SA keys - use new keys.
452 | | ... | [Ver] Send an ESP packet authenticated by integrity key and encrypted\
453 | | ... | by encryption key different from integrity and encryption keys stored\
454 | | ... | on VPP node from TG to VPP node and expect no response to be received\
455 | | ... | on TG before and after SA keys update.
456 | | ${encr_alg}= | Crypto Alg AES CBC 128
457 | | ${auth_alg}= | Integ Alg SHA1 96
458 | | Given Generate keys for IPSec | ${encr_alg} | ${auth_alg}
459 | | When Configure manual keyed connection for IPSec
460 | | ... | ${dut_node} | ${dut_if} | ${encr_alg} | ${encr_key} | ${auth_alg}
461 | | ... | ${auth_key} | ${dut_spi} | ${tg_spi} | ${dut_tun_ip} | ${tg_tun_ip}
462 | | ${encr_key2}= | And Get Second Random String | ${encr_alg} | Crypto
463 | | ${auth_key2}= | And Get Second Random String | ${auth_alg} | Integ
464 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
465 | | ... | Send IPsec Packet and verify ESP encapsulation in received packet
466 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
467 | | ... | ${encr_alg} | ${encr_key2} | ${auth_alg} | ${auth_key2} | ${tg_spi}
468 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
469 | | ${new_encr_key}= | Given Get Second Random String | ${encr_alg} | Crypto
470 | | ${new_auth_key}= | And Get Second Random String | ${auth_alg} | Integ
471 | | When Update IPSec SA keys | ${dut_node} | ${l_sa_id} | ${r_sa_id}
472 | | ... | ${new_encr_key} | ${new_auth_key}
473 | | Then Run Keyword And Expect Error | ESP packet Rx timeout
474 | | ... | Send IPsec Packet and verify ESP encapsulation in received packet
475 | | ... | ${tg_node} | ${tg_if} | ${dut_if_mac}
476 | | ... | ${encr_alg} | ${encr_key2} | ${auth_alg} | ${auth_key2} | ${tg_spi}
477 | | ... | ${dut_spi} | ${tg_tun_ip} | ${dut_tun_ip}
478
479 *** Keywords ***
480 | Get Second Random String
481 | | [Arguments] | ${req_alg} | ${req_type}
482 | | ${req_key_len}= | Run Keyword | Get ${req_type} Alg Key Len | ${req_alg}
483 | | ${key}= | Set Variable If | '${req_type}' == 'Crypto' | ${encr_key}
484 | | ... | '${req_type}' == 'Integ' | ${auth_key}
485 | | :FOR | ${index} | IN RANGE | 100
486 | | | ${req_key}= | Generate Random String | ${req_key_len}
487 | | | Return From Keyword If | '${req_key}' != '${key}' | ${req_key}